Skip to content
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

[FEAT] COMPONENTS: Side Navigation bar (MOBILE) #105

Merged
Show file tree
Hide file tree
Changes from 113 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
726d29f
feat(HNG-5): install packages
ikennarichard Jul 19, 2024
ee54722
feat(HNG-5): add theme context
ikennarichard Jul 19, 2024
e988f00
feat(HNG-5): add the theme provider
ikennarichard Jul 19, 2024
b9949b4
feat(HNG-5): add page logo
ikennarichard Jul 19, 2024
b150df0
feat(HNG-5): add the sidebar
ikennarichard Jul 19, 2024
cc24066
feat(HNG-5): add navlink component
ikennarichard Jul 19, 2024
5e0e818
chore(HNG-5): remove unused file
ikennarichard Jul 19, 2024
98ffb65
fix(HNG-5): change text color
ikennarichard Jul 19, 2024
fd5ac86
feat(HNG-5): install inter from fontsource
ikennarichard Jul 19, 2024
ceb1e41
fix(HNG-5): change page font
ikennarichard Jul 19, 2024
0ac7b10
fix(HNG-5): fix spacing issue when menu is not expanded
ikennarichard Jul 19, 2024
feb60af
Revert "feat(HNG-5): install inter from fontsource"
ikennarichard Jul 19, 2024
291d78b
refactor(HNG-5): adjust indentation
ikennarichard Jul 19, 2024
8b04139
fix(HNG-5): fix spacing issues
ikennarichard Jul 19, 2024
8c1dbe5
refactor(HNG-5): remove inter font module
ikennarichard Jul 19, 2024
d7673fc
refactor(HNG-5): run prettier formatter
ikennarichard Jul 19, 2024
efedd18
feat(HNG-5): install packages
ikennarichard Jul 19, 2024
3cbe800
feat(HNG-5): add theme context
ikennarichard Jul 19, 2024
9c8fa16
feat(HNG-5): add the theme provider
ikennarichard Jul 19, 2024
084720e
feat(HNG-5): add page logo
ikennarichard Jul 19, 2024
ee73399
feat(HNG-5): add the sidebar
ikennarichard Jul 19, 2024
6859161
feat(HNG-5): add navlink component
ikennarichard Jul 19, 2024
2965897
chore(HNG-5): remove unused file
ikennarichard Jul 19, 2024
a985e22
fix(HNG-5): change text color
ikennarichard Jul 19, 2024
f949b1c
feat(HNG-5): install inter from fontsource
ikennarichard Jul 19, 2024
c962468
fix(HNG-5): change page font
ikennarichard Jul 19, 2024
3a87226
fix(HNG-5): fix spacing issue when menu is not expanded
ikennarichard Jul 19, 2024
ae4488f
Revert "feat(HNG-5): install inter from fontsource"
ikennarichard Jul 19, 2024
161dbdd
refactor(HNG-5): adjust indentation
ikennarichard Jul 19, 2024
e543231
fix(HNG-5): fix spacing issues
ikennarichard Jul 19, 2024
83c44f1
refactor(HNG-5): remove inter font module
ikennarichard Jul 19, 2024
0c904b4
refactor(HNG-5): run prettier formatter
ikennarichard Jul 19, 2024
9c5b3f4
Merge branch 'feat/HNG-5-create-mobile-side-navigation-bar' of https:…
ikennarichard Jul 19, 2024
3a19491
refactor(HNG-5): add toggle handler
ikennarichard Jul 19, 2024
52d4840
fix(HNG-5): use global variables
ikennarichard Jul 19, 2024
0227063
feat(HNG-5): install packages
ikennarichard Jul 19, 2024
a557129
feat(HNG-5): add theme context
ikennarichard Jul 19, 2024
534bd62
feat(HNG-5): add the theme provider
ikennarichard Jul 19, 2024
c365d17
feat(HNG-5): add page logo
ikennarichard Jul 19, 2024
e9bde3e
feat(HNG-5): add the sidebar
ikennarichard Jul 19, 2024
43e7c2b
feat(HNG-5): add navlink component
ikennarichard Jul 19, 2024
6480c37
chore(HNG-5): remove unused file
ikennarichard Jul 19, 2024
fa864ae
fix(HNG-5): change text color
ikennarichard Jul 19, 2024
0814bbb
feat(HNG-5): install inter from fontsource
ikennarichard Jul 19, 2024
e805d1a
fix(HNG-5): change page font
ikennarichard Jul 19, 2024
5eca99d
fix(HNG-5): fix spacing issue when menu is not expanded
ikennarichard Jul 19, 2024
528230c
Revert "feat(HNG-5): install inter from fontsource"
ikennarichard Jul 19, 2024
23abfef
refactor(HNG-5): adjust indentation
ikennarichard Jul 19, 2024
f36dd1b
fix(HNG-5): fix spacing issues
ikennarichard Jul 19, 2024
cf4c5a3
refactor(HNG-5): remove inter font module
ikennarichard Jul 19, 2024
de19b4f
refactor(HNG-5): run prettier formatter
ikennarichard Jul 19, 2024
6b2ccf9
feat(HNG-5): add the sidebar
ikennarichard Jul 19, 2024
5b12026
feat(HNG-5): install inter from fontsource
ikennarichard Jul 19, 2024
92f1710
fix(HNG-5): change page font
ikennarichard Jul 19, 2024
af7610e
Revert "feat(HNG-5): install inter from fontsource"
ikennarichard Jul 19, 2024
9e68e84
refactor(HNG-5): remove inter font module
ikennarichard Jul 19, 2024
e44c6b3
refactor(HNG-5): run prettier formatter
ikennarichard Jul 19, 2024
4bfdcd0
refactor(HNG-5): add toggle handler
ikennarichard Jul 19, 2024
63f6d9c
fix(HNG-5): use global variables
ikennarichard Jul 19, 2024
094f2a2
Merge branch 'feat/HNG-5-create-mobile-side-navigation-bar' of https:…
ikennarichard Jul 19, 2024
4b6eba8
refactor(HNG-5): change wrap order
ikennarichard Jul 20, 2024
dc723cd
refactor(HNG-5): remove sidebar on large screen
ikennarichard Jul 20, 2024
f232c0a
fix(HNG-5): replace pnpm with npm
ikennarichard Jul 20, 2024
5518ef7
feat(HNG-5): install inter from fontsource
ikennarichard Jul 19, 2024
ce67c7c
fix(HNG-5): change page font
ikennarichard Jul 19, 2024
4ea2253
Revert "feat(HNG-5): install inter from fontsource"
ikennarichard Jul 19, 2024
2073b85
refactor(HNG-5): remove inter font module
ikennarichard Jul 19, 2024
658a004
feat(HNG-5): install inter from fontsource
ikennarichard Jul 19, 2024
6e114a6
fix(HNG-5): change page font
ikennarichard Jul 19, 2024
f2c9293
Revert "feat(HNG-5): install inter from fontsource"
ikennarichard Jul 19, 2024
366c52e
refactor(HNG-5): remove inter font module
ikennarichard Jul 19, 2024
fbddae6
refactor(HNG-5): change wrap order
ikennarichard Jul 20, 2024
674581f
refactor(HNG-5): remove sidebar on large screen
ikennarichard Jul 20, 2024
aceab3d
fix(HNG-5): replace pnpm with npm
ikennarichard Jul 20, 2024
99bcf8f
Merge branch 'feat/HNG-5-create-mobile-side-navigation-bar' of https:…
ikennarichard Jul 20, 2024
f9c4d48
fix(HNG-5): remove package lock file
ikennarichard Jul 20, 2024
68fe7a2
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 20, 2024
0fb7916
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 20, 2024
f5aad65
chore(HNG-5): integrate base branch into my changes
ikennarichard Jul 20, 2024
52a6ddf
fix(HNG-5): resolve linting issues
ikennarichard Jul 20, 2024
b12fceb
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 20, 2024
d18a3cd
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 20, 2024
7ab8732
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
f25a110
fix(HNG-5): resolve linter issues
ikennarichard Jul 21, 2024
299e25d
chore(HNG-5): modify expanded
ikennarichard Jul 21, 2024
a84a32d
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
12e9513
refactor(HNG-5): Remove theme context
ikennarichard Jul 21, 2024
1fb2d40
feat(HNG-5): add menu button
ikennarichard Jul 21, 2024
9d071e1
feat(HNG-5): add user profile
ikennarichard Jul 21, 2024
57ba3d7
refactor(HNG-5): modify background color
ikennarichard Jul 21, 2024
26581ce
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
030225a
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
322157f
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
7734ec0
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
7219862
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
b789665
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
ddc3bfd
refactor(HNG-5): remove mobile component
ikennarichard Jul 21, 2024
84ac4f0
chore(HNG-5): remove package lock
ikennarichard Jul 21, 2024
d1d8a15
refactor(HNG-5): remove menu toggle
ikennarichard Jul 21, 2024
7a605e8
feat(HNG-5): move menu toggle to index page
ikennarichard Jul 21, 2024
5e4d9c6
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
cd71840
chore(HNG-5): fix lint issues
ikennarichard Jul 21, 2024
23e49b2
feat(HNG-5): add bg on hover
ikennarichard Jul 21, 2024
3cffcb9
chore(HNG-5): modify expanded
ikennarichard Jul 21, 2024
49751bc
chore(HNG-5): fix spacing issues
ikennarichard Jul 21, 2024
42545e1
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
854b125
fix(HNG-5): fix lint issues
ikennarichard Jul 21, 2024
e55a335
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
67e9d67
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
b8572e4
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
0f88ee1
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
c6955fd
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
4f46bf5
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
65e0b37
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
62d0f1b
chore(HNG-5): modify menu toggler
ikennarichard Jul 21, 2024
7fda2c7
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
578f674
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 21, 2024
b421fc1
Merge branch 'master' of https://github.com/ikennarichard/hng_boilerp…
ikennarichard Jul 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default function Logo({ expanded }: { expanded: boolean }) {
return (
<h1
className={`font-[500] uppercase text-primary-foreground ${
expanded
? "text-[1.25rem] leading-[1.2rem]"
: "text-[0.75rem] leading-normal"
}`}
>
logo
</h1>
);
}
17 changes: 17 additions & 0 deletions app/components/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default function Profile({ expanded }: { expanded: boolean }) {
return (
<div className={`flex items-center gap-1 ${expanded ? "ml-0" : "-ml-2"}`}>
<div className="h-[2.6875rem] w-[2.6875rem] rounded-full border-[1px] border-[#f973164d] bg-background bg-cover bg-no-repeat sm:hidden"></div>
<div
className={`${expanded ? "" : "hidden"} flex flex-col items-start justify-center`}
>
<h3 className="text-[0.875rem] font-semibold text-[#0A0A0A]">
Your Profile
</h3>
<p className="ml-[2px] text-[0.75rem] font-[500] text-[#525252]">
Login
</p>
</div>
</div>
);
}
15 changes: 15 additions & 0 deletions app/components/sidebar/menu-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Menu, X } from "lucide-react";

type MenuButtonProperties = {
IsMenuOpen: boolean;
handleToggleMenu: () => void;
};

export default function MenuButton({
IsMenuOpen,
handleToggleMenu,
}: MenuButtonProperties) {
return (
<button onClick={handleToggleMenu}>{IsMenuOpen ? <X /> : <Menu />}</button>
);
}
45 changes: 45 additions & 0 deletions app/components/sidebar/navlink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Link, useLocation } from "@remix-run/react";
import { ReactNode } from "react";

type NavlinkProperties = {
path: string;
icon: ReactNode;
text: string;
expanded: boolean;
};

export default function Navlink({
path,
icon,
text,
expanded,
}: NavlinkProperties) {
const { pathname } = useLocation();
return (
<li
className={`flex cursor-pointer items-center gap-[0.81rem] transition duration-200 ease-in-out hover:bg-[#F97316] hover:text-[#fafafa] ${
pathname === path ? "bg-[#F97316] text-[#fafafa]" : ""
} ${
expanded
? "ml-1 w-fit rounded-lg py-[0.63rem] pl-[1.25rem] pr-2"
: "ml-2 h-[3rem] w-[3rem] justify-center rounded-full"
}`}
>
<Link
className={`flex items-center justify-center ${
expanded ? "gap-3" : "gap-0"
}`}
to={path}
>
<div>{icon}</div>
<span
className={`text-[1rem] font-[500] leading-[1.2rem] ${
expanded ? "w-[8.5rem]" : "w-0 overflow-hidden"
}`}
>
{text}
</span>
</Link>
</li>
);
}
82 changes: 82 additions & 0 deletions app/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import {
Briefcase,
Building2,
Cpu,
Monitor,
SlidersHorizontal,
User,
} from "lucide-react";
import { useState } from "react";

import Profile from "../Profile";
import Navlink from "./navlink";

export default function MobileSidebarComponent() {
const [isExpanded] = useState(true);

return (
<aside
className={`fixed top-0 z-10 flex h-screen flex-col items-start gap-14 bg-background transition duration-200 ease-in-out sm:hidden ${
isExpanded ? "w-full" : "w-fit px-2"
}`}
>
<div
className={`flex w-full ${
isExpanded
? "items-center justify-between"
: "flex-col items-start justify-center gap-6"
} mt-6 px-[1.25rem]`}
>
<Profile expanded={isExpanded} />
<div
className={`flex gap-12 ${
isExpanded ? "items-center" : "flex-col items-start justify-center"
}`}
>
<span></span>
</div>
</div>

<nav>
<ul className="flex flex-col gap-[13px]">
<Navlink
path="/home"
text="Home"
icon={<User />}
expanded={isExpanded}
/>
<Navlink
path="/aboutus"
text="About us"
icon={<Building2 />}
expanded={isExpanded}
/>
<Navlink
path="/jobs"
text="Job Listing"
icon={<Briefcase />}
expanded={isExpanded}
/>
<Navlink
path="/features"
text="Features Updates"
icon={<Cpu />}
expanded={isExpanded}
/>
<Navlink
path="/blog"
text="Blog"
icon={<Monitor />}
expanded={isExpanded}
/>
<Navlink
path="/settings"
text="Settings"
icon={<SlidersHorizontal />}
expanded={isExpanded}
/>
</ul>{" "}
</nav>
</aside>
);
}
15 changes: 15 additions & 0 deletions app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { MetaFunction } from "@remix-run/node";
import { Link } from "@remix-run/react";
import { useState } from "react";

import MenuButton from "~/components/sidebar/menu-button";
import MobileSidebarComponent from "~/components/sidebar/sidebar";
import { Button } from "~/components/ui/button";
import CardPlatform from "~/components/ui/card/card-platform";
import OtpAuth from "~/components/ui/otp/OtpAuth";
Expand All @@ -20,9 +22,22 @@ const handleSubmit = (values: Input[]) => {

export default function Index() {
const [openModal, setOpenModal] = useState(false);
const [isMenuOpen, setIsMenuOpen] = useState(false);

function handleToggleMenu() {
setIsMenuOpen((previous) => !previous);
}
return (
<div className="p-4 font-sans">
<div className="fixed left-0 h-full">
{isMenuOpen && <MobileSidebarComponent />}
</div>
<div className="fixed right-5 top-10 sm:hidden">
<MenuButton
IsMenuOpen={isMenuOpen}
handleToggleMenu={handleToggleMenu}
/>
</div>
<h1 className="text-3xl">Welcome to Remix</h1>
<ul className="mt-4 list-disc space-y-2 pl-6">
<li>
Expand Down
4 changes: 4 additions & 0 deletions app/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
}
}

body {
font-family: 'Inter Variable', sans-serif;
}

@layer base {
* {
@apply border-border;
Expand Down