From f8bcaed3ad04d65322b5bb24c822e79a307b883f Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 19 Dec 2022 19:40:04 +0100 Subject: [PATCH] Moved short URL status to the last column in the table --- src/short-urls/ShortUrlsTable.tsx | 3 +-- src/short-urls/helpers/ShortUrlStatus.tsx | 11 +++++------ src/short-urls/helpers/ShortUrlsRow.tsx | 6 +++--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/short-urls/ShortUrlsTable.tsx b/src/short-urls/ShortUrlsTable.tsx index a1018e95..4448af12 100644 --- a/src/short-urls/ShortUrlsTable.tsx +++ b/src/short-urls/ShortUrlsTable.tsx @@ -65,7 +65,6 @@ export const ShortUrlsTable = (ShortUrlsRow: ShortUrlsRowType) => ({ Created at {renderOrderIcon?.('dateCreated')} - Short URL {renderOrderIcon?.('shortCode')} @@ -82,7 +81,7 @@ export const ShortUrlsTable = (ShortUrlsRow: ShortUrlsRowType) => ({ Visits {renderOrderIcon?.('visits')} -   + diff --git a/src/short-urls/helpers/ShortUrlStatus.tsx b/src/short-urls/helpers/ShortUrlStatus.tsx index 82e61b65..11372206 100644 --- a/src/short-urls/helpers/ShortUrlStatus.tsx +++ b/src/short-urls/helpers/ShortUrlStatus.tsx @@ -15,7 +15,7 @@ interface ShortUrlStatusProps { interface StatusResult { icon: IconDefinition; className: string; - description?: ReactNode; + description: ReactNode; } const resolveShortUrlStatus = (shortUrl: ShortUrl): StatusResult => { @@ -65,6 +65,7 @@ const resolveShortUrlStatus = (shortUrl: ShortUrl): StatusResult => { return { icon: faCheck, className: 'text-primary', + description: 'This short URL can be visited normally.', }; }; @@ -81,11 +82,9 @@ export const ShortUrlStatus: FC = ({ shortUrl }) => { > - {description && ( - tooltipRef.current) as any} placement="right"> - {description} - - )} + tooltipRef.current) as any} placement="bottom"> + {description} + ); }; diff --git a/src/short-urls/helpers/ShortUrlsRow.tsx b/src/short-urls/helpers/ShortUrlsRow.tsx index b97b3c57..ae942518 100644 --- a/src/short-urls/helpers/ShortUrlsRow.tsx +++ b/src/short-urls/helpers/ShortUrlsRow.tsx @@ -37,9 +37,6 @@ export const ShortUrlsRow = (