Skip to content

Commit

Permalink
fix: use public url in menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
kshychko committed Sep 7, 2023
1 parent 463313b commit f011640
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions packages/demo-explorer/src/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,21 @@ const Layout = () => {
agent?.context?.name &&
GRAVATAR_URI + md5(agent?.context?.name) + '?s=200&d=retro'

const publicUrl = process.env.PUBLIC_URL;

const mainMenuItems: MenuDataItem = []

if (availableMethods.includes('dataStoreORMGetVerifiableCredentials')) {
mainMenuItems.push({
path: '/statistics',
path: publicUrl + 'statistics',
name: 'Statistics',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <EyeOutlined />,
})
}
if (availableMethods.includes('didManagerFind')) {
mainMenuItems.push({
path: '/managed-identifiers',
path: publicUrl + 'managed-identifiers',
name: 'Managed identifiers',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <UserOutlined />,
Expand All @@ -68,7 +70,7 @@ const Layout = () => {

if (availableMethods.includes('dataStoreORMGetVerifiableCredentials')) {
mainMenuItems.push({
path: '/credentials',
path: publicUrl + 'credentials',
name: 'Credentials',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <SafetyOutlined />,
Expand All @@ -77,13 +79,13 @@ const Layout = () => {

if (availableMethods.includes('dataStoreORMGetMessages')) {
mainMenuItems.push({
path: '/activity',
path: publicUrl + 'activity',
name: 'Activity',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <BarsOutlined />,
})
mainMenuItems.push({
path: '/requests',
path: publicUrl + 'requests',
name: 'Requests',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <InteractionOutlined />,
Expand All @@ -95,15 +97,15 @@ const Layout = () => {
// availableMethods.includes('sendDIDCommMessage')
// ) {
// mainMenuItems.push({
// path: '/chats/threads',
// path: publicUrl + 'chats/threads',
// name: 'DID Chats',
// icon: <MessageOutlined />,
// })
// }

if (availableMethods.includes('dataStoreORMGetIdentifiers')) {
mainMenuItems.push({
path: '/known-identifiers',
path: publicUrl + 'known-identifiers',
name: 'Known identifiers',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <GlobalOutlined />,
Expand All @@ -112,7 +114,7 @@ const Layout = () => {

if (availableMethods.includes('verifyCredential')) {
mainMenuItems.push({
path: '/credential-verifier',
path: publicUrl + 'credential-verifier',
name: 'Credential verifier',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <FileProtectOutlined />,
Expand All @@ -123,37 +125,37 @@ const Layout = () => {

if (agent) {
mainMenuItems.push({
path: '/developer',
path: publicUrl + 'developer',
name: 'Credential issuer',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <CodeOutlined />,
routes: [
// {
// path: '/developer/data-generator',
// path: publicUrl + 'developer/data-generator',
// name: 'Data generator',
// },
{
path: '/developer/credential-from-schema',
path: publicUrl + 'developer/credential-from-schema',
name: 'Issue credential from example',
},
// {
// path: '/developer/issue-profile-credential',
// path: publicUrl + 'developer/issue-profile-credential',
// name: 'Issue profile credential',
// },
// {
// path: '/developer/issue-credential',
// path: publicUrl + 'developer/issue-credential',
// name: 'Issue credential',
// },
{
path: '/developer/create-presentation',
path: publicUrl + 'developer/create-presentation',
name: 'Create presentation',
},
],
})
}

mainMenuItems.push({
path: '/settings',
path: publicUrl + 'settings',
name: 'Settings',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <SettingOutlined />,
Expand Down

0 comments on commit f011640

Please sign in to comment.