Skip to content

Commit

Permalink
feat: logo next to title (titleLogo)
Browse files Browse the repository at this point in the history
  • Loading branch information
diced committed Jun 2, 2024
1 parent fd85ea4 commit eda7b28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ export default function Layout({ children, config }: { children: React.ReactNode
hiddenFrom='sm'
/>

{config.website.titleLogo && (
<Avatar src={config.website.titleLogo} alt='Zipline logo' radius='sm' size='md' mr='md' />
)}

<Title fw={700}>Zipline</Title>

<div style={{ marginLeft: 'auto' }}>
Expand Down
3 changes: 3 additions & 0 deletions src/lib/config/read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const rawConfig: any = {
},
website: {
title: undefined,
titleLogo: undefined,
externalLinks: undefined,
loginBackground: undefined,
defaultAvatar: undefined,
Expand Down Expand Up @@ -179,6 +180,7 @@ export const PROP_TO_ENV = {
'invites.length': 'INVITES_LENGTH',

'website.title': 'WEBSITE_TITLE',
'website.titleLogo': 'WEBSITE_TITLE_LOGO',
'website.externalLinks': 'WEBSITE_EXTERNAL_LINKS',
'website.loginBackground': 'WEBSITE_LOGIN_BACKGROUND',
'website.defaultAvatar': 'WEBSITE_DEFAULT_AVATAR',
Expand Down Expand Up @@ -298,6 +300,7 @@ export function readEnv() {
env('invites.length', 'number'),

env('website.title', 'string'),
env('website.titleLogo', 'string'),
env('website.externalLinks', 'json[]'),
env('website.loginBackground', 'string'),
env('website.defaultAvatar', 'string'),
Expand Down
1 change: 1 addition & 0 deletions src/lib/config/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export const schema = z.object({
}),
website: z.object({
title: z.string().default('Zipline'),
titleLogo: z.string().url().nullable().default(null),
externalLinks: z
.array(
z.object({
Expand Down

0 comments on commit eda7b28

Please sign in to comment.