generated from taylorbryant/gatsby-starter-tailwind
-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add international toc to home page (#1002)
* feat: add international toc * fix: logo on old nav should be a pointer
- Loading branch information
Showing
6 changed files
with
114 additions
and
10 deletions.
There are no files selected for viewing
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,38 @@ | ||
import Link from 'next/link' | ||
import { SectionContainer } from './ui/SectionContainer' | ||
import { INTERNATIONAL_DATA, ToCCountry } from './international-data' | ||
import { ToCAreaEntry } from './USAToC' | ||
|
||
/** | ||
* International table of content | ||
*/ | ||
export const InternationalToC: React.FC = () => { | ||
return ( | ||
<SectionContainer header={<h2>International</h2>}> | ||
<div className='columns-3xs gap-x-10'> | ||
{ | ||
INTERNATIONAL_DATA.map(country => | ||
<CountryCard key={country.uuid} country={country} /> | ||
) | ||
} | ||
</div> | ||
</SectionContainer> | ||
) | ||
} | ||
|
||
const CountryCard: React.FC<{ country: ToCCountry }> = ({ country }) => { | ||
const { areaName, uuid, children } = country | ||
return ( | ||
<div className='mb-10 break-inside-avoid-column break-inside-avoid'> | ||
<Link href={`/crag/${uuid}`}> | ||
<span className=' font-semibold'>{areaName}</span> | ||
</Link> | ||
<hr className='mb-2 border-1 border-base-content/60' /> | ||
<div className='flex flex-col'> | ||
{ | ||
children.map(area => <ToCAreaEntry key={area.uuid} {...area} />) | ||
} | ||
</div> | ||
</div> | ||
) | ||
} |
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,43 @@ | ||
import { AreaType } from '@/js/types' | ||
|
||
export type ToCArea = Pick<AreaType, 'uuid' | 'areaName'> | ||
export type ToCCountry = Pick<AreaType, 'uuid' | 'areaName'> & { | ||
children: ToCArea[] | ||
} | ||
|
||
export const INTERNATIONAL_DATA: ToCCountry[] = [ | ||
{ | ||
areaName: 'Canada', | ||
uuid: '2996145f-e1ba-5b56-9da8-30c64ccc3776', | ||
children: [{ | ||
uuid: 'a354b580-870b-5444-9f11-2c0e78995841', | ||
areaName: 'Squamish' | ||
}, | ||
{ | ||
uuid: '4624f40a-b644-5256-9287-aa19002ce00f', | ||
areaName: 'Powell River' | ||
}, | ||
{ | ||
uuid: 'a33bf360-9bf1-5d0f-b082-9ef3a51aa231', | ||
areaName: 'Skaha' | ||
}, | ||
{ | ||
uuid: '26913742-ffc5-5c8f-834b-7f0cd1b58d81', | ||
areaName: 'The Bugaboos' | ||
}, | ||
{ | ||
uuid: 'fa6ebe07-759f-5a35-b715-c39bbb8424d2', | ||
areaName: 'Lake Louise' | ||
} | ||
] | ||
}, | ||
{ | ||
areaName: 'South Africa', | ||
uuid: '1d33c773-e381-5b8a-a13f-3dfd7991732b', | ||
children: [{ | ||
uuid: '4ed6c976-ee02-564a-801e-20ccc10e6e26', | ||
areaName: 'Rocklands' | ||
} | ||
] | ||
} | ||
] |
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,15 @@ | ||
import { ReactNode } from 'react' | ||
|
||
interface Props { | ||
header: ReactNode | ||
children: ReactNode | ||
} | ||
export const SectionContainer: React.FC<Props> = ({ header, children }) => { | ||
return ( | ||
<section className='block w-full px-4 2xl:px-0 mx-auto max-w-5xl xl:max-w-7xl'> | ||
{header} | ||
<hr className='mb-6 border-2 border-base-content' /> | ||
{children} | ||
</section> | ||
) | ||
} |
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
3a2e2a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
open-tacos – ./
www.openbeta.io
open-tacos-git-develop-openbeta-dev.vercel.app
open-tacos-openbeta-dev.vercel.app
openbeta.io
openclimbmap.com
tacos.openbeta.io