- FIX KRITIS: apps/dimentorin/src/index.css @theme nyimpang dari Figma (67 token beda: primary-500 #1a8ce6 vs #23a1eb, semua warna success/info/warning/danger + skala typography). Disamakan dgn libs/ui (source of truth Figma). - Hapus hardcoded warna non-token di apps: blue-400, gray-5/6/700, amber/emerald/red-100, green-200/500 -> token primary/neutral/warning/success/danger - libs/ui: gray-* -> neutral-*, blue-* -> primary-*, #1a8ce6 -> #23a1eb, bg-[#F0F8FF] -> primary-50, SVG fill hex -> fill-* token classes - Typography: text-[27/26/22/11px] menyimpang dari skala Figma -> text-[29/23/19/12px] - Radius: rounded-4xl (32px, tidak ada di Figma) -> rounded-3xl (24px)
127 lines
4.5 KiB
TypeScript
127 lines
4.5 KiB
TypeScript
import {
|
|
AppstoreOutlined,
|
|
AuditOutlined,
|
|
InboxOutlined,
|
|
LogoutOutlined,
|
|
ReloadOutlined,
|
|
UsergroupAddOutlined,
|
|
UserOutlined,
|
|
UserSwitchOutlined,
|
|
} from '@ant-design/icons';
|
|
import { Button } from '../../atoms';
|
|
import { FC, ReactElement } from 'react';
|
|
import { Link, useLocation } from 'react-router-dom';
|
|
import { useSession } from '@imphnen-frontend-service/utils';
|
|
|
|
export const BackofficeSidebar: FC = (): ReactElement => {
|
|
const { signOut } = useSession();
|
|
const location = useLocation();
|
|
const isActive = (path: string) => location.pathname.includes(path);
|
|
|
|
return (
|
|
<aside className="sticky top-0 left-0 w-[280px] bg-white min-h-screen py-[60px] px-[28px] shadow-xl flex flex-col justify-between">
|
|
<div className="flex flex-col gap-20 justify-between items-center">
|
|
<img src="/logos/simple.svg" alt="IMPHNEN Logo" className="w-[150px]" />
|
|
|
|
<nav className="flex flex-col gap-4 w-full">
|
|
<Link
|
|
to="/dashboard"
|
|
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
|
|
isActive('/dashboard')
|
|
? 'bg-primary-500 text-white rounded-md'
|
|
: 'text-neutral-700 hover:bg-neutral-100'
|
|
}`}
|
|
>
|
|
<AppstoreOutlined className="text-[20px]" />
|
|
<span className="text-p3 font-medium">Dashboard & Set Gacha</span>
|
|
</Link>
|
|
|
|
<Link
|
|
to="/gacha-roll"
|
|
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
|
|
isActive('/gacha-roll')
|
|
? 'bg-primary-500 text-white rounded-md'
|
|
: 'text-neutral-700 hover:bg-neutral-100'
|
|
}`}
|
|
>
|
|
<ReloadOutlined className="text-[20px]" />
|
|
<span className="text-p3 font-medium">Gacha Roll</span>
|
|
</Link>
|
|
|
|
<Link
|
|
to="/permissions"
|
|
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
|
|
isActive('/permissions')
|
|
? 'bg-primary-500 text-white rounded-md'
|
|
: 'text-neutral-700 hover:bg-neutral-100'
|
|
}`}
|
|
>
|
|
<UserSwitchOutlined className="text-[20px]" />
|
|
<span className="text-p3 font-medium">Permissions</span>
|
|
</Link>
|
|
|
|
<Link
|
|
to="/roles"
|
|
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
|
|
isActive('/roles')
|
|
? 'bg-primary-500 text-white rounded-md'
|
|
: 'text-neutral-700 hover:bg-neutral-100'
|
|
}`}
|
|
>
|
|
<UsergroupAddOutlined className="text-[20px]" />
|
|
<span className="text-p3 font-medium">Roles</span>
|
|
</Link>
|
|
|
|
<Link
|
|
to="/accounts"
|
|
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
|
|
isActive('/accounts')
|
|
? 'bg-primary-500 text-white rounded-md'
|
|
: 'text-neutral-700 hover:bg-neutral-100'
|
|
}`}
|
|
>
|
|
<UserOutlined className="text-[20px]" />
|
|
<span className="text-p3 font-medium">Data Akun</span>
|
|
</Link>
|
|
|
|
<Link
|
|
to="/transactions"
|
|
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
|
|
isActive('/transactions')
|
|
? 'bg-primary-500 text-white rounded-md'
|
|
: 'text-neutral-700 hover:bg-neutral-100'
|
|
}`}
|
|
>
|
|
<AuditOutlined className="text-[20px]" />
|
|
<span className="text-p3 font-medium">Validasi Transaksi</span>
|
|
</Link>
|
|
|
|
<Link
|
|
to="/prizes"
|
|
className={`flex items-center justify-items-start gap-3 px-[8px] py-[10px] ${
|
|
isActive('/prizes')
|
|
? 'bg-primary-500 text-white rounded-md'
|
|
: 'text-neutral-700 hover:bg-neutral-100'
|
|
}`}
|
|
>
|
|
<InboxOutlined className="text-[20px]" />
|
|
<span className="text-p3 font-medium">Data Pengiriman Hadiah</span>
|
|
</Link>
|
|
</nav>
|
|
</div>
|
|
|
|
<div className="w-full">
|
|
<hr className="mb-5 border-primary-200" />
|
|
<Button
|
|
onClick={signOut}
|
|
variant="text"
|
|
className="items-start justify-start gap-3 px-[8px] py-[10px] text-neutral-700 hover:text-danger-500 transition-colors w-full"
|
|
>
|
|
<LogoutOutlined className="text-[20px]" />
|
|
<span className="text-p3 font-medium">Log Out</span>
|
|
</Button>
|
|
</div>
|
|
</aside>
|
|
);
|
|
};
|