-
Notifications
You must be signed in to change notification settings - Fork 0
[CLIENT] [COMPONENT] : Navigation bar in application #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
699cd15
component(layout): Universal Routing set
codeSubhajit0 928b411
component(navigation): add page loader; add layout routing
SUVAJIT-KARMAKAR ea48be0
component(navigation): add navigation component; add favicon
SUVAJIT-KARMAKAR 41390b4
component(navigation): cosmetic change in navigation bar
SUVAJIT-KARMAKAR 85eae3b
component(navigation): add contact button
SUVAJIT-KARMAKAR e02acab
component(navigation): add cosmetic change for font text
SUVAJIT-KARMAKAR 0a4673d
component(navigation): add responsive block for navigation
SUVAJIT-KARMAKAR 87625b5
component(navigation)(DS1): add contact button with routing; DS1 navi…
SUVAJIT-KARMAKAR ac16f27
component(navigation)(MS1): add mobile navigation icon
SUVAJIT-KARMAKAR 98ae85c
component(navigation)(MS1): add sidebar for mobile; cosmetic change i…
SUVAJIT-KARMAKAR 60b7fb3
component(navigation)(MS1): add requested changes
SUVAJIT-KARMAKAR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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,7 @@ | ||
import React from 'react'; | ||
|
||
const Footer: React.FC = () => { | ||
return <div></div>; | ||
}; | ||
|
||
export default Footer; |
23 changes: 23 additions & 0 deletions
23
client/src/components/General/NavigationBar/Navigation.styles.css
This file contains hidden or 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 @@ | ||
/* Desktop and Mobile Navigation links */ | ||
.DESKTOP-LINKS { | ||
@apply font-semibold rounded-2xl bg-white/20 shadow-lg ring-2 ring-black/10 px-3 py-4; | ||
} | ||
.DESKTOP-LINKS-ACTIVE { | ||
@apply text-black rounded-xl shadow-lg border-1 p-3; | ||
} | ||
.MOBILE-LINKS { | ||
@apply font-semibold rounded-xl bg-white/20 shadow-lg ring-2 ring-black/10 p-2; | ||
} | ||
.MOBILE-LINKS-HOVER { | ||
@apply font-semibold rounded-xl hover:bg-white/20 hover:shadow-lg hover:ring-2 hover:ring-black/10 p-2; | ||
} | ||
|
||
/* Button */ | ||
.BUTTON { | ||
@apply font-semibold rounded-2xl bg-white shadow-lg ring-2 px-4 py-4; | ||
} | ||
|
||
/* Border */ | ||
.BORDER-LEFT-CORNER-3XL { | ||
@apply border-l-3 border-white rounded-l-2xl; | ||
} |
130 changes: 130 additions & 0 deletions
130
client/src/components/General/NavigationBar/NavigationBar.tsx
This file contains hidden or 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,130 @@ | ||
import React, { useState } from 'react'; | ||
import { NavLink, Link } from 'react-router-dom'; | ||
|
||
// ICONS | ||
import { HiMenuAlt3, HiX } from 'react-icons/hi'; | ||
// UTILS | ||
import Logo from '../../../utils/Logo/Logo'; | ||
// DATA | ||
import NAVIGATION_LINKS from '../../../data/NavigationLinks/NavigationLinks'; | ||
|
||
const NavigationBar: React.FC = () => { | ||
// STATES | ||
const [toggleSidebar, setToggleSidebar] = useState(() => false); | ||
|
||
// STATE HANDLER FUNCTION | ||
const handleOpenSidebar = () => { | ||
setToggleSidebar(!toggleSidebar); | ||
}; | ||
const handleCloseSidebar = () => { | ||
setToggleSidebar(false); | ||
}; | ||
|
||
// RENDER | ||
return ( | ||
<> | ||
<div className="FULL h-[9vh] BG-BLACK-PRIMARY FLEX-BETWEEN PADDING"> | ||
<Logo className="font-style-logo text-4xl TEXT-WHITE-PRIMARY" /> | ||
{/* Desktop Navigation Bar */} | ||
<div className="hidden FLEX-CENTER-LG gap-4"> | ||
<div className="DESKTOP-LINKS"> | ||
<ul className="TEXT-COLOR-PRIMARY FLEX-CENTER gap-6"> | ||
{NAVIGATION_LINKS.map(({ name, path }, id) => ( | ||
<li key={id} className="GRAY-300 TEXT-WHITE-PRIMARY-HOVER"> | ||
<NavLink | ||
to={path} | ||
className={({ isActive }) => | ||
isActive ? 'DESKTOP-LINKS-ACTIVE BG-WHITE-PRIMARY' : '' | ||
} | ||
> | ||
{name} | ||
</NavLink> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
<Link to="/contact-us" className="TEXT-BLACK-PRIMARY BUTTON POINTER"> | ||
Contract | ||
</Link> | ||
</div> | ||
{/* Mobile Navigation Bar */} | ||
<button | ||
className="lg:hidden MOBILE-LINKS-HOVER POINTER" | ||
onClick={handleOpenSidebar} | ||
> | ||
<HiMenuAlt3 size={30} className="TEXT-WHITE-PRIMARY" /> | ||
</button> | ||
</div> | ||
|
||
{/* Mobile Sidebar Toggle with Overlay */} | ||
<div | ||
className={`FIXED inset-0 z-50 lg:hidden transition-opacity D-300 EASE ${ | ||
toggleSidebar | ||
? 'opacity-100 pointer-events-auto' | ||
: 'opacity-0 pointer-events-none' | ||
}`} | ||
> | ||
{/* Backdrop */} | ||
<div | ||
className="ABSOLUTE inset-0 BG-BLACK-PRIMARY backdrop-blur-3xl transition-opacity D-300 EASE" | ||
onClick={handleCloseSidebar} | ||
/> | ||
|
||
{/* Sidebar */} | ||
<div | ||
className={`ABSOLUTE BORDER-LEFT-CORNER-3XL T0 R0 h-full w-80 max-w-[85vw] BG-BLACK-PRIMARY TEXT-WHITE-PRIMARY TRANSFORM D-300 EASE ${ | ||
toggleSidebar ? 'translate-x-0' : 'translate-x-full' | ||
}`} | ||
> | ||
{/* Sidebar Header */} | ||
<div className="FLEX-BETWEEN PADDING h-[9vh] border-b border-gray-500"> | ||
<Logo className="font-style-logo text-3xl TEXT-WHITE-PRIMARY" /> | ||
<button | ||
onClick={handleCloseSidebar} | ||
className="TEXT-WHITE-PRIMARY POINTER p-2 WHITE-20-HOVER rounded-xl COLORS D-300" | ||
> | ||
<HiX size={30} /> | ||
</button> | ||
</div> | ||
|
||
{/* Sidebar Content */} | ||
<div className="p-6"> | ||
{/* Navigation Links */} | ||
<nav className="mb-8"> | ||
<ul className="space-y-4"> | ||
{NAVIGATION_LINKS.map(({ name, path }, id) => ( | ||
<li key={id}> | ||
<NavLink | ||
to={path} | ||
onClick={handleCloseSidebar} | ||
className={({ isActive }) => | ||
`BLOCK px-4 py-3 rounded-xl ALL D-300 ${ | ||
isActive | ||
? 'BG-WHITE-PRIMARY TEXT-BLACK-PRIMARY SEMIBOLD' | ||
: 'TEXT-WHITE-PRIMARY WHITE-20-HOVER' | ||
}` | ||
} | ||
> | ||
{name} | ||
</NavLink> | ||
</li> | ||
))} | ||
</ul> | ||
</nav> | ||
|
||
{/* Contact Button */} | ||
<Link | ||
to="/contact-us" | ||
onClick={handleCloseSidebar} | ||
className="BLOCK FULL CENTER TEXT-BLACK-PRIMARY BUTTON POINTER TRANSFROM D-300 hover:scale-105" | ||
> | ||
Contract | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default NavigationBar; |
This file contains hidden or 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,25 @@ | ||
import React, { Suspense } from 'react'; | ||
import { Routes, Route } from 'react-router-dom'; | ||
|
||
// COMPONENTS | ||
import NavigationBar from '../General/NavigationBar/NavigationBar'; | ||
import Footer from '../General/Footer/Footer'; | ||
// UTILS | ||
import Loader from '../../utils/Loader/Loader'; | ||
|
||
const Layout: React.FC = () => { | ||
return ( | ||
<div> | ||
<NavigationBar /> | ||
<Suspense fallback={<Loader />}> | ||
<Routes> | ||
<Route path="/" element={<></>} /> | ||
</Routes> | ||
</Suspense> | ||
|
||
<Footer /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Layout; |
This file contains hidden or 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,36 @@ | ||
import type { NavigationLinkProps } from "./NavigationLinks.types"; | ||
|
||
const NAVIGATION_LINKS: NavigationLinkProps[] = [ | ||
{ | ||
id: 1, | ||
name: "Home", | ||
path: "/" | ||
}, | ||
{ | ||
id: 2, | ||
name: "AboutUs", | ||
path: "/about-us" | ||
}, | ||
{ | ||
id: 3, | ||
name: "TechStack", | ||
path: "/tech-stack" | ||
}, | ||
{ | ||
id: 4, | ||
name: "Client", | ||
path: "/client-projects" | ||
}, | ||
{ | ||
id: 5, | ||
name: "Products", | ||
path: "/products" | ||
}, | ||
{ | ||
id: 6, | ||
name: "Team", | ||
path: "/team" | ||
} | ||
]; | ||
|
||
export default NAVIGATION_LINKS; |
This file contains hidden or 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,5 @@ | ||
export type NavigationLinkProps = { | ||
id: number; | ||
name: string; | ||
path: string; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.