From 67499e1749acb377b8735a2df032dd203cc80f52 Mon Sep 17 00:00:00 2001 From: balzack Date: Wed, 13 Nov 2024 00:26:01 -0800 Subject: [PATCH] setting sticky header for settings and profile --- app/client/web/src/App.tsx | 2 +- app/client/web/src/card/Card.module.css | 2 +- app/client/web/src/constants/Strings.ts | 2 - .../web/src/contacts/Contacts.module.css | 2 +- app/client/web/src/content/Content.tsx | 2 +- app/client/web/src/profile/Profile.module.css | 15 +- app/client/web/src/profile/Profile.tsx | 10 +- .../web/src/settings/Settings.module.css | 29 +- app/client/web/src/settings/Settings.tsx | 300 +++++++++--------- 9 files changed, 195 insertions(+), 169 deletions(-) diff --git a/app/client/web/src/App.tsx b/app/client/web/src/App.tsx index 431d8d63..5af323d6 100644 --- a/app/client/web/src/App.tsx +++ b/app/client/web/src/App.tsx @@ -19,7 +19,7 @@ const theme = createTheme({ 'databag-green': ['#eef6f2', '#cce5d9', '#aad4bf', '#68c4af', '#559e83', '#559e83', '#3c7759', '#2b5540', '#1a3326', '#09110d'], 'dark-surface': ['#000000', '#111111', '#222222', '#333333', '#444444', '#555555', '#666666', '#777777', '#888888', '#999999'], 'light-surface': ['#ffffff', '#eeeeee', '#dddddd', '#cccccc', '#bbbbbb', '#aaaaaa', '#999999', '#888888', '#777777', '#666666'], - 'dark-text': ['#ffffff', '#eeeeee', '#dddddd', '#cccccc', '#bbbbbb', '#aaaaaa', '#999999', '#888888', '#777777', '#666666'], + 'dark-text': ['#ffffff', '#eeeeee', '#dddddd', '#cccccc', '#bbbbbb', '#aaaaaa', '#999999', '#666666', '#444444', '#222222'], 'light-text': ['#000000', '#111111', '#222222', '#333333', '#444444', '#555555', '#666666', '#777777', '#888888', '#999999'], 'dark-databag-green': ['#99bb99', '#559e83', '#559e83', '#559e83', '#559e83', '#559e83', '#559e83', '#559e83', '#559e83', '#559e83'], 'light-databag-green': ['#888888', '#448844', '#448844', '#448844', '#448844', '#448844', '#448844', '#448844', '#448844', '#448844'], diff --git a/app/client/web/src/card/Card.module.css b/app/client/web/src/card/Card.module.css index 8a5d1e0b..a2e16dff 100644 --- a/app/client/web/src/card/Card.module.css +++ b/app/client/web/src/card/Card.module.css @@ -53,7 +53,7 @@ text-overflow: ellipsis; overflow: hidden; font-style: italic; - color: var(--mantine-color-text-9); + color: var(--mantine-color-text-7); } .handle { diff --git a/app/client/web/src/constants/Strings.ts b/app/client/web/src/constants/Strings.ts index bc2fbf62..9d9f2966 100644 --- a/app/client/web/src/constants/Strings.ts +++ b/app/client/web/src/constants/Strings.ts @@ -1,5 +1,3 @@ -import {NativeModules, Platform} from 'react-native'; - export const en = { unknown: 'Unknown', sealed: 'Sealed', diff --git a/app/client/web/src/contacts/Contacts.module.css b/app/client/web/src/contacts/Contacts.module.css index 5ddcb597..7bf78525 100644 --- a/app/client/web/src/contacts/Contacts.module.css +++ b/app/client/web/src/contacts/Contacts.module.css @@ -14,7 +14,7 @@ padding-left: 16px; padding-right: 16px; padding-bottom: 8px; - border-bottom: 2px solid var(--mantine-color-text-9); + border-bottom: 2px solid var(--mantine-color-text-8); width: 100%; .input { diff --git a/app/client/web/src/content/Content.tsx b/app/client/web/src/content/Content.tsx index 048b2349..e50d5aae 100644 --- a/app/client/web/src/content/Content.tsx +++ b/app/client/web/src/content/Content.tsx @@ -46,7 +46,7 @@ export function Content({ select }: { select: (focus: Focus) => void }) { )} - {channels.length === 0 &&
{state.strings.noContacts}
} + {channels.length === 0 &&
{state.strings.noTopics}
} {channels.length !== 0 &&
{channels}
} {state.layout === 'large' && (
diff --git a/app/client/web/src/profile/Profile.module.css b/app/client/web/src/profile/Profile.module.css index e853c427..30e5d7a5 100644 --- a/app/client/web/src/profile/Profile.module.css +++ b/app/client/web/src/profile/Profile.module.css @@ -1,21 +1,21 @@ .contact { + position: relative; display: flex; flex-direction: column; align-items: center; - padding-left: 16px; - padding-right: 16px; - padding-top: 8px; - padding-bottom: 4px; width: 100%; + height: 100%; .detail { - flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; flex-grow: 1; width: 100%; + overflow: scroll; + padding-left: 16px; + padding-right: 16px; } .header { @@ -23,6 +23,11 @@ flex-direction: row; align-items: center; width: 100%; + border-bottom: 1px solid var(--mantine-color-text-9); + padding-left: 16px; + padding-right: 16px; + height: 48px; + flex-shrink: 0; } .close { diff --git a/app/client/web/src/profile/Profile.tsx b/app/client/web/src/profile/Profile.tsx index 78dae0a2..48a4f386 100644 --- a/app/client/web/src/profile/Profile.tsx +++ b/app/client/web/src/profile/Profile.tsx @@ -237,12 +237,12 @@ export function Profile({ params, close }: { params: ProfileParams; close?: () = return (
+
+ {close && } + {`${state.handle}${state.node ? '/' + state.node : ''}`} + {close && } +
-
- {close && } - {`${state.handle}${state.node ? '/' + state.node : ''}`} - {close && } -
diff --git a/app/client/web/src/settings/Settings.module.css b/app/client/web/src/settings/Settings.module.css index 1df5c908..35b0d343 100644 --- a/app/client/web/src/settings/Settings.module.css +++ b/app/client/web/src/settings/Settings.module.css @@ -85,13 +85,10 @@ display: flex; flex-direction: column; align-items: center; - padding-left: 16px; - padding-right: 16px; - padding-top: 8px; - padding-bottom: 8px; gap: 2px; + height: 100%; - .header { + .headerLabel { font-size: 22px; text-align: center; text-wrap: nowrap; @@ -100,6 +97,28 @@ width: 100%; } + .header { + padding-top: 4px; + padding-bottom: 4px; + padding-left: 16px; + padding-right: 16px; + width: 100%; + height: 48px; + flex-shrink: 0; + border-bottom: 1px solid var(--mantine-color-text-7); + } + + .detail { + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; + overflow: scroll; + padding-left: 16px; + padding-right: 16px; + width: 100%; + } + .image { position: relative; width: 90%; diff --git a/app/client/web/src/settings/Settings.tsx b/app/client/web/src/settings/Settings.tsx index bc8d023a..914a497e 100644 --- a/app/client/web/src/settings/Settings.tsx +++ b/app/client/web/src/settings/Settings.tsx @@ -336,180 +336,184 @@ export function Settings({ showLogout }: { showLogout: boolean }) { <> {state.profileSet && (
- {`${state.profile.handle}${state.profile.node ? '/' + state.profile.node : ''}`} -
- {state.profile.imageSet && ( -
- -
- - {state.strings.edit} - +
+ {`${state.profile.handle}${state.profile.node ? '/' + state.profile.node : ''}`} +
+
+
+ {state.profile.imageSet && ( +
+ +
+ + {state.strings.edit} + +
-
- )} - {!state.profile.imageSet && ( -
- - {state.strings.edit} -
- )} -
-
-
- - {state.strings.edit} - -
- {!state.profile.name && {state.strings.name}} - {state.profile.name && {state.profile.name}} -
-
- + )} + {!state.profile.imageSet && ( +
+ + {state.strings.edit} +
+ )}
- {!state.profile.location && {state.strings.location}} - {state.profile.location && {state.profile.location}} -
-
-
- +
+
+ + {state.strings.edit} +
- {!state.profile.description && {state.strings.description}} - {state.profile.description && {state.profile.description}} -
-
-
-
- -
- {state.strings.registry} - setRegistry(ev.currentTarget.checked)} /> -
-
-
- -
- - {state.strings.manageTopics} - -
-
-
- -
- {state.strings.enableNotifications} - setNotifications(ev.currentTarget.checked)} /> -
-
- {showLogout && ( + {!state.profile.name && {state.strings.name}} + {state.profile.name && {state.profile.name}}
- +
- - {state.strings.logout} + {!state.profile.location && {state.strings.location}} + {state.profile.location && {state.profile.location}} +
+
+
+ +
+ {!state.profile.description && {state.strings.description}} + {state.profile.description && {state.profile.description}} +
+
+
+
+ +
+ {state.strings.registry} + setRegistry(ev.currentTarget.checked)} /> +
+
+
+ +
+ + {state.strings.manageTopics}
- )} -
-
- -
- {state.strings.mfaTitle} - setMfa(ev.currentTarget.checked)} /> -
-
-
- -
- - {state.strings.changeLogin} - -
-
-
-
- -
- {state.strings.blockedContacts} -
-
-
- -
- {state.strings.blockedTopics} -
-
-
- -
- {state.strings.blockedMessages} -
-
-
- +
- {state.strings.timeFormat} - - - - - - + {state.strings.enableNotifications} + setNotifications(ev.currentTarget.checked)} /> +
+
+ {showLogout && ( +
+
+ +
+ + {state.strings.logout} + +
+ )} +
+
+ +
+ {state.strings.mfaTitle} + setMfa(ev.currentTarget.checked)} />
- +
- {state.strings.dateFormat} - - - - - - + + {state.strings.changeLogin} + +
+
+
+
+ +
+ {state.strings.blockedContacts}
- +
- {state.strings.theme} - actions.setLanguage(language as string)} /> + {state.strings.blockedMessages}
-
-
- +
+
+
+
+ +
+ {state.strings.timeFormat} + + + + + +
- {state.strings.microphone} - actions.setTheme(theme as string)} /> +
+
+
+ +
+ {state.strings.language} + +
+
+
+ +
+ {state.strings.camera} +