Skip to content

Commit

Permalink
desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
scwambach committed Jul 19, 2024
1 parent 9fb71c9 commit cd3d4dc
Show file tree
Hide file tree
Showing 32 changed files with 763 additions and 1,495 deletions.
1,684 changes: 294 additions & 1,390 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"eslint-config-next": "14.2.4",
"markdown-it": "^14.1.0",
"next": "14.2.4",
"next-auth": "^4.24.7",
"next-sanity": "^9.4.2",
"nodemailer": "^6.9.14",
"react": "18.3.1",
Expand Down
118 changes: 118 additions & 0 deletions sanity/components/splashBanner.ts
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,
}
},
},
}
1 change: 1 addition & 0 deletions sanity/docTypes/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export const pageComponents = [
{ type: 'quote' },
{ type: 'richText' },
{ type: 'river' },
{ type: 'splashBanner' },
{ type: 'stats' },
{ type: 'tabs' },
{ type: 'timeline' },
Expand Down
37 changes: 37 additions & 0 deletions sanity/docTypes/globalSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,43 @@ export const globalSettings = {
hotspot: true,
},
},
{
name: 'phone',
title: 'Phone',
type: 'string',
},
{
name: 'fax',
title: 'Fax',
type: 'string',
},
{
name: 'location',
title: 'Location',
type: 'object',
fields: [
{
name: 'address',
title: 'Address',
type: 'string',
},
{
name: 'city',
title: 'City',
type: 'string',
},
{
name: 'state',
title: 'State',
type: 'string',
},
{
name: 'zip',
title: 'Zip',
type: 'string',
},
],
},
{
name: 'socials',
title: 'Socials',
Expand Down
8 changes: 5 additions & 3 deletions sanity/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { type SchemaTypeDefinition } from 'sanity'
// docTypes
import { event } from './docTypes/event'
import { globalSettings } from './docTypes/globalSettings'
import { navigation } from './docTypes/navigation'
import { page } from './docTypes/page'
import { person } from './docTypes/person'
import { post } from './docTypes/post'
import { tag } from './docTypes/tag'
// modules
import { button } from './modules/button'
import { card } from './modules/card'
Expand Down Expand Up @@ -31,13 +34,11 @@ import { people } from './components/people'
import { quote } from './components/quote'
import { richText } from './components/richText'
import { river } from './components/river'
import { splashBanner } from './components/splashBanner'
import { stats } from './components/stats'
import { tabs } from './components/tabs'
import { timeline } from './components/timeline'
import { videos } from './components/videos'
import { navigation } from './docTypes/navigation'
import { post } from './docTypes/post'
import { tag } from './docTypes/tag'

export const schema: { types: SchemaTypeDefinition[] } = {
types: [
Expand Down Expand Up @@ -76,6 +77,7 @@ export const schema: { types: SchemaTypeDefinition[] } = {
quote,
richText,
river,
splashBanner,
stats,
tabs,
timeline,
Expand Down
15 changes: 0 additions & 15 deletions src/app/api/auth/[...nextauth]/options.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/app/api/auth/[...nextauth]/route.ts

This file was deleted.

7 changes: 1 addition & 6 deletions src/app/layout.tsx
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>
)
}
1 change: 1 addition & 0 deletions src/components/blocks/Gallery.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import { render, fireEvent } from '@testing-library/react'
import '@testing-library/jest-dom'
import { Gallery } from './Gallery'
import { GalleryProps } from '../../utils/types'

Expand Down
83 changes: 83 additions & 0 deletions src/components/blocks/SplashBanner.tsx
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>
)
}
1 change: 1 addition & 0 deletions src/components/blocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export { People } from './People'
export { Quote } from './Quote'
export { RichText } from './RichText'
export { River } from './River'
export { SplashBanner } from './SplashBanner'
export { Stats } from './Stats'
export { Tabs } from './Tabs'
export { Timeline } from './Timeline'
Expand Down
32 changes: 25 additions & 7 deletions src/components/global/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
'use client'

import { Box, Container, Markdown } from '@components/utility'
import { LinkObject } from '@components/modules'
import { Box, Container, Flex } from '@components/utility'
import { GlobalProps } from '@utils/types'

export const Footer = ({ copy, title }: { copy?: string; title: string }) => {
const year = new Date().getFullYear()
export const Footer = ({ location, phone, fax }: GlobalProps) => {
const address = location
? `${location.street}, ${location.city}, ${location.state} ${location.zip}`
: ''
return (
<Box elementTag="footer" className="footer">
<Container>
<p>
&copy; {year} {title}
</p>
{copy && <Markdown>{copy}</Markdown>}
<Flex justifyContent="space-between" alignItems="center">
<Flex elementTag="p" gap="micro">
<strong>Location:</strong>
<LinkObject href={`https://www.google.com/maps/search/${address}`}>
{address}
</LinkObject>
</Flex>
<Flex gap="micro" direction="column">
<Flex elementTag="p" gap="micro">
<strong>Phone:</strong>
<LinkObject href={`tel:${phone}`}>{phone}</LinkObject>
</Flex>
<Flex elementTag="p" gap="micro">
<strong>Fax:</strong>
<LinkObject href={`tel:${fax}`}>{fax}</LinkObject>
</Flex>
</Flex>
</Flex>
</Container>
</Box>
)
Expand Down
Loading

0 comments on commit cd3d4dc

Please sign in to comment.