From 237fb90eb083a94818ed2a230b96f58ebffd47e2 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 13 Dec 2021 14:23:05 +0700 Subject: [PATCH] Remove as properly from Link components --- studio/components/interfaces/Home/ProjectUsage.tsx | 13 +++++-------- .../layouts/AccountLayout/WithSidebar.tsx | 3 +-- .../ProjectLayout/LayoutHeader/LayoutHeader.tsx | 2 +- .../to-be-cleaned/Auth/PolicySelection.js | 1 - 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/studio/components/interfaces/Home/ProjectUsage.tsx b/studio/components/interfaces/Home/ProjectUsage.tsx index 4470eef6696..a45dcebac84 100644 --- a/studio/components/interfaces/Home/ProjectUsage.tsx +++ b/studio/components/interfaces/Home/ProjectUsage.tsx @@ -26,7 +26,7 @@ const ProjectUsage: FC = ({ project }) => { const { data, error }: any = useSWR( // only fetch when browser window is active `${API_URL}/projects/${ref}/log-stats`, - get, + get // increase refresh rate x10 to 30s when focus lost // conditional fetching will cause cached data to clear (not desirable) // { refreshInterval: isActive ? 3000 : 30000 } @@ -46,8 +46,7 @@ const ProjectUsage: FC = ({ project }) => { } title="Database" - href={'/project/[ref]/editor/table'} - as={`/project/${ref}/editor/table`} + href={`/project/${ref}/editor/table`} /> = ({ project }) => { } title="Auth" - href={'/project/[ref]/auth/users'} - as={`/project/${ref}/auth/users`} + href={`/project/${ref}/auth/users`} /> = ({ project }) => { } title="Storage" - href={'/project/[ref]/storage/buckets'} - as={`/project/${ref}/storage/buckets`} + href={`/project/${ref}/storage/buckets`} /> { const Tag = props?.href ? Link : 'div' return ( - +
= ({ links, subitems, subitemsParentKey }) => isActive={isActive} label={x.label} href={x.href} - as={x.as} onClick={x.onClick} external={x.external || false} /> @@ -145,7 +144,7 @@ const LinksWithoutHeaders: FC = ({ links, subitems, subitemsParentKey }) => const SidebarItem: FC = ({ id, label, as, href, isActive, isSubitem, onClick, external }) => { return ( - + ) : ( - + diff --git a/studio/components/to-be-cleaned/Auth/PolicySelection.js b/studio/components/to-be-cleaned/Auth/PolicySelection.js index aa24958b57a..e79bd3780cb 100644 --- a/studio/components/to-be-cleaned/Auth/PolicySelection.js +++ b/studio/components/to-be-cleaned/Auth/PolicySelection.js @@ -57,7 +57,6 @@ const PolicySelection = ({ target="_blank" className="text-green-400" href="https://supabase.com/docs/guides/auth#policies" - as="https://supabase.com/docs/guides/auth#policies" > here