Skip to content

Commit b7752e9

Browse files
Global side button home button (#423)
1 parent 19a4c8e commit b7752e9

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/components/VirtualLab/side-bar/control.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,32 @@
22

33
import { HomeOutlined, QuestionCircleOutlined, UserOutlined } from '@ant-design/icons';
44
import Link from 'next/link';
5+
import { usePathname } from 'next/navigation';
56

67
import HelpMenu from '@/components/HelpMenu';
78
import { DocumentationIcon } from '@/components/icons';
89
import UserMenu from '@/components/user-menu';
910
import { classNames } from '@/util/utils';
1011

1112
export default function Profile() {
13+
const pathName = usePathname();
14+
1215
return (
1316
<div className="mt-auto flex flex-col gap-4">
17+
{pathName !== '/app/virtual-lab' && (
18+
<Link
19+
href="/app/virtual-lab"
20+
aria-label="home"
21+
type="button"
22+
className={classNames(
23+
'flex w-max items-center justify-center p-3',
24+
'text-white transition-all duration-200',
25+
'border border-primary-6 hover:border-primary-5 hover:bg-primary-5'
26+
)}
27+
>
28+
<HomeOutlined className="text-xl" />
29+
</Link>
30+
)}
1431
<Link
1532
href="/app/documentation"
1633
aria-label="documentation"
@@ -37,18 +54,6 @@ export default function Profile() {
3754
<QuestionCircleOutlined className="text-xl" />
3855
</div>
3956
</HelpMenu>
40-
<Link
41-
href="/app/virtual-lab"
42-
aria-label="home"
43-
type="button"
44-
className={classNames(
45-
'flex w-max items-center justify-center p-3',
46-
'text-white transition-all duration-200',
47-
'border border-primary-6 hover:border-primary-5 hover:bg-primary-5'
48-
)}
49-
>
50-
<HomeOutlined className="text-xl" />
51-
</Link>
5257
<UserMenu
5358
cls={{
5459
trigger: '!p-0',

0 commit comments

Comments
 (0)