Skip to content

Commit

Permalink
feat: add battlecharts header link
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveVodrazka committed Aug 7, 2024
1 parent 06e0f35 commit 6f1f7c1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
18 changes: 17 additions & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const navLinks = [
title: "Rewards",
link: "/rewards",
},
{
title: "Battlecharts",
link: "/battlecharts",
},
] as NavLinkProps[];

const RewardsTitle = () => (
Expand All @@ -45,6 +49,12 @@ const RewardsTitle = () => (
</div>
);

const NewTitle = ({ title }: { title: string }) => (
<div className={styles.rewardsheader}>
<div className={styles.badge}>NEW</div> {title}
</div>
);

const navLink = ({ title, link }: NavLinkProps, i: number): ReactNode => (
<NavLink
className={(p) => {
Expand All @@ -61,7 +71,13 @@ const navLink = ({ title, link }: NavLinkProps, i: number): ReactNode => (
to={link}
key={i}
>
{title === "Rewards" ? <RewardsTitle /> : title}
{title === "Rewards" ? (
<RewardsTitle />
) : title === "Battlecharts" ? (
<NewTitle title={title} />
) : (
title
)}
</NavLink>
);

Expand Down
18 changes: 15 additions & 3 deletions src/components/Header/header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@

.navlink {
color: white;
margin: 1em 1.5em;
margin: 1em 1.2em;
text-decoration: none;
font-size: 18px;
}

.active {
color: rgba(255, 255, 255, 0.6);
}

.active div {
color: rgba(255, 255, 255, 0.6);
}

.navlinkcontainer {
display: flex;
flex-flow: row;
Expand All @@ -27,13 +32,20 @@
.logo {
display: flex;
margin-right: auto;
padding-right: 4rem;
}

.rewardsheader {
display: flex;
align-items: center;
gap: 15px;
gap: 10px;
}

.badge {
background: #FAB000;
color: black;
font-size: 12px;
padding: 0 5px;
border-radius: 3px;
}

@media (max-width: 720px) {
Expand Down
1 change: 1 addition & 0 deletions src/components/Leaderboard/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const LeaderboardItem = ({ position, address, data, className }: ItemProps) => {
{data.map((v) => (
<td>{v}</td>
))}
{className === styles.user && <div className={styles.badge}>YOU</div>}
</tr>
);
};
Expand Down
12 changes: 12 additions & 0 deletions src/components/Leaderboard/leaderboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

.leaderboard tbody tr {
display: flex;
position: relative;
align-items: center;
justify-content: space-between;
padding: 12px;
Expand All @@ -40,6 +41,17 @@
border: solid 1px var(--LIGHT-GREY);
}

.badge {
background: #FAB000;
color: black;
font-size: 12px;
padding: 0 5px;
border-radius: 3px;
position: absolute;
top: -10px;
left: 9px;
}

.first {
background: #FFC640;
}
Expand Down

0 comments on commit 6f1f7c1

Please sign in to comment.