Remove as properly from Link components

This commit is contained in:
Joshen Lim committed 2021-12-13 15:36:34 +07:00
1 parent c5f039e5ed
commit 237fb90eb0
4 files changed
+7 -12

No files matched your search

@@ -26,7 +26,7 @@ const ProjectUsage: FC<Props> = ({ 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<Props> = ({ project }) => {
<PanelHeader
icon={<IconDatabase size="small" />}
title="Database"
href={'/project/[ref]/editor/table'}
as={`/project/${ref}/editor/table`}
href={`/project/${ref}/editor/table`}
/>
<ChartHandler
startDate={startDate}
@@ -73,8 +72,7 @@ const ProjectUsage: FC<Props> = ({ project }) => {
<PanelHeader
icon={<IconKey size="small" />}
title="Auth"
href={'/project/[ref]/auth/users'}
as={`/project/${ref}/auth/users`}
href={`/project/${ref}/auth/users`}
/>
<ChartHandler
startDate={startDate}
@@ -100,8 +98,7 @@ const ProjectUsage: FC<Props> = ({ project }) => {
<PanelHeader
icon={<IconArchive size="small" />}
title="Storage"
href={'/project/[ref]/storage/buckets'}
as={`/project/${ref}/storage/buckets`}
href={`/project/${ref}/storage/buckets`}
/>
<ChartHandler
startDate={startDate}
@@ -157,7 +154,7 @@ export default ProjectUsage
const PanelHeader = (props: any) => {
const Tag = props?.href ? Link : 'div'
return (
<Tag href={props.href} as={props.as}>
<Tag href={props.href}>
<div
className={
'flex items-center space-x-3 opacity-80 ' +
@@ -116,7 +116,6 @@ const LinksWithoutHeaders: FC<any> = ({ 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<any> = ({ links, subitems, subitemsParentKey }) =>
const SidebarItem: FC<any> = ({ id, label, as, href, isActive, isSubitem, onClick, external }) => {
return (
<Link href={href || ''} as={as || ''}>
<Link href={href || ''}>
<a className="block" target={external ? '_blank' : '_self'}>
<Menu.Item
rounded
@@ -38,7 +38,7 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder =
</>
) : (
<Typography.Text small className="mx-2">
<Link as="/" href="/">
<Link href="/">
<a
className={`block px-2 py-1 focus:outline-none focus:bg-transparent cursor-pointer dark:hover:text-white`}
>
@@ -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
</a>