-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from BacPacNet/feat-mobile-view-UI
fix: left and side navbar WIP
- Loading branch information
Showing
12 changed files
with
298 additions
and
73 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
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,23 @@ | ||
import React, { ReactNode, useState } from 'react' | ||
|
||
interface TooltipProps { | ||
text: string // The text to display in the tooltip | ||
children: ReactNode // The element that triggers the tooltip | ||
} | ||
|
||
const Tooltip: React.FC<TooltipProps> = ({ text, children }) => { | ||
const [isVisible, setIsVisible] = useState<boolean>(false) | ||
|
||
return ( | ||
<div className="relative inline-block" onMouseEnter={() => setIsVisible(true)} onMouseLeave={() => setIsVisible(false)}> | ||
{children} | ||
{isVisible && ( | ||
<div className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-max bg-slate-600 text-white text-[8px] px-3 py-1 rounded shadow-lg z-50"> | ||
{text} | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default Tooltip |
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,18 @@ | ||
import LeftNavbar from '@/components/organisms/LeftNavbar' | ||
|
||
interface Props { | ||
isOpen: boolean | ||
toggleLeftNavbar: () => void | ||
} | ||
|
||
export default function MobileLeftNavbar({ isOpen, toggleLeftNavbar }: Props) { | ||
return ( | ||
<div | ||
className={`fixed top-[68px] left-0 z-50 h-full w-3/4 md:w-1/2 bg-white transition-transform duration-300 transform ${ | ||
isOpen ? 'translate-x-0' : '-translate-x-full' | ||
} lg:hidden`} | ||
> | ||
<LeftNavbar toggleLeftNavbar={toggleLeftNavbar} /> | ||
</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
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
Oops, something went wrong.