fix: add title to Layout
This commit is contained in:
parent
2f0af385c7
commit
95e09e51e1
12 changed files with 23 additions and 6 deletions
|
@ -95,7 +95,7 @@ const items = [
|
|||
},
|
||||
];
|
||||
|
||||
export default function Layout({ children, user }) {
|
||||
export default function Layout({ children, user, title }) {
|
||||
const [token, setToken] = useState(user?.token);
|
||||
const [systemTheme, setSystemTheme] = useState(user.systemTheme ?? 'system');
|
||||
const [opened, setOpened] = useState(false); // navigation open
|
||||
|
@ -288,7 +288,7 @@ export default function Layout({ children, user }) {
|
|||
color={theme.colors.gray[6]}
|
||||
/>
|
||||
</MediaQuery>
|
||||
<Title sx={{ marginLeft: 12 }}>Zipline</Title>
|
||||
<Title ml='md'>{title}</Title>
|
||||
<Box sx={{ marginLeft: 'auto', marginRight: 0 }}>
|
||||
<Popover
|
||||
position='top'
|
||||
|
|
|
@ -51,7 +51,7 @@ const validator = object({
|
|||
admin: number().default(0),
|
||||
}),
|
||||
website: object({
|
||||
title: string().default('Zipliner'),
|
||||
title: string().default('Zipline'),
|
||||
show_files_per_user: boolean().default(true),
|
||||
}),
|
||||
});
|
||||
|
|
|
@ -19,6 +19,7 @@ export default function FilesPage({ title }) {
|
|||
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<Files />
|
||||
</Layout>
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function DashboardPage({ title, meta }) {
|
|||
</Head>
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<Dashboard />
|
||||
</Layout>
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function InvitesPage({ title }) {
|
|||
</Head>
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<Invites />
|
||||
</Layout>
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function ManagePage({ title }) {
|
|||
</Head>
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<Manage />
|
||||
</Layout>
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function StatsPage({ title }) {
|
|||
</Head>
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<Stats />
|
||||
</Layout>
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function UploadTextPage({ title }) {
|
|||
</Head>
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<UploadText/>
|
||||
</Layout>
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function UploadPage({ title }) {
|
|||
</Head>
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<Upload/>
|
||||
</Layout>
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function UrlsPage({ title }) {
|
|||
</Head>
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<Urls />
|
||||
</Layout>
|
||||
|
|
|
@ -18,6 +18,7 @@ export default function UsersPage({ title }) {
|
|||
</Head>
|
||||
<Layout
|
||||
user={user}
|
||||
title={title}
|
||||
>
|
||||
<Users />
|
||||
</Layout>
|
||||
|
|
|
@ -9,8 +9,9 @@ import { CrossIcon, UserIcon } from 'components/icons';
|
|||
import { useStoreDispatch } from 'lib/redux/store';
|
||||
import { updateUser } from 'lib/redux/reducers/user';
|
||||
import { useRouter } from 'next/router';
|
||||
import Head from 'next/head';
|
||||
|
||||
export default function Invite({ code }) {
|
||||
export default function Invite({ code, title }) {
|
||||
const [active, setActive] = useState(0);
|
||||
const [username, setUsername] = useState('');
|
||||
const [usernameError, setUsernameError] = useState('');
|
||||
|
@ -79,6 +80,9 @@ export default function Invite({ code }) {
|
|||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{title} - Invite ({code})</title>
|
||||
</Head>
|
||||
<Center sx={{ height: '100vh' }}>
|
||||
<Card>
|
||||
<Stepper active={active} onStepClick={setActive} breakpoint='sm'>
|
||||
|
@ -91,7 +95,6 @@ export default function Invite({ code }) {
|
|||
onBlur={() => checkUsername()}
|
||||
/>
|
||||
<Group position='center' mt='xl'>
|
||||
{/* <Button variant='default' onClick={prevStep}>Back</Button> */}
|
||||
<Button disabled={usernameError !== '' || username == ''} onClick={nextStep}>Continue</Button>
|
||||
</Group>
|
||||
</Stepper.Step>
|
||||
|
@ -150,5 +153,10 @@ export const getServerSideProps: GetServerSideProps = async context => {
|
|||
return { notFound: true };
|
||||
};
|
||||
|
||||
return { props: { code: invite.code } };
|
||||
return {
|
||||
props: {
|
||||
code: invite.code,
|
||||
title: global.config.website.title,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue