mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 16:17:13 +01:00
Updated nav.
This commit is contained in:
parent
25f96f6b6b
commit
a025fc9552
11 changed files with 971 additions and 1005 deletions
|
|
@ -1,44 +1,22 @@
|
|||
import { ThemeButton, Row, Icon } from '@umami/react-zen';
|
||||
import { ThemeButton, Row } from '@umami/react-zen';
|
||||
import { LanguageButton } from '@/components/input/LanguageButton';
|
||||
import { ProfileButton } from '@/components/input/ProfileButton';
|
||||
import { TeamsButton } from '@/components/input/TeamsButton';
|
||||
import { WebsiteSelect } from '@/components/input/WebsiteSelect';
|
||||
import { Slash } from '@/components/icons';
|
||||
import { useNavigation } from '@/components/hooks';
|
||||
import { PanelButton } from '@/components/input/PanelButton';
|
||||
|
||||
export function TopNav() {
|
||||
const { teamId, websiteId, pathname } = useNavigation();
|
||||
const isWebsite = websiteId && !pathname.includes('/settings');
|
||||
|
||||
return (
|
||||
<Row
|
||||
justifyContent="space-between"
|
||||
position="absolute"
|
||||
top="0"
|
||||
alignItems="center"
|
||||
justifyContent="flex-end"
|
||||
paddingY="2"
|
||||
paddingX="3"
|
||||
paddingRight="5"
|
||||
width="100%"
|
||||
style={{ position: 'sticky', top: 0 }}
|
||||
backgroundColor="2"
|
||||
zIndex={1}
|
||||
>
|
||||
<Row alignItems="center">
|
||||
<PanelButton isDisabled={!!isWebsite} />
|
||||
<Seperator />
|
||||
<TeamsButton />
|
||||
{isWebsite && (
|
||||
<>
|
||||
<Seperator />
|
||||
<WebsiteSelect
|
||||
buttonProps={{ variant: 'quiet' }}
|
||||
websiteId={websiteId}
|
||||
teamId={teamId}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Row>
|
||||
<Row alignItems="center" justifyContent="flex-end">
|
||||
<Row alignItems="center" justifyContent="flex-end" backgroundColor="2" borderRadius>
|
||||
<ThemeButton />
|
||||
<LanguageButton />
|
||||
<ProfileButton />
|
||||
|
|
@ -46,11 +24,3 @@ export function TopNav() {
|
|||
</Row>
|
||||
);
|
||||
}
|
||||
|
||||
const Seperator = () => {
|
||||
return (
|
||||
<Icon strokeColor="7" rotate={-25}>
|
||||
<Slash />
|
||||
</Icon>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue