fix build
This commit is contained in:
parent
c0ee8a4a11
commit
71590024e7
28 changed files with 943 additions and 2 deletions
30
components/Background.module.css
Normal file
30
components/Background.module.css
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
.background {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.background {
|
||||
background: var(--background-primary);
|
||||
}
|
||||
|
||||
.background img {
|
||||
scale: 65%;
|
||||
}
|
||||
|
||||
@media (max-width: 850px) {
|
||||
.background img {
|
||||
scale: 35%;
|
||||
}
|
||||
}
|
||||
|
||||
.background div {
|
||||
background: var(--background-primary-transparent);
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
}
|
||||
24
components/Background.tsx
Normal file
24
components/Background.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
'use client'
|
||||
|
||||
import Image from 'next/image'
|
||||
import * as React from 'react'
|
||||
import { useContext } from 'react'
|
||||
|
||||
import darkBackground from '../assets/images/chora_dark.png'
|
||||
import lightBackground from '../assets/images/chora_light.png'
|
||||
import { ThemeContext } from '../contexts'
|
||||
|
||||
import styles from './Background.module.css'
|
||||
|
||||
const Background = () => {
|
||||
const { darkTheme } = useContext(ThemeContext)
|
||||
|
||||
return (
|
||||
<div className={styles.background}>
|
||||
<Image alt="chora" src={darkTheme ? darkBackground : lightBackground} />
|
||||
<div />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Background
|
||||
11
components/Footer.module.css
Normal file
11
components/Footer.module.css
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.footer {
|
||||
composes: footer from '../styles/footer.css';
|
||||
}
|
||||
|
||||
.title {
|
||||
composes: footer-title from '../styles/footer.css';
|
||||
}
|
||||
|
||||
.list {
|
||||
composes: footer-list from '../styles/footer.css';
|
||||
}
|
||||
57
components/Footer.tsx
Normal file
57
components/Footer.tsx
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
'use client'
|
||||
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import * as React from 'react'
|
||||
import { useContext } from 'react'
|
||||
|
||||
import choraDarkSmall from '../assets//images/chora_dark_small.png'
|
||||
import choraLightSmall from '../assets//images/chora_light_small.png'
|
||||
import { ThemeContext } from '../contexts'
|
||||
import { ArrowUpRight } from './icons'
|
||||
|
||||
import styles from './Footer.module.css'
|
||||
|
||||
const Footer = ({ about, sections }: any) => {
|
||||
const { darkTheme } = useContext(ThemeContext)
|
||||
|
||||
const currentYear = new Date().getFullYear()
|
||||
|
||||
return (
|
||||
<footer className={styles.footer}>
|
||||
<div style={{ display: 'none' }}>{darkTheme?.toString()}</div>
|
||||
<div>
|
||||
<div className={styles.title}>
|
||||
<Image
|
||||
alt="chora"
|
||||
src={darkTheme ? choraDarkSmall : choraLightSmall}
|
||||
/>
|
||||
<h4>{`© ${currentYear} Chora Studio LLC`}</h4>
|
||||
</div>
|
||||
{about && (
|
||||
<div className={styles.list}>
|
||||
<h3>{about.title}</h3>
|
||||
<div>{about.text}</div>
|
||||
</div>
|
||||
)}
|
||||
{sections.map((section: any) => (
|
||||
<div className={styles.list} key={section.title}>
|
||||
<h3>{section.title}</h3>
|
||||
<ul>
|
||||
{section.items.map((item: any) => (
|
||||
<li key={item.title}>
|
||||
<Link href={item.link} target={item.target}>
|
||||
{item.title}
|
||||
{item.target && <ArrowUpRight />}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</footer>
|
||||
)
|
||||
}
|
||||
|
||||
export default Footer
|
||||
22
components/Header.module.css
Normal file
22
components/Header.module.css
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
.header {
|
||||
composes: header from '../styles/header.css';
|
||||
}
|
||||
|
||||
.menu {
|
||||
composes: header-menu from '../styles/header.css';
|
||||
}
|
||||
|
||||
.divider {
|
||||
composes: header-divider from '../styles/header.css';
|
||||
}
|
||||
|
||||
.button {
|
||||
background: none;
|
||||
}
|
||||
|
||||
@media (min-width: 850px) {
|
||||
.buttonMobile {
|
||||
composes: button;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
74
components/Header.tsx
Normal file
74
components/Header.tsx
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
'use client'
|
||||
|
||||
import Link from 'next/link'
|
||||
import * as React from 'react'
|
||||
import { useContext } from 'react'
|
||||
|
||||
import { MenuContext, ThemeContext } from '../contexts'
|
||||
import { HeaderTitle } from '.'
|
||||
import { ArrowUpRight, MenuIcon, ThemeIcon } from './icons'
|
||||
|
||||
import styles from './Header.module.css'
|
||||
|
||||
const Header = ({ title, items, showMenuButton, showMobileTitle }: any) => {
|
||||
const { showMenu, setShowMenu } = useContext(MenuContext)
|
||||
const { darkTheme, setDarkTheme } = useContext(ThemeContext)
|
||||
|
||||
const toggleMenu = () => {
|
||||
if (showMenu) {
|
||||
setShowMenu(false)
|
||||
} else {
|
||||
setShowMenu(true)
|
||||
}
|
||||
}
|
||||
|
||||
const toggleTheme = () => {
|
||||
if (darkTheme) {
|
||||
setDarkTheme(false)
|
||||
} else {
|
||||
setDarkTheme(true)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<header className={styles.header}>
|
||||
<div style={{ display: 'none' }}>{darkTheme?.toString()}</div>
|
||||
<div>
|
||||
{showMenuButton && (
|
||||
<button className={styles.buttonMobile} onClick={toggleMenu}>
|
||||
<MenuIcon darkTheme={darkTheme} />
|
||||
</button>
|
||||
)}
|
||||
<HeaderTitle
|
||||
darkTheme={darkTheme}
|
||||
title={title}
|
||||
showMobileTitle={showMobileTitle}
|
||||
/>
|
||||
<div className={styles.menu}>
|
||||
<ul>
|
||||
{items &&
|
||||
items.map((item: any, i: number) =>
|
||||
item === 'divider' ? (
|
||||
<li key={i} className={styles.divider}>
|
||||
{'|'}
|
||||
</li>
|
||||
) : (
|
||||
<li key={item.title}>
|
||||
<Link href={item.link} target={item.target}>
|
||||
{item.title}
|
||||
{item.target && <ArrowUpRight />}
|
||||
</Link>
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ul>
|
||||
<button className={styles.button} onClick={toggleTheme}>
|
||||
<ThemeIcon darkTheme={darkTheme} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
export default Header
|
||||
17
components/HeaderTitle.module.css
Normal file
17
components/HeaderTitle.module.css
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
.title {
|
||||
composes: header-title from '../styles/header.css';
|
||||
}
|
||||
|
||||
@media (max-width: 850px) {
|
||||
.title {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.mobileTitle {
|
||||
composes: header-title from '../styles/header.css';
|
||||
}
|
||||
|
||||
.headerTitleText {
|
||||
composes: header-title-text from '../styles/header.css';
|
||||
}
|
||||
26
components/HeaderTitle.tsx
Normal file
26
components/HeaderTitle.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
'use client'
|
||||
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import * as React from 'react'
|
||||
|
||||
import choraLogoDark from '../assets/images/chora_dark_small.png'
|
||||
import choraLogoLight from '../assets/images/chora_light_small.png'
|
||||
|
||||
import styles from './HeaderTitle.module.css'
|
||||
|
||||
const HeaderTitle = ({ darkTheme, title, showMobileTitle }: any) => (
|
||||
<div className={showMobileTitle ? styles.mobileTitle : styles.title}>
|
||||
<Link href={(title && title.link) || '/'}>
|
||||
<Image alt="chora" src={darkTheme ? choraLogoDark : choraLogoLight} />
|
||||
<div className={styles.headerTitleText}>
|
||||
{'chora '}
|
||||
{title && title.titleX && (
|
||||
<span style={{ opacity: '0.75' }}>{title.titleX}</span>
|
||||
)}
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
|
||||
export default HeaderTitle
|
||||
35
components/Sidebar.module.css
Normal file
35
components/Sidebar.module.css
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
.sidebar {
|
||||
composes: sidebar from '../styles/sidebar.css';
|
||||
}
|
||||
|
||||
.mobileOnly {
|
||||
composes: sidebar from '../styles/sidebar.css';
|
||||
min-height: calc(100vh - var(--header-height));
|
||||
width: 75vw;
|
||||
}
|
||||
|
||||
/* cancel sidebar styling */
|
||||
@media (max-width: 850px) {
|
||||
.mobileOnly {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 850px) {
|
||||
.mobileOnly {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
composes: sidebar-link-active from '../styles/sidebar.css';
|
||||
}
|
||||
|
||||
.divider {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.button {
|
||||
background: none;
|
||||
color: var(--color-theme);
|
||||
}
|
||||
58
components/Sidebar.tsx
Normal file
58
components/Sidebar.tsx
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
'use client'
|
||||
|
||||
import Link from 'next/link'
|
||||
import { usePathname } from 'next/navigation'
|
||||
import * as React from 'react'
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
|
||||
import { MenuContext } from '../contexts'
|
||||
import { ArrowUpRight } from './icons'
|
||||
|
||||
import styles from './Sidebar.module.css'
|
||||
|
||||
const Sidebar = ({ items, mobileOnly }: any) => {
|
||||
const currentRoute = usePathname()
|
||||
|
||||
const { showMenu, setShowMenu } = useContext(MenuContext)
|
||||
|
||||
const [initRoute, setInitRoute] = useState<string>('')
|
||||
|
||||
useEffect(() => {
|
||||
if (currentRoute && !initRoute) {
|
||||
setInitRoute(currentRoute)
|
||||
}
|
||||
if (initRoute && initRoute !== currentRoute) {
|
||||
setInitRoute(currentRoute)
|
||||
setShowMenu(false)
|
||||
}
|
||||
}, [currentRoute, initRoute, setShowMenu])
|
||||
|
||||
return !mobileOnly || showMenu ? (
|
||||
<div className={mobileOnly ? styles.mobileOnly : styles.sidebar}>
|
||||
<ul>
|
||||
{items.map((item: any, i: number) =>
|
||||
item === 'divider' ? (
|
||||
<hr key={i} className={styles.divider} />
|
||||
) : (
|
||||
<li key={item.title}>
|
||||
<Link
|
||||
href={item.link}
|
||||
className={
|
||||
currentRoute === item.link ? styles.active : undefined
|
||||
}
|
||||
target={item.target}
|
||||
>
|
||||
{item.title}
|
||||
{item.target === '_blank' && <ArrowUpRight />}
|
||||
</Link>
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
) : (
|
||||
<></>
|
||||
)
|
||||
}
|
||||
|
||||
export default Sidebar
|
||||
54
components/icons/ArrowLeft.tsx
Normal file
54
components/icons/ArrowLeft.tsx
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { useContext } from 'react'
|
||||
|
||||
import { ThemeContext } from '../../contexts'
|
||||
|
||||
const defaultColor = '#00C3A5'
|
||||
|
||||
const ArrowRight = ({ color, useTheme }: any) => {
|
||||
const { darkTheme } = useContext(ThemeContext)
|
||||
|
||||
const stroke = color || defaultColor
|
||||
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
height="0.5em"
|
||||
width="0.5em"
|
||||
viewBox="0 0 20 20"
|
||||
style={{ marginRight: '0.5em' }}
|
||||
>
|
||||
<line
|
||||
x1="3"
|
||||
y1="10"
|
||||
x2="17"
|
||||
y2="10"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
<line
|
||||
x1="3"
|
||||
y1="10"
|
||||
x2="7"
|
||||
y2="15"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
<line
|
||||
x1="3"
|
||||
y1="10"
|
||||
x2="7"
|
||||
y2="5"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export default ArrowRight
|
||||
54
components/icons/ArrowRight.tsx
Normal file
54
components/icons/ArrowRight.tsx
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { useContext } from 'react'
|
||||
|
||||
import { ThemeContext } from '../../contexts'
|
||||
|
||||
const defaultColor = '#00C3A5'
|
||||
|
||||
const ArrowRight = ({ color, useTheme }: any) => {
|
||||
const { darkTheme } = useContext(ThemeContext)
|
||||
|
||||
const stroke = color || defaultColor
|
||||
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
height="0.5em"
|
||||
width="0.5em"
|
||||
viewBox="0 0 20 20"
|
||||
style={{ marginLeft: '0.5em' }}
|
||||
>
|
||||
<line
|
||||
x1="3"
|
||||
y1="10"
|
||||
x2="17"
|
||||
y2="10"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
<line
|
||||
x1="17"
|
||||
y1="10"
|
||||
x2="12"
|
||||
y2="5"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
<line
|
||||
x1="17"
|
||||
y1="10"
|
||||
x2="12"
|
||||
y2="15"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export default ArrowRight
|
||||
54
components/icons/ArrowUpRight.tsx
Normal file
54
components/icons/ArrowUpRight.tsx
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { useContext } from 'react'
|
||||
|
||||
import { ThemeContext } from '../../contexts'
|
||||
|
||||
const defaultColor = '#00C3A5'
|
||||
|
||||
const ArrowUpRight = ({ color, useTheme }: any) => {
|
||||
const { darkTheme } = useContext(ThemeContext)
|
||||
|
||||
const stroke = color || defaultColor
|
||||
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
height="0.5em"
|
||||
width="0.5em"
|
||||
viewBox="0 0 20 20"
|
||||
style={{ marginLeft: '0.5em' }}
|
||||
>
|
||||
<line
|
||||
x1="3"
|
||||
y1="17"
|
||||
x2="17"
|
||||
y2="3"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
<line
|
||||
x1="17"
|
||||
y1="3"
|
||||
x2="7"
|
||||
y2="3"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
<line
|
||||
x1="17"
|
||||
y1="3"
|
||||
x2="17"
|
||||
y2="12"
|
||||
stroke={useTheme ? (darkTheme ? '#000' : '#FFF') : stroke}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export default ArrowUpRight
|
||||
31
components/icons/CheckIcon.tsx
Normal file
31
components/icons/CheckIcon.tsx
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import * as React from 'react'
|
||||
|
||||
const CheckIcon = ({ darkTheme }: any) => (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
height="0.5em"
|
||||
width="0.5em"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<line
|
||||
x1="7"
|
||||
y1="17"
|
||||
x2="17"
|
||||
y2="3"
|
||||
stroke={darkTheme ? '#FFFFFF' : '#111111'}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="6"
|
||||
/>
|
||||
<line
|
||||
x1="7"
|
||||
y1="17"
|
||||
x2="3"
|
||||
y2="10"
|
||||
stroke={darkTheme ? '#FFFFFF' : '#111111'}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="6"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
|
||||
export default CheckIcon
|
||||
40
components/icons/MenuIcon.tsx
Normal file
40
components/icons/MenuIcon.tsx
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import * as React from 'react'
|
||||
|
||||
const MenuIcon = ({ darkTheme }: any) => (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
height="1.5em"
|
||||
width="1.5em"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<line
|
||||
x1="10"
|
||||
y1="85"
|
||||
x2="90"
|
||||
y2="85"
|
||||
stroke={darkTheme ? '#FFFFFF' : '#111111'}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="10"
|
||||
/>
|
||||
<line
|
||||
x1="10"
|
||||
y1="50"
|
||||
x2="90"
|
||||
y2="50"
|
||||
stroke={darkTheme ? '#FFFFFF' : '#111111'}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="10"
|
||||
/>
|
||||
<line
|
||||
x1="10"
|
||||
y1="15"
|
||||
x2="90"
|
||||
y2="15"
|
||||
stroke={darkTheme ? '#FFFFFF' : '#111111'}
|
||||
strokeLinecap="round"
|
||||
strokeWidth="10"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
|
||||
export default MenuIcon
|
||||
15
components/icons/ThemeIcon.tsx
Normal file
15
components/icons/ThemeIcon.tsx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import * as React from 'react'
|
||||
|
||||
const ThemeIcon = ({ darkTheme }: any) => (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
height="1.5em"
|
||||
width="1.5em"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<circle cx="50" cy="50" r="40" fill={darkTheme ? '#F5F5F5' : '#0A0A0A'} />
|
||||
<circle cx="60" cy="50" r="37" fill={darkTheme ? '#111111' : '#FFFFFF'} />
|
||||
</svg>
|
||||
)
|
||||
|
||||
export default ThemeIcon
|
||||
17
components/icons/UserIcon.tsx
Normal file
17
components/icons/UserIcon.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import * as React from 'react'
|
||||
|
||||
const UserIcon = ({ darkTheme }: any) => (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
height="1.5em"
|
||||
width="1.5em"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<circle cx="50" cy="40" r="30" fill={darkTheme ? '#FFFFFF' : '#111111'} />
|
||||
<circle cx="48" cy="40" r="22" fill={darkTheme ? '#111111' : '#FFFFFF'} />
|
||||
<circle cx="50" cy="105" r="40" fill={darkTheme ? '#FFFFFF' : '#111111'} />
|
||||
<circle cx="48" cy="105" r="32" fill={darkTheme ? '#111111' : '#FFFFFF'} />
|
||||
</svg>
|
||||
)
|
||||
|
||||
export default UserIcon
|
||||
7
components/icons/index.ts
Normal file
7
components/icons/index.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export { default as ArrowLeft } from './ArrowLeft'
|
||||
export { default as ArrowRight } from './ArrowRight'
|
||||
export { default as ArrowUpRight } from './ArrowUpRight'
|
||||
export { default as CheckIcon } from './CheckIcon'
|
||||
export { default as MenuIcon } from './MenuIcon'
|
||||
export { default as ThemeIcon } from './ThemeIcon'
|
||||
export { default as UserIcon } from './UserIcon'
|
||||
5
components/index.ts
Normal file
5
components/index.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export { default as Background } from './Background'
|
||||
export { default as Footer } from './Footer'
|
||||
export { default as Header } from './Header'
|
||||
export { default as HeaderTitle } from './HeaderTitle'
|
||||
export { default as Sidebar } from './Sidebar'
|
||||
Loading…
Add table
Add a link
Reference in a new issue