Skip to content

Commit

Permalink
bring the NEW badge
Browse files Browse the repository at this point in the history
  • Loading branch information
e9x committed Mar 31, 2023
1 parent d4bfa8d commit 2ce9f50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function MenuTab({
iconFilled,
iconOutlined,
tabIndex,
isNew,
}: {
route?: string;
href?: string;
Expand All @@ -55,6 +56,7 @@ export function MenuTab({
iconFilled: ReactNode;
iconOutlined?: ReactNode;
tabIndex?: number;
isNew?: boolean;
}) {
const location = useLocation();
const selected = location.pathname === route;
Expand All @@ -66,6 +68,7 @@ export function MenuTab({
<span className={styles.name}>
<Obfuscated ellipsis>{name}</Obfuscated>
</span>
{isNew && <span className={styles.new}>new</span>}
</>
);

Expand Down
10 changes: 10 additions & 0 deletions src/styles/Navigation.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,13 @@ html[data-expanded='1'] {
}
}
}

.new {
line-height: 1em;
padding: 2px 5px;
margin-left: 5px;
border-radius: 10px;
background-color: var(--error);
color: white;
font-size: 12px;
}

0 comments on commit 2ce9f50

Please sign in to comment.