Skip to content

Commit

Permalink
(feature) move api keys to settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
AHarmlessPyro committed Oct 6, 2022
1 parent 8a4ee60 commit b67b308
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions frontend/src/components/Sidebar/NavLinkUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AiFillSecurityScan } from "@react-icons/all-files/ai/AiFillSecurityScan
import { AiFillApi } from "@react-icons/all-files/ai/AiFillApi"
import { HiShieldCheck } from "@react-icons/all-files/hi/HiShieldCheck"
import { IconType } from "@react-icons/all-files/lib"
import { RiKey2Fill } from "@react-icons/all-files/ri/RiKey2Fill"
import { FaWrench } from "@react-icons/all-files/fa/FaWrench"

export enum SideNavLinkDestination {
Home,
Expand All @@ -18,7 +18,7 @@ export enum SideNavLinkDestination {
SensitiveData,
Vulnerabilities,
Protection,
Keys,
Settings,
}

export const sideNavDestinationToLabel: (
Expand All @@ -41,8 +41,8 @@ export const sideNavDestinationToLabel: (
return "Connections"
case SideNavLinkDestination.Protection:
return "Protection"
case SideNavLinkDestination.Keys:
return "API Keys"
case SideNavLinkDestination.Settings:
return "Settings"
default:
throw Error(`No value mapped for ${dest}`)
}
Expand All @@ -68,8 +68,8 @@ export const sideNavDestinationToIcon: (
return FaShareAlt
case SideNavLinkDestination.Protection:
return HiShieldCheck
case SideNavLinkDestination.Keys:
return RiKey2Fill
case SideNavLinkDestination.Settings:
return FaWrench
default:
throw Error(`No value mapped for ${dest}`)
}
Expand All @@ -95,8 +95,8 @@ export const sideNavDestinationToHref: (
return "/connections"
case SideNavLinkDestination.Protection:
return "/protection"
case SideNavLinkDestination.Keys:
return "/keys"
case SideNavLinkDestination.Settings:
return "/settings"
default:
throw Error(`No value mapped for ${dest}`)
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ const SideNavBar: React.FC<SideNavBarProps> = React.memo(({ currentTab }) => {
isActive={currentTab === SideNavLinkDestination.Specs}
/>
<SideNavLink
destination={SideNavLinkDestination.Keys}
isActive={currentTab === SideNavLinkDestination.Keys}
destination={SideNavLinkDestination.Settings}
isActive={currentTab === SideNavLinkDestination.Settings}
/>
</Stack>
<Spacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Keys = ({ keys: _keysString }) => {
name: resp.name,
identifier: resp.identifier,
created: resp.created,
for:resp.for
for: resp.for,
})
console.log(new_keys)
setKeys(new_keys)
Expand All @@ -67,7 +67,7 @@ const Keys = ({ keys: _keysString }) => {
return (
<SidebarLayoutShell
title="API Specs"
currentTab={SideNavLinkDestination.Specs}
currentTab={SideNavLinkDestination.Settings}
>
<ContentContainer>
<Heading fontWeight="medium" size="lg" mb="4">
Expand Down

0 comments on commit b67b308

Please sign in to comment.