Skip to content

Commit

Permalink
Add active routes
Browse files Browse the repository at this point in the history
  • Loading branch information
itexpert120 committed Aug 16, 2024
1 parent 0e8c361 commit e363c57
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 102 deletions.
5 changes: 5 additions & 0 deletions src/assets/icon-account.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/icon-agenda.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/icon-help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/icon-scan.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/icon-wallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 0 additions & 16 deletions src/components/icons/account.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/icons/agenda.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/icons/help.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/components/icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
export * from "./account";
export * from "./agenda";
export * from "./help";
export * from "./scan";
export * from "./wallet";
export * from "./redacted";
16 changes: 0 additions & 16 deletions src/components/icons/scan.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions src/components/icons/wallet.tsx

This file was deleted.

31 changes: 26 additions & 5 deletions src/components/ui/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { Flex, Button, Container } from "@chakra-ui/react";
import { Account, Wallet, Help, Agenda, Scan } from "../icons";
import { Flex, Button, Container, Image } from "@chakra-ui/react";
import { useLocation } from "react-router-dom";

import Help from "../../assets/icon-help.svg";
import Agenda from "../../assets/icon-agenda.svg";
import Scan from "../../assets/icon-scan.svg";
import Wallet from "../../assets/icon-wallet.svg";
import Account from "../../assets/icon-account.svg";

type Route = {
name: string;
href: string;
icon: React.FC;
icon: string;
};

const routes: Route[] = [
Expand All @@ -16,13 +22,28 @@ const routes: Route[] = [
];

export function Footer() {
const { pathname } = useLocation();
return (
<Container maxW={"container.sm"} p={0}>
<footer>
<Flex justifyContent="space-between" alignItems="center" as="nav">
{routes.map((route, index) => (
<Button as="a" key={index} href={route.href} variant="navigation">
<route.icon />
<Button
as="a"
key={index}
href={route.href}
variant="navigation"
backgroundColor={pathname === route.href ? "black" : ""}
color={pathname === route.href ? "brand.400" : "black"}
>
<Image
src={route.icon}
filter={
pathname === route.href
? "brightness(0) saturate(100%) invert(70%) sepia(28%) saturate(2698%) hue-rotate(106deg) brightness(99%) contrast(101%);"
: ""
}
/>
<span>{route.name}</span>
</Button>
))}
Expand Down

0 comments on commit e363c57

Please sign in to comment.