mirror of
https://github.com/balzack/databag.git
synced 2025-05-04 07:25:15 +00:00
setting main layout
This commit is contained in:
parent
6f7c5d77ab
commit
ad21419ecf
7
app/client/web/src/identity/Identity.module.css
Normal file
7
app/client/web/src/identity/Identity.module.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.identity {
|
||||||
|
width: 100%;
|
||||||
|
height: 48px;
|
||||||
|
cursor: pointer;
|
||||||
|
background: var(--mantine-color-surface-4);
|
||||||
|
}
|
||||||
|
|
26
app/client/web/src/identity/Identity.tsx
Normal file
26
app/client/web/src/identity/Identity.tsx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import classes from './Identity.module.css';
|
||||||
|
import { useIdentity } from './useIdentity.hook';
|
||||||
|
import { Menu } from '@mantine/core';
|
||||||
|
import {
|
||||||
|
IconLogout,
|
||||||
|
IconSettings,
|
||||||
|
IconAddressBook
|
||||||
|
} from '@tabler/icons-react'
|
||||||
|
|
||||||
|
export function Identity() {
|
||||||
|
const { state, actions } = useIdentity();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Menu shadow="md" position="right">
|
||||||
|
<Menu.Target>
|
||||||
|
<div className={classes.identity}>IDENTITY</div>
|
||||||
|
</Menu.Target>
|
||||||
|
|
||||||
|
<Menu.Dropdown>
|
||||||
|
<Menu.Item leftSection={<IconSettings />}>{ state.strings.settings }</Menu.Item>
|
||||||
|
<Menu.Item leftSection={<IconAddressBook />}>{ state.strings.contacts }</Menu.Item>
|
||||||
|
<Menu.Item leftSection={<IconLogout />}>{ state.strings.logout }</Menu.Item>
|
||||||
|
</Menu.Dropdown>
|
||||||
|
</Menu>
|
||||||
|
)
|
||||||
|
}
|
15
app/client/web/src/identity/useIdentity.hook.ts
Normal file
15
app/client/web/src/identity/useIdentity.hook.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { useState, useContext, useEffect } from 'react'
|
||||||
|
import { DisplayContext } from '../context/DisplayContext'
|
||||||
|
import { ContextType } from '../context/ContextType'
|
||||||
|
|
||||||
|
export function useIdentity() {
|
||||||
|
const display = useContext(DisplayContext) as ContextType
|
||||||
|
const [state, setState] = useState({
|
||||||
|
strings: display.state.strings,
|
||||||
|
});
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
};
|
||||||
|
|
||||||
|
return { state, actions };
|
||||||
|
}
|
@ -3,6 +3,28 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
.display {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
height: 100%;
|
||||||
|
width: 33%;
|
||||||
|
min-width: 325px;
|
||||||
|
background: var(--mantine-color-surface-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
|
background: var(--mantine-color-surface-3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.screen {
|
.screen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 48px);
|
height: calc(100% - 48px);
|
||||||
|
@ -6,6 +6,7 @@ import { ContextType } from '../context/ContextType'
|
|||||||
import classes from './Session.module.css'
|
import classes from './Session.module.css'
|
||||||
import { IconAddressBook, IconMessages, IconSettings } from '@tabler/icons-react'
|
import { IconAddressBook, IconMessages, IconSettings } from '@tabler/icons-react'
|
||||||
import { Settings } from '../settings/Settings';
|
import { Settings } from '../settings/Settings';
|
||||||
|
import { Identity } from '../identity/Identity';
|
||||||
|
|
||||||
export function Session() {
|
export function Session() {
|
||||||
const [ tab, setTab ] = useState('channels');
|
const [ tab, setTab ] = useState('channels');
|
||||||
@ -47,7 +48,13 @@ export function Session() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{ display.state.layout === 'large' && (
|
{ display.state.layout === 'large' && (
|
||||||
<div>LARGE DISPLAY</div>
|
<div className={classes.display}>
|
||||||
|
<div className={classes.left}>
|
||||||
|
<Identity />
|
||||||
|
</div>
|
||||||
|
<div className={classes.right}>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
12858
app/client/web/yarn.lock
12858
app/client/web/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user