Skip to content

Commit

Permalink
open edit dashboard in a new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
viet nguyen committed Dec 1, 2023
1 parent bd4c228 commit ed24d4c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/app/area/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default async function Page ({ params }: PageWithCatchAllUuidProps): Prom
<div className='area-climb-page-summary-left'>
<h1>{areaName}</h1>

<div className='mt-6 flex flex-col text-xs text-secondary border-t border-b divide-y'>
<div className='mt-6 flex flex-col text-xs text-secondary border-t border-b divide-y'>
<a
href={getMapHref({
lat,
Expand All @@ -107,7 +107,14 @@ export default async function Page ({ params }: PageWithCatchAllUuidProps): Prom
<div className='flex items-center gap-2'>
<h3>Description</h3>
<span className='text-xs inline-block align-baseline'>
[<Link href={`/editArea/${uuid}/general#description`} className='hover:underline'>Edit</Link>]
[
<Link
href={`/editArea/${uuid}/general#description`}
target='_new'
className='hover:underline'
>
Edit
</Link>]
</span>
</div>
{(description == null || description.trim() === '') && <EditDescriptionCTA uuid={uuid} />}
Expand Down Expand Up @@ -142,7 +149,7 @@ const EditDescriptionCTA: React.FC<{ uuid: string }> = ({ uuid }) => (
<div role='alert' className='alert'>
<Lightbulb size={24} />
<div className='text-sm'>No information available. Be the first to&nbsp;
<Link href={`/editArea/${uuid}/general#description`} className='link-dotted inline-flex items-center gap-1'>
<Link href={`/editArea/${uuid}/general#description`} target='_new' className='link-dotted inline-flex items-center gap-1'>
add a description <ArrowRight size={16} />
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/area/[[...slug]]/sections/SubAreasSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const SubAreasSection: React.FC<{ area: AreaType } > = ({ area }) => {
<div className='flex items-center gap-3'>
<h3 className='flex items-center gap-4'><AreaEntityBullet />{children.length} Areas</h3>
</div>
<Link href={`/editArea/${uuid}/general#addArea`} className='btn btn-sm btn-accent'>
<Link href={`/editArea/${uuid}/general#addArea`} target='_new' className='btn btn-sm btn-accent'>
<PlusCircle size={16} /> New Areas
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/AreaPageActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { UploadPhotoButton } from '@/components/media/PhotoUploadButtons'
*/
export const AreaPageActions: React.FC<{ uuid: string, areaName: string } > = ({ uuid, areaName }) => (
<ul className='max-w-sm md:max-w-md flex items-center justify-between gap-2 w-full'>
<Link href={`/editArea/${uuid}`} className='btn btn-solid btn-accent'>
<Link href={`/editArea/${uuid}`} target='_new' className='btn btn-solid btn-accent'>
<PencilSimple size={20} weight='duotone' /> Edit
</Link>

Expand Down
2 changes: 1 addition & 1 deletion src/app/editArea/[slug]/general/components/AddAreaForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const AddAreaForm: React.FC<{ area: AreaType }> = ({ area }) => {
{notEditable &&
<div role='alert' className='alert alert-info'>
<WarningOctagon size={24} />
<span>Cannot add new areas to a crag or a boulder.</span>
<span>This area is either a crag or a boulder. Adding a new child area is not allowed.</span>
</div>}
<DashboardInput
name='areaName'
Expand Down

0 comments on commit ed24d4c

Please sign in to comment.