From 67c448572ca51bb761bf3e8d0c4865470718807f Mon Sep 17 00:00:00 2001
From: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
Date: Mon, 12 Feb 2024 21:24:49 +0100
Subject: [PATCH] style: tweaks to settings (#772)
---
.../app-settings/panel/Panel.module.scss | 31 +++++++++--
.../app-settings/panel/PanelUtils.tsx | 22 ++++++--
.../integrations-panel/HttpIntegrations.tsx | 44 +++++++++-------
.../IntegrationsPanel.module.css | 8 +--
.../integrations-panel/IntegrationsPanel.tsx | 6 ++-
.../integrations-panel/OscIntegrations.tsx | 51 +++++++++++--------
.../features/app-settings/settingsStore.ts | 4 +-
7 files changed, 111 insertions(+), 55 deletions(-)
diff --git a/apps/client/src/features/app-settings/panel/Panel.module.scss b/apps/client/src/features/app-settings/panel/Panel.module.scss
index 2a7abdc37..cd7399627 100644
--- a/apps/client/src/features/app-settings/panel/Panel.module.scss
+++ b/apps/client/src/features/app-settings/panel/Panel.module.scss
@@ -1,3 +1,5 @@
+$inner-padding: 1rem;
+
.header {
font-size: 2rem;
padding-bottom: 0.5rem;
@@ -6,16 +8,24 @@
}
.subheader {
- font-size: 1.25rem;
- padding-bottom: 0.25rem;
+ font-size: 1.5rem;
+ padding-bottom: 0.5rem;
font-weight: 600;
display: flex;
align-items: center;
justify-content: space-between;
}
+.title {
+ font-size: 1.25rem;
+ padding-left: $inner-padding;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
.section {
- margin: 2rem 0;
+ margin-top: 2rem;
font-size: calc(1rem - 1px);
max-width: 800px;
}
@@ -25,7 +35,7 @@
}
.card {
- padding: 1rem;
+ padding: 2rem;
background-color: $white-1;
border: 1px solid $gray-1100;
border-radius: 3px;
@@ -37,6 +47,12 @@
color: $error-red;
}
+.pad {
+ padding: 0 1rem;
+ max-height: 500px;
+ overflow-y: scroll;
+}
+
.table {
width: 100%;
border-collapse: collapse;
@@ -64,7 +80,7 @@
}
.listGroup {
- padding: 1rem 0;
+ padding: 0.5rem 1rem 0 1rem;
> li:not(:last-child) {
border-bottom: 1px solid $white-10;
@@ -92,3 +108,8 @@
font-size: calc(1rem - 2px);
color: $red-500;
}
+
+.divider {
+ border-top: 1px solid $white-10;
+ margin: 1rem -2rem;
+}
diff --git a/apps/client/src/features/app-settings/panel/PanelUtils.tsx b/apps/client/src/features/app-settings/panel/PanelUtils.tsx
index 5b861eeea..fdbcffea0 100644
--- a/apps/client/src/features/app-settings/panel/PanelUtils.tsx
+++ b/apps/client/src/features/app-settings/panel/PanelUtils.tsx
@@ -10,6 +10,10 @@ export function SubHeader({ children }: { children: ReactNode }) {
return
{children}
;
}
+export function Title({ children }: { children: ReactNode }) {
+ return {children}
;
+}
+
type AllowedTags = 'div' | 'form';
type SectionProps = {
as?: C;
@@ -29,12 +33,20 @@ export function Paragraph({ children }: { children: ReactNode }) {
return {children}
;
}
-export function Card({ children }: { children: ReactNode }) {
- return {children}
;
+export function Card({ children, ...props }: { children: ReactNode } & JSX.IntrinsicElements['div']) {
+ return (
+
+ {children}
+
+ );
}
export function Table({ children }: { children: ReactNode }) {
- return ;
+ return (
+
+ );
}
export function ListGroup({ children }: { children: ReactNode }) {
@@ -62,3 +74,7 @@ export function Description({ children }: { children: ReactNode }) {
export function Error({ children }: { children: ReactNode }) {
return {children}
;
}
+
+export function Divider() {
+ return
;
+}
diff --git a/apps/client/src/features/app-settings/panel/integrations-panel/HttpIntegrations.tsx b/apps/client/src/features/app-settings/panel/integrations-panel/HttpIntegrations.tsx
index 2e9b29e1e..02526a88b 100644
--- a/apps/client/src/features/app-settings/panel/integrations-panel/HttpIntegrations.tsx
+++ b/apps/client/src/features/app-settings/panel/integrations-panel/HttpIntegrations.tsx
@@ -71,36 +71,44 @@ export default function HttpIntegrations() {
const canSubmit = !isSubmitting && isDirty && isValid;
return (
-
-
+
+
- HTTP settings
+ HTTP
-
- {errors?.root && {errors.root.message}}
-
-
-
-
-
-
-
-
-
-
+
+ {errors?.root && {errors.root.message}}
+
+
+
+
+
+
+
+
+
+
HTTP Integration
} onClick={handleAddNewSubscription}>
New
-
+
{fields.length > 0 && (
@@ -166,8 +174,8 @@ export default function HttpIntegrations() {
)}
-
-
+
+
);
}
diff --git a/apps/client/src/features/app-settings/panel/integrations-panel/IntegrationsPanel.module.css b/apps/client/src/features/app-settings/panel/integrations-panel/IntegrationsPanel.module.css
index acae1956c..c11bd6e4f 100644
--- a/apps/client/src/features/app-settings/panel/integrations-panel/IntegrationsPanel.module.css
+++ b/apps/client/src/features/app-settings/panel/integrations-panel/IntegrationsPanel.module.css
@@ -1,12 +1,12 @@
.fullWidth {
- width: 100%;
+ width: 100%;
}
.fitContents {
- width: max-content !important; /* override chakra */
+ width: max-content !important; /* override chakra */
}
.flex {
- display: flex;
- gap: 1rem;
+ display: flex;
+ gap: 1rem;
}
diff --git a/apps/client/src/features/app-settings/panel/integrations-panel/IntegrationsPanel.tsx b/apps/client/src/features/app-settings/panel/integrations-panel/IntegrationsPanel.tsx
index ed3be56f8..b8a2e974f 100644
--- a/apps/client/src/features/app-settings/panel/integrations-panel/IntegrationsPanel.tsx
+++ b/apps/client/src/features/app-settings/panel/integrations-panel/IntegrationsPanel.tsx
@@ -24,8 +24,10 @@ export default function IntegrationsPanel() {
-
-
+
+
+
+
>
);
}
diff --git a/apps/client/src/features/app-settings/panel/integrations-panel/OscIntegrations.tsx b/apps/client/src/features/app-settings/panel/integrations-panel/OscIntegrations.tsx
index a4f2e924e..26b94eb71 100644
--- a/apps/client/src/features/app-settings/panel/integrations-panel/OscIntegrations.tsx
+++ b/apps/client/src/features/app-settings/panel/integrations-panel/OscIntegrations.tsx
@@ -77,19 +77,27 @@ export default function OscIntegrations() {
const canSubmit = !isSubmitting && isDirty && isValid;
return (
-
-
-
- Open Sound Control settings
-
- reset()} isDisabled={!canSubmit}>
- Reset
-
-
- Save changes
-
-
-
+
+
+ Open Sound Control
+
+ reset()} isDisabled={!canSubmit}>
+ Reset
+
+
+ Save changes
+
+
+
+
+
{errors?.root && {errors.root.message}}
@@ -178,15 +186,16 @@ export default function OscIntegrations() {
/>
-
-
-
- OSC Integration
+
+
+
+ OSC Integrations
} onClick={handleAddNewSubscription}>
- New
+ Add
-
+
+
{fields.length > 0 && (
@@ -253,7 +262,7 @@ export default function OscIntegrations() {
)}
-
-
+
+
);
}
diff --git a/apps/client/src/features/app-settings/settingsStore.ts b/apps/client/src/features/app-settings/settingsStore.ts
index 594040a70..1e6cfffbe 100644
--- a/apps/client/src/features/app-settings/settingsStore.ts
+++ b/apps/client/src/features/app-settings/settingsStore.ts
@@ -30,8 +30,8 @@ export const settingPanels: Readonly = [
id: 'integrations',
label: 'Integrations',
secondary: [
- { id: 'integrations__osc', label: 'OSC Integration' },
- { id: 'integrations__http', label: 'HTTP Integration' },
+ { id: 'integrations__osc', label: 'OSC settings' },
+ { id: 'integrations__http', label: 'HTTP settings' },
],
},
{ id: 'log', label: 'Log', split: true },