Skip to content

Commit

Permalink
Update page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
DinerIsmail committed Sep 30, 2024
1 parent 01fe10c commit f46e3c5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/admin/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client'
import NextLink from 'next/link'
import { useCallback } from 'react'
import { useRouter } from 'next/navigation'
import {
Expand All @@ -9,18 +10,22 @@ import {
Center,
Alert,
AlertIcon,
Link,
Text,
} from '@chakra-ui/react'
import { HiArrowLeft } from 'react-icons/hi'
import useListing from '@hooks/listings/useListing'
import useUpdateListing from '@hooks/listings/useUpdateListing'
import useCategories from '@hooks/categories/useCategories'
import ListingForm from '@components/admin/listing-form'
import { useAppContext } from '@store/hooks'

export default function ListingPage({ params }) {
const router = useRouter()
const slug = params.slug
const { categories } = useCategories()
const { mutate: updateListing } = useUpdateListing()
const { selectedWebSlug } = useAppContext()

const goBack = useCallback(() => {
router.back()
Expand Down Expand Up @@ -69,6 +74,16 @@ export default function ListingPage({ params }) {
</Button>

<Box mt={4}>
<Text mb="1rem" fontSize="0.875rem">
You can view this listing at{' '}
<Link
as={NextLink}
href={`https://${selectedWebSlug}.resilienceweb.org.uk/${slug}`}
target="_blank"
>
{selectedWebSlug}.resilienceweb.org.uk/{slug}
</Link>
</Text>
<Box shadow="base" rounded={[null, 'md']} overflow={{ sm: 'hidden' }}>
{listing.pending && (
<Alert status="info" colorScheme="purple">
Expand Down

0 comments on commit f46e3c5

Please sign in to comment.