-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(apps): persist layouts between page transitions
- Loading branch information
1 parent
0914286
commit d934724
Showing
82 changed files
with
1,877 additions
and
1,595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'hostd': patch | ||
'renterd': patch | ||
'walletd': patch | ||
--- | ||
|
||
The page layout is now persisted between page transitions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Text } from '@siafoundation/design-system' | ||
import { Warning16, CheckmarkFilled16 } from '@siafoundation/react-icons' | ||
import { HostdSidenav } from '../HostdSidenav' | ||
import { routes } from '../../config/routes' | ||
import { useDialog } from '../../contexts/dialog' | ||
import { | ||
HostdAuthedLayout, | ||
HostdAuthedPageLayoutProps, | ||
} from '../HostdAuthedLayout' | ||
import { useConfig } from '../../contexts/config' | ||
import { ConfigNav } from './ConfigNav' | ||
import { ConfigActions } from './ConfigActions' | ||
|
||
export const Layout = HostdAuthedLayout | ||
export function useLayoutProps(): HostdAuthedPageLayoutProps { | ||
const { openDialog } = useDialog() | ||
const { settings, dynDNSCheck } = useConfig() | ||
return { | ||
title: 'Configuration', | ||
routes, | ||
nav: <ConfigNav />, | ||
sidenav: <HostdSidenav />, | ||
stats: | ||
settings.data?.ddns.provider && !dynDNSCheck.isValidating ? ( | ||
dynDNSCheck.error ? ( | ||
<> | ||
<Text color="amber"> | ||
<Warning16 /> | ||
</Text> | ||
<Text size="14"> | ||
Error with dynamic DNS configuration: {dynDNSCheck.error.message} | ||
</Text> | ||
</> | ||
) : ( | ||
<> | ||
<Text color="green"> | ||
<CheckmarkFilled16 /> | ||
</Text> | ||
<Text>Dynamic DNS enabled</Text> | ||
</> | ||
) | ||
) : null, | ||
actions: <ConfigActions />, | ||
openSettings: () => openDialog('settings'), | ||
size: '3', | ||
} | ||
} |
Oops, something went wrong.