generated from scwambach/nextjs-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
763 additions
and
1,495 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,118 @@ | ||
import { Bomb } from '@phosphor-icons/react' | ||
import { | ||
colors, | ||
groups, | ||
headingProps, | ||
richTextObject, | ||
settingsProps, | ||
widths, | ||
} from '../docTypes/common' | ||
|
||
export const splashBanner = { | ||
name: 'splashBanner', | ||
title: 'Splash Banner', | ||
type: 'object', | ||
groups, | ||
fields: [ | ||
...headingProps({ group: 'content' }), | ||
...settingsProps({}), | ||
{ | ||
name: 'bgColor', | ||
group: 'settings', | ||
title: 'Background Color', | ||
type: 'string', | ||
options: { | ||
list: colors, | ||
}, | ||
}, | ||
{ | ||
name: 'contained', | ||
title: 'Contained', | ||
group: 'settings', | ||
hidden: ({ parent }: any) => parent?.overlap, | ||
type: 'boolean', | ||
}, | ||
{ | ||
name: 'overlap', | ||
title: 'Overlap', | ||
group: 'settings', | ||
hidden: ({ parent }: any) => parent?.contained, | ||
type: 'boolean', | ||
}, | ||
{ | ||
name: 'micro', | ||
title: 'Micro', | ||
hidden: ({ parent }: any) => !parent?.contained, | ||
group: 'settings', | ||
type: 'boolean', | ||
description: | ||
'Enabling this will make the splashBanner much smaller, used for things like mid-page callouts.', | ||
}, | ||
{ | ||
name: 'containedWidth', | ||
hidden: ({ parent }: any) => !parent?.contained, | ||
title: 'Contained Width', | ||
group: 'settings', | ||
type: 'string', | ||
options: { | ||
list: widths, | ||
}, | ||
}, | ||
{ | ||
name: 'boxBgColor', | ||
title: 'Box Background Color', | ||
group: 'settings', | ||
hidden: ({ parent }: any) => !parent?.contained, | ||
description: | ||
'This is the background color of the inner box, but only works when `contained` is active.', | ||
type: 'string', | ||
options: { | ||
list: colors, | ||
}, | ||
}, | ||
richTextObject({ | ||
name: 'contentFooter', | ||
title: 'Content Footer', | ||
group: 'content', | ||
}), | ||
{ | ||
name: 'links', | ||
title: 'Links', | ||
group: 'content', | ||
type: 'array', | ||
of: [{ type: 'button' }], | ||
}, | ||
{ | ||
name: 'backgroundImage', | ||
title: 'Background Image', | ||
group: 'content', | ||
type: 'image', | ||
options: { | ||
hotspot: true, | ||
}, | ||
}, | ||
{ | ||
name: 'foregroundMedia', | ||
title: 'Foreground Media', | ||
group: 'content', | ||
type: 'image', | ||
options: { | ||
hotspot: true, | ||
}, | ||
}, | ||
], | ||
preview: { | ||
select: { | ||
heading: 'heading', | ||
subheading: 'subheading', | ||
backgroundImage: 'backgroundImage', | ||
}, | ||
prepare(selection: any) { | ||
return { | ||
title: selection.heading || selection.subheading, | ||
subtitle: 'Splash Banner', | ||
media: Bomb || selection.backgroundImage, | ||
} | ||
}, | ||
}, | ||
} |
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,13 @@ | ||
import 'styles/main.scss' | ||
import { getServerSession } from 'next-auth' | ||
import SessionProvider from '@components/global/SessionProvider' | ||
|
||
export default async function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
const session = await getServerSession() | ||
return ( | ||
<html lang="en" className="theme-override"> | ||
<body> | ||
<SessionProvider session={session}>{children}</SessionProvider> | ||
</body> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
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
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,83 @@ | ||
import { Button, ImageObject } from '@components/modules' | ||
import { Box, Flex, Heading, Portable } from '@components/utility' | ||
import { BannerProps } from '@utils/types' | ||
|
||
interface SplashBannerProps extends BannerProps { | ||
contentFooter?: string | any[] | ||
} | ||
|
||
export const SplashBanner = ({ | ||
backgroundImage, | ||
bgColor = 'primary', | ||
className, | ||
contentFooter, | ||
componentId, | ||
foregroundMedia, | ||
heading, | ||
headingLevel = 2, | ||
links, | ||
markdown, | ||
style, | ||
subheading, | ||
testId, | ||
}: SplashBannerProps) => { | ||
return ( | ||
<Box | ||
componentId={componentId} | ||
className={`splashBanner ${bgColor}${className ? ` ${className}` : ''}${ | ||
backgroundImage ? ' has-image' : '' | ||
}`} | ||
testId={testId} | ||
elementTag="section" | ||
style={style} | ||
> | ||
<Flex fill alignItems="stretch" gap="none" className="inner"> | ||
<Flex | ||
justifyContent="center" | ||
alignItems="flex-end" | ||
direction="column" | ||
className="content" | ||
> | ||
<Box className="inner"> | ||
<Heading level={headingLevel}>{heading}</Heading> | ||
{subheading && ( | ||
<> | ||
{markdown ? ( | ||
<p className="subheading"> | ||
<strong>{subheading as string}</strong> | ||
</p> | ||
) : ( | ||
<Portable content={subheading as any[]} /> | ||
)} | ||
{links && ( | ||
<Box className="links"> | ||
{links.map((link, index) => ( | ||
<Button key={index} {...link} /> | ||
))} | ||
</Box> | ||
)} | ||
</> | ||
)} | ||
{contentFooter && ( | ||
<> | ||
{markdown ? ( | ||
<p className="contentFooter"> | ||
<strong>{contentFooter as string}</strong> | ||
</p> | ||
) : ( | ||
<Portable | ||
className="contentFooter" | ||
content={contentFooter as any[]} | ||
/> | ||
)} | ||
</> | ||
)} | ||
</Box> | ||
</Flex> | ||
<Box className="image-box"> | ||
<ImageObject {...foregroundMedia} isBackground /> | ||
</Box> | ||
</Flex> | ||
</Box> | ||
) | ||
} |
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
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
Oops, something went wrong.