-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into tooling/fix-kiosk
Conflicts: pnpm-lock.yaml
- Loading branch information
Showing
160 changed files
with
3,496 additions
and
3,054 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
apps/ui-kit/src/lib/components/organisms/dialog/dialog.enums.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export enum DialogPosition { | ||
Center = 'center', | ||
Right = 'right', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export * from './Dialog'; | ||
export * from './dialog.enums'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export * from './sidebar/Sidebar'; |
19 changes: 19 additions & 0 deletions
19
apps/wallet-dashboard/app/(protected)/components/sidebar/Sidebar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { PROTECTED_ROUTES } from '@/lib/constants/routes.constants'; | ||
import { IotaLogoMark } from '@iota/ui-icons'; | ||
import { SidebarItem } from './SidebarItem'; | ||
|
||
export function Sidebar() { | ||
return ( | ||
<nav className="flex h-screen flex-col items-center gap-y-2xl bg-neutral-100 py-xl dark:bg-neutral-6"> | ||
<IotaLogoMark className="h-10 w-10 text-neutral-10 dark:text-neutral-92" /> | ||
<div className="flex flex-col gap-y-xs"> | ||
{PROTECTED_ROUTES.map((route) => ( | ||
<SidebarItem key={route.path} {...route} /> | ||
))} | ||
</div> | ||
</nav> | ||
); | ||
} |
22 changes: 22 additions & 0 deletions
22
apps/wallet-dashboard/app/(protected)/components/sidebar/SidebarItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
'use client'; | ||
|
||
import type { ProtectedRoute } from '@/lib/interfaces'; | ||
import { NavbarItem, Tooltip, TooltipPosition } from '@iota/apps-ui-kit'; | ||
import { usePathname } from 'next/navigation'; | ||
import Link from 'next/link'; | ||
|
||
export function SidebarItem({ icon, title, path }: ProtectedRoute) { | ||
const pathname = usePathname(); | ||
const RouteIcon = icon; | ||
const isActive = pathname === path; | ||
return ( | ||
<Tooltip text={title} position={TooltipPosition.Right}> | ||
<Link href={path} className="relative px-sm py-xxs"> | ||
<NavbarItem isSelected={isActive} icon={<RouteIcon />} /> | ||
</Link> | ||
</Tooltip> | ||
); | ||
} |
16 changes: 16 additions & 0 deletions
16
apps/wallet-dashboard/app/(protected)/components/top-nav/TopNav.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Badge, BadgeType, Button, ButtonType } from '@iota/apps-ui-kit'; | ||
import { ConnectButton } from '@iota/dapp-kit'; | ||
import { Settings } from '@iota/ui-icons'; | ||
|
||
export function TopNav() { | ||
return ( | ||
<div className="flex w-full flex-row items-center justify-end gap-md py-xs--rs"> | ||
<Badge label="Mainnet" type={BadgeType.PrimarySoft} /> | ||
<ConnectButton size="md" /> | ||
<Button icon={<Settings />} type={ButtonType.Ghost} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
'use client'; | ||
|
||
import { Notifications } from '@/components/index'; | ||
import React, { useEffect, useState, type PropsWithChildren } from 'react'; | ||
import { useCurrentAccount, useCurrentWallet } from '@iota/dapp-kit'; | ||
import { Button } from '@iota/apps-ui-kit'; | ||
import { redirect } from 'next/navigation'; | ||
import { Sidebar } from './components'; | ||
import { TopNav } from './components/top-nav/TopNav'; | ||
|
||
function DashboardLayout({ children }: PropsWithChildren): JSX.Element { | ||
const [isDarkMode, setIsDarkMode] = useState(false); | ||
const { connectionStatus } = useCurrentWallet(); | ||
const account = useCurrentAccount(); | ||
|
||
const toggleDarkMode = () => { | ||
setIsDarkMode(!isDarkMode); | ||
if (isDarkMode) { | ||
document.documentElement.classList.remove('dark'); | ||
} else { | ||
document.documentElement.classList.add('dark'); | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
if (connectionStatus !== 'connected' && !account) { | ||
redirect('/'); | ||
} | ||
}, [connectionStatus, account]); | ||
|
||
return ( | ||
<div className="h-full"> | ||
<div className="fixed left-0 top-0 z-50 h-full"> | ||
<Sidebar /> | ||
</div> | ||
|
||
<div className="container relative min-h-screen"> | ||
<div className="sticky top-0"> | ||
<TopNav /> | ||
</div> | ||
<div>{children}</div> | ||
</div> | ||
|
||
<div className="fixed bottom-5 right-5"> | ||
<Button onClick={toggleDarkMode} text={isDarkMode ? 'Light Mode' : 'Dark Mode'} /> | ||
</div> | ||
|
||
<Notifications /> | ||
</div> | ||
); | ||
} | ||
|
||
export default DashboardLayout; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.