generated from taylorbryant/gatsby-starter-tailwind
-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: new add climbs page in dashboard (#1037)
* new add climbs page in area edit dashboard
- Loading branch information
Showing
19 changed files
with
656 additions
and
91 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
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,30 +1,30 @@ | ||
import Link from 'next/link' | ||
import { Plus } from '@phosphor-icons/react/dist/ssr' | ||
import { ClimbList } from '@/app/editArea/[slug]/general/components/climb/ClimbListForm' | ||
import { AreaType } from '@/js/types' | ||
/** | ||
* Sub-areas section | ||
* Climb list section | ||
*/ | ||
export const ClimbListSection: React.FC<{ area: AreaType }> = ({ area }) => { | ||
export const ClimbListSection: React.FC<{ area: AreaType, editMode?: boolean }> = ({ area, editMode = false }) => { | ||
const { uuid, gradeContext, climbs, metadata } = area | ||
if (!metadata.leaf) return null | ||
return ( | ||
<section className='w-full mt-16'> | ||
<section className='w-full'> | ||
<div className='flex items-center justify-between'> | ||
<div className='flex items-center gap-3'> | ||
<h3 className='flex items-center gap-4'>{climbs.length} Climbs</h3> | ||
</div> | ||
<div className='flex items-center gap-2'> | ||
<span className='text-sm italic'>Coming soon:</span> | ||
<Link href={`/editArea/${uuid}/general#addArea`} className='btn-disabled btn btn-sm'> | ||
<Plus size={18} weight='bold' /> New Climbs | ||
</Link> | ||
</div> | ||
{/* Already in the edit dashboard. Don't show the button */} | ||
{!editMode && | ||
<div className='flex items-center gap-2'> | ||
<a href={`/editArea/${uuid}/manageClimbs`} className='btn btn-sm btn-accent btn-outline'> | ||
<Plus size={18} weight='bold' /> New Climbs | ||
</a> | ||
</div>} | ||
</div> | ||
|
||
<hr className='my-6 border-2 border-base-content' /> | ||
<hr className='mt-2 mb-6 border-2 border-base-content' /> | ||
|
||
<ClimbList gradeContext={gradeContext} areaMetadata={metadata} climbs={climbs} /> | ||
<ClimbList gradeContext={gradeContext} areaMetadata={metadata} climbs={climbs} editMode={editMode} /> | ||
</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
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,21 @@ | ||
import { ReactNode } from 'react' | ||
|
||
/** | ||
* Reusable section container | ||
*/ | ||
export const SectionContainer: React.FC<{ children: ReactNode, id: string } > = ({ id, children }) => ( | ||
<div id={id}> | ||
<section className='mt-2 w-full flex flex-col gap-y-8'> | ||
{children} | ||
</section> | ||
</div> | ||
) | ||
|
||
/** | ||
* Reusable page container | ||
*/ | ||
export const PageContainer: React.FC<{ children: ReactNode } > = ({ children }) => ( | ||
<div className='grid grid-cols-1 gap-y-8'> | ||
{children} | ||
</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
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.
eb83f0b
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 – ./
open-tacos-openbeta-dev.vercel.app
open-tacos-git-develop-openbeta-dev.vercel.app
openbeta.io
www.openbeta.io
openclimbmap.com
tacos.openbeta.io