Switch accounts

This commit is contained in:
AkiraFukushima 2023-11-03 00:54:44 +09:00
parent e379d5e577
commit 832697f53a
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
1 changed files with 9 additions and 1 deletions

View File

@ -56,12 +56,20 @@ export default function Layout({ children }: LayoutProps) {
}
}
const selectedClassName = (id: number) => {
if (id === parseInt(router.query.id as string)) {
return 'bg-blue-950 cursor-pointer'
} else {
return 'cursor-pointer'
}
}
return (
<div className="app flex flex-col min-h-screen">
<main className="flex w-full box-border my-0 mx-auto min-h-screen">
<aside className="w-16 bg-gray-900">
{accounts.map(account => (
<div key={account.id}>
<div key={account.id} className={selectedClassName(account.id)}>
<Avatar
alt={account.domain}
img={account.avatar}