Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefwint committed Sep 24, 2024
1 parent d47fc0c commit 5ea759d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { Button, Notification, formatDate } from '@pzh-ui/components'
import { useQueryClient } from '@tanstack/react-query'
import { useMemo } from 'react'

import {
getPublicationAnnouncementsGetQueryKey,
usePublicationActPackagesActPackageUuidCreateAnnouncementPost,
Expand All @@ -7,9 +11,7 @@ import {
PublicationPackage,
PublicationVersion,
} from '@/api/fetchers.schemas'
import { Button, Notification, formatDate } from '@pzh-ui/components'
import { useQueryClient } from '@tanstack/react-query'
import { useMemo } from 'react'

import { PublicationType } from '../types'

interface PublicationNotificationProps {
Expand Down Expand Up @@ -41,19 +43,26 @@ const PublicationNotification = ({
},
})

if (publicationType === 'act') {
const announcementDate = useMemo(
() =>
version?.Announcement_Date &&
formatDate(new Date(version.Announcement_Date), 'd LLLL yyyy'),
[version]
)
const actAnnouncementDate = useMemo(
() =>
version?.Announcement_Date &&
formatDate(new Date(version.Announcement_Date), 'd LLLL yyyy'),
[version]
)

const announcementDate = useMemo(
() =>
announcement?.Announcement_Date &&
formatDate(new Date(announcement.Announcement_Date), 'd LLLL yyyy'),
[announcement]
)

if (publicationType === 'act') {
return (
<div className="flex w-full justify-between gap-4">
<Notification
variant="positive"
title={`Regeling publicatie wordt bekend gemaakt op ${announcementDate}.${
title={`Regeling publicatie wordt bekend gemaakt op ${actAnnouncementDate}.${
!!!announcement
? ' Maak een kennisgeving om dit ontwerp te publiceren'
: ''
Expand All @@ -76,13 +85,6 @@ const PublicationNotification = ({
)
}

const announcementDate = useMemo(
() =>
announcement?.Announcement_Date &&
formatDate(new Date(announcement.Announcement_Date), 'd LLLL yyyy'),
[announcement]
)

return (
<div className="flex w-full justify-between">
<Notification
Expand Down
6 changes: 1 addition & 5 deletions src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ const ModuleDetail = () => {

const [activeTab, setActiveTab] = useState<TabType>(tab || 'objecten')

const {
data: { Module: module } = {},
isLoading,
isModuleManager,
} = useModule()
const { data: { Module: module } = {}, isLoading } = useModule()

const handleTabChange: TabsProps['onSelectionChange'] = key => {
setActiveTab(key as TabType)
Expand Down

0 comments on commit 5ea759d

Please sign in to comment.