fix: add title to Layout

This commit is contained in:
dicedtomato 2022-07-15 17:34:32 +00:00 committed by GitHub
parent 2f0af385c7
commit 95e09e51e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 23 additions and 6 deletions

View file

@ -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'

View file

@ -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),
}),
});

View file

@ -19,6 +19,7 @@ export default function FilesPage({ title }) {
<Layout
user={user}
title={title}
>
<Files />
</Layout>

View file

@ -18,6 +18,7 @@ export default function DashboardPage({ title, meta }) {
</Head>
<Layout
user={user}
title={title}
>
<Dashboard />
</Layout>

View file

@ -18,6 +18,7 @@ export default function InvitesPage({ title }) {
</Head>
<Layout
user={user}
title={title}
>
<Invites />
</Layout>

View file

@ -18,6 +18,7 @@ export default function ManagePage({ title }) {
</Head>
<Layout
user={user}
title={title}
>
<Manage />
</Layout>

View file

@ -18,6 +18,7 @@ export default function StatsPage({ title }) {
</Head>
<Layout
user={user}
title={title}
>
<Stats />
</Layout>

View file

@ -18,6 +18,7 @@ export default function UploadTextPage({ title }) {
</Head>
<Layout
user={user}
title={title}
>
<UploadText/>
</Layout>

View file

@ -18,6 +18,7 @@ export default function UploadPage({ title }) {
</Head>
<Layout
user={user}
title={title}
>
<Upload/>
</Layout>

View file

@ -18,6 +18,7 @@ export default function UrlsPage({ title }) {
</Head>
<Layout
user={user}
title={title}
>
<Urls />
</Layout>

View file

@ -18,6 +18,7 @@ export default function UsersPage({ title }) {
</Head>
<Layout
user={user}
title={title}
>
<Users />
</Layout>

View file

@ -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,
},
};
};