11import React from 'react' ;
22import { Square3Stack3DIcon , RectangleStackIcon , ClockIcon } from '@heroicons/react/20/solid' ;
33import useNavigationStore from 'stores/AppNavBarStore' ;
4- import { AppNavBarItems } from 'constants/AppNavBar' ;
4+ import { AppNavBarItems , AppNavBarStyles } from 'constants/AppNavBar' ;
55import Tippy from '@tippyjs/react' ;
66import 'tippy.js/dist/tippy.css' ;
77import { Transition } from '@headlessui/react' ;
@@ -10,7 +10,7 @@ import { Transition } from '@headlessui/react';
1010const AppNavBar = ( { showRightBorder = true } ) => {
1111 const navigationSelectedValue = useNavigationStore ( ( state ) => state . selectedNavVal ) ;
1212 const updateNavigationSelectedValue = useNavigationStore ( ( state ) => state . setNavState ) ;
13- const collapseNavBarValue = useNavigationStore ( ( state ) => state . collapseNavBar ) ;
13+ const isNavBarCollapsed = useNavigationStore ( ( state ) => state . collapseNavBar ) ;
1414
1515 const handleOnClick = ( event ) => {
1616 const dataAttributeValue = event . currentTarget . dataset . navItem ;
@@ -19,9 +19,10 @@ const AppNavBar = ({ showRightBorder = true }) => {
1919
2020 const selectedNavItemStyles = 'before:bg-cyan-900 bg-background text-cyan-900' ;
2121 const nonSelectedNavItemStyles = 'hover:bg-cyan-900 hover:text-white' ;
22+ const navStyles = 'relative flex h-screen flex-col transition-all delay-150 duration-300' ;
2223 return (
2324 < nav
24- className = { `relative flex h-screen flex-col transition-all delay-150 duration-300 ${ collapseNavBarValue ? ' min-w-14' : ' min-w-28' } ${ showRightBorder ? 'border-r border-gray-300' : '' } ` }
25+ className = { `${ navStyles } ${ isNavBarCollapsed ? AppNavBarStyles . collapsedNavBarWidth . tailwindValue . min : AppNavBarStyles . expandedNavBarWidth . tailwindValue . min } ${ showRightBorder && ! isNavBarCollapsed ? 'border-r border-gray-300' : '' } ` }
2526 >
2627 < button className = 'relative' onClick = { handleOnClick } data-nav-item = { AppNavBarItems . collections . value } >
2728 < div
@@ -31,15 +32,15 @@ const AppNavBar = ({ showRightBorder = true }) => {
3132 : nonSelectedNavItemStyles
3233 } delay-50 flex w-full flex-col items-center px-2 py-4 text-center transition-all duration-100`}
3334 >
34- { collapseNavBarValue ? (
35+ { isNavBarCollapsed ? (
3536 < Tippy content = { AppNavBarItems . collections . displayValue } placement = 'right' >
36- < RectangleStackIcon className = 'w-4 h-4 mb-2 ' />
37+ < RectangleStackIcon className = 'mb-2 h-4 w-4 ' />
3738 </ Tippy >
3839 ) : (
39- < RectangleStackIcon className = 'w-4 h-4 mb-2 ' />
40+ < RectangleStackIcon className = 'mb-2 h-4 w-4 ' />
4041 ) }
4142 < Transition
42- show = { ! collapseNavBarValue }
43+ show = { ! isNavBarCollapsed }
4344 enter = 'transition-all ease-in-out duration-500 delay-[200ms]'
4445 enterFrom = 'opacity-0 translate-y-6'
4546 enterTo = 'opacity-100 translate-y-0'
@@ -59,15 +60,15 @@ const AppNavBar = ({ showRightBorder = true }) => {
5960 : nonSelectedNavItemStyles
6061 } delay-50 flex w-full flex-col items-center px-2 py-4 text-center transition-all duration-100`}
6162 >
62- { collapseNavBarValue ? (
63+ { isNavBarCollapsed ? (
6364 < Tippy content = { AppNavBarItems . environments . displayValue } placement = 'right' >
64- < Square3Stack3DIcon className = 'w-4 h-4 mb-2 ' />
65+ < Square3Stack3DIcon className = 'mb-2 h-4 w-4 ' />
6566 </ Tippy >
6667 ) : (
67- < Square3Stack3DIcon className = 'w-4 h-4 mb-2 ' />
68+ < Square3Stack3DIcon className = 'mb-2 h-4 w-4 ' />
6869 ) }
6970 < Transition
70- show = { ! collapseNavBarValue }
71+ show = { ! isNavBarCollapsed }
7172 enter = 'transition-all ease-in-out duration-500 delay-[200ms]'
7273 enterFrom = 'opacity-0 translate-y-6'
7374 enterTo = 'opacity-100 translate-y-0'
@@ -79,25 +80,25 @@ const AppNavBar = ({ showRightBorder = true }) => {
7980 </ Transition >
8081 </ div >
8182 </ button >
82- < button className = 'px-2 py-4 cursor-not-allowed ' data-nav-item = { AppNavBarItems . history . value } >
83+ < button className = 'cursor-not-allowed px-2 py-4 ' data-nav-item = { AppNavBarItems . history . value } >
8384 < div className = 'text-gray-300' >
84- { collapseNavBarValue ? (
85- < div className = 'transition-all duration-300 delay-150' >
85+ { isNavBarCollapsed ? (
86+ < div className = 'transition-all delay-150 duration-300 ' >
8687 < Tippy content = { AppNavBarItems . history . displayValue + ': Coming Soon!' } placement = 'right' >
8788 < div className = 'flex flex-col items-center text-center ' >
88- < ClockIcon className = 'w-4 h-4 mb-2 ' />
89+ < ClockIcon className = 'mb-2 h-4 w-4 ' />
8990 </ div >
9091 </ Tippy >
9192 </ div >
9293 ) : (
9394 < Tippy content = 'Coming Soon!' placement = 'right' >
9495 < div className = 'flex flex-col items-center text-center ' >
95- < ClockIcon className = 'w-4 h-4 mb-2 ' />
96+ < ClockIcon className = 'mb-2 h-4 w-4 ' />
9697 </ div >
9798 </ Tippy >
9899 ) }
99100 < Transition
100- show = { ! collapseNavBarValue }
101+ show = { ! isNavBarCollapsed }
101102 enter = 'transition-all ease-in-out duration-500 delay-[200ms]'
102103 enterFrom = 'opacity-0 translate-y-6'
103104 enterTo = 'opacity-100 translate-y-0'
0 commit comments