setting sticky header for settings and profile

This commit is contained in:
balzack 2024-11-13 00:26:01 -08:00
parent e41d1faad7
commit 67499e1749
9 changed files with 195 additions and 169 deletions

View File

@ -19,7 +19,7 @@ const theme = createTheme({
'databag-green': ['#eef6f2', '#cce5d9', '#aad4bf', '#68c4af', '#559e83', '#559e83', '#3c7759', '#2b5540', '#1a3326', '#09110d'], 'databag-green': ['#eef6f2', '#cce5d9', '#aad4bf', '#68c4af', '#559e83', '#559e83', '#3c7759', '#2b5540', '#1a3326', '#09110d'],
'dark-surface': ['#000000', '#111111', '#222222', '#333333', '#444444', '#555555', '#666666', '#777777', '#888888', '#999999'], 'dark-surface': ['#000000', '#111111', '#222222', '#333333', '#444444', '#555555', '#666666', '#777777', '#888888', '#999999'],
'light-surface': ['#ffffff', '#eeeeee', '#dddddd', '#cccccc', '#bbbbbb', '#aaaaaa', '#999999', '#888888', '#777777', '#666666'], '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'], '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'], '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'], 'light-databag-green': ['#888888', '#448844', '#448844', '#448844', '#448844', '#448844', '#448844', '#448844', '#448844', '#448844'],

View File

@ -53,7 +53,7 @@
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
font-style: italic; font-style: italic;
color: var(--mantine-color-text-9); color: var(--mantine-color-text-7);
} }
.handle { .handle {

View File

@ -1,5 +1,3 @@
import {NativeModules, Platform} from 'react-native';
export const en = { export const en = {
unknown: 'Unknown', unknown: 'Unknown',
sealed: 'Sealed', sealed: 'Sealed',

View File

@ -14,7 +14,7 @@
padding-left: 16px; padding-left: 16px;
padding-right: 16px; padding-right: 16px;
padding-bottom: 8px; padding-bottom: 8px;
border-bottom: 2px solid var(--mantine-color-text-9); border-bottom: 2px solid var(--mantine-color-text-8);
width: 100%; width: 100%;
.input { .input {

View File

@ -46,7 +46,7 @@ export function Content({ select }: { select: (focus: Focus) => void }) {
</Button> </Button>
)} )}
</div> </div>
{channels.length === 0 && <div className={classes.none}>{state.strings.noContacts}</div>} {channels.length === 0 && <div className={classes.none}>{state.strings.noTopics}</div>}
{channels.length !== 0 && <div className={classes.channels}>{channels}</div>} {channels.length !== 0 && <div className={classes.channels}>{channels}</div>}
{state.layout === 'large' && ( {state.layout === 'large' && (
<div className={classes.bar}> <div className={classes.bar}>

View File

@ -1,21 +1,21 @@
.contact { .contact {
position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding-left: 16px;
padding-right: 16px;
padding-top: 8px;
padding-bottom: 4px;
width: 100%; width: 100%;
height: 100%;
.detail { .detail {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 2px; gap: 2px;
flex-grow: 1; flex-grow: 1;
width: 100%; width: 100%;
overflow: scroll;
padding-left: 16px;
padding-right: 16px;
} }
.header { .header {
@ -23,6 +23,11 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
width: 100%; width: 100%;
border-bottom: 1px solid var(--mantine-color-text-9);
padding-left: 16px;
padding-right: 16px;
height: 48px;
flex-shrink: 0;
} }
.close { .close {

View File

@ -237,12 +237,12 @@ export function Profile({ params, close }: { params: ProfileParams; close?: () =
return ( return (
<div className={classes.contact}> <div className={classes.contact}>
<div className={classes.detail}>
<div className={classes.header}> <div className={classes.header}>
{close && <IconX size={28} className={classes.match} />} {close && <IconX size={28} className={classes.match} />}
<Text className={classes.label}>{`${state.handle}${state.node ? '/' + state.node : ''}`}</Text> <Text className={classes.label}>{`${state.handle}${state.node ? '/' + state.node : ''}`}</Text>
{close && <IconX size={30} className={classes.close} onClick={close} />} {close && <IconX size={30} className={classes.close} onClick={close} />}
</div> </div>
<div className={classes.detail}>
<div className={classes.image}> <div className={classes.image}>
<Image radius="md" src={state.imageUrl} /> <Image radius="md" src={state.imageUrl} />
</div> </div>

View File

@ -85,13 +85,10 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding-left: 16px;
padding-right: 16px;
padding-top: 8px;
padding-bottom: 8px;
gap: 2px; gap: 2px;
height: 100%;
.header { .headerLabel {
font-size: 22px; font-size: 22px;
text-align: center; text-align: center;
text-wrap: nowrap; text-wrap: nowrap;
@ -100,6 +97,28 @@
width: 100%; 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 { .image {
position: relative; position: relative;
width: 90%; width: 90%;

View File

@ -336,7 +336,10 @@ export function Settings({ showLogout }: { showLogout: boolean }) {
<> <>
{state.profileSet && ( {state.profileSet && (
<div className={classes.settings}> <div className={classes.settings}>
<Text className={classes.header}>{`${state.profile.handle}${state.profile.node ? '/' + state.profile.node : ''}`}</Text> <div className={classes.header}>
<Text className={classes.headerLabel}>{`${state.profile.handle}${state.profile.node ? '/' + state.profile.node : ''}`}</Text>
</div>
<div className={classes.detail}>
<div className={classes.image}> <div className={classes.image}>
{state.profile.imageSet && ( {state.profile.imageSet && (
<div className={classes.imageSet}> <div className={classes.imageSet}>
@ -513,6 +516,7 @@ export function Settings({ showLogout }: { showLogout: boolean }) {
</div> </div>
</div> </div>
</div> </div>
</div>
)} )}
<Modal title={state.strings.changeLogin} opened={changeOpened} onClose={changeClose} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} centered> <Modal title={state.strings.changeLogin} opened={changeOpened} onClose={changeClose} overlayProps={{ backgroundOpacity: 0.55, blur: 3 }} centered>
<div className={classes.change}> <div className={classes.change}>