From 004390da1e45e7a31c5fced35a110750360edaf5 Mon Sep 17 00:00:00 2001 From: Ririio Date: Thu, 13 Apr 2023 10:30:00 -0400 Subject: [PATCH] always allow renew button | adding toast when clicked --- app/components/dns-record-table-row.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/components/dns-record-table-row.tsx b/app/components/dns-record-table-row.tsx index 37b5d951..4d5dfc86 100644 --- a/app/components/dns-record-table-row.tsx +++ b/app/components/dns-record-table-row.tsx @@ -9,9 +9,9 @@ import { Link, ButtonGroup, useClipboard, + useToast, } from '@chakra-ui/react'; import { EditIcon, DeleteIcon, RepeatIcon, CopyIcon, InfoOutlineIcon } from '@chakra-ui/icons'; -import dayjs from 'dayjs'; import { Form, useNavigate } from '@remix-run/react'; import DnsRecordName from './dns-record/dns-record-name'; @@ -32,8 +32,8 @@ export default function DnsRecordsTableRow({ }: DnsRecordsTableRowProps) { const { baseDomain } = useEffectiveUser(); const { onCopy } = useClipboard(`${dnsRecord.subdomain}.${baseDomain}`); - const isRenewable = dayjs(dnsRecord.expiresAt).isBefore(dayjs().add(6, 'month')); const navigate = useNavigate(); + const toast = useToast(); const handleOnCopy = () => { onCopy(); @@ -92,7 +92,13 @@ export default function DnsRecordsTableRow({ aria-label="Refresh DNS record" variant="ghost" type="submit" - isDisabled={!isRenewable} + onClick={() => + toast({ + title: `DNS Record "${dnsRecord.subdomain}" has been successfully renewed`, + position: 'bottom-right', + status: 'success', + }) + } />