Skip to content

Commit

Permalink
adds bets icon to "My bets" button (#141)
Browse files Browse the repository at this point in the history
* adds bets icon to "My bets" button

* fix unredeemedBets number badge text color to have good contrast
  • Loading branch information
Diogomartf authored Nov 25, 2024
1 parent ca1d5fe commit bd3fa59
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { useMemo } from 'react';

import { NetworkButton } from './NetworkButton';
import { trackEvent } from 'fathom-client';
import Image from 'next/image';
import BetsIcon from '@/app/components/ui/icons/BetsIcon';

export const Navbar = () => {
const widgetEvents = useWidgetEvents();
Expand Down Expand Up @@ -61,14 +63,17 @@ export const Navbar = () => {
<div className="relative">
<Button
variant="pastel"
className="space-x-1 text-nowrap"
className="space-x-1.5 text-nowrap"
onClick={() => trackEvent(FA_EVENTS.BETS.MY_BETS)}
>
My bets
<BetsIcon className="text-text-med-em" width={16} height={16} />
<p> My bets</p>
</Button>
{hasUnredeemedBets && (
<div className="absolute -right-2 -top-1 flex size-5 items-center justify-center rounded-100 border-2 border-surface-surface-bg bg-surface-success-main p-1 text-text-white">
<p className="text-xs font-semibold">{unredeemedBetsNumber}</p>
<p className="text-xs font-semibold text-text-neutral-alt-white">
{unredeemedBetsNumber}
</p>
</div>
)}
</div>
Expand Down
26 changes: 26 additions & 0 deletions app/components/ui/icons/BetsIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
interface BetsIconProps {
className: string;
width: number;
height: number;
}

const BetsIcon = ({ className, width = 24, height = 24 }: BetsIconProps) => {
return (
<svg
width={width}
height={height}
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className={className}
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M3 3C2.44772 3 2 3.44772 2 4C2 4.55228 2.44772 5 3 5H21C21.5523 5 22 4.55228 22 4C22 3.44772 21.5523 3 21 3H3ZM20 7H4.00003V19.882C4.00003 20.6253 4.78234 21.1088 5.44724 20.7764L7.55281 19.7236C7.83434 19.5828 8.16571 19.5828 8.44724 19.7236L11.5528 21.2764C11.8343 21.4172 12.1657 21.4172 12.4472 21.2764L15.5528 19.7236C15.8343 19.5828 16.1657 19.5828 16.4472 19.7236L18.5528 20.7764C19.2177 21.1088 20 20.6253 20 19.882V7ZM8.00003 10C7.44774 10 7.00003 10.4477 7.00003 11C7.00003 11.5523 7.44774 12 8.00003 12H14C14.5523 12 15 11.5523 15 11C15 10.4477 14.5523 10 14 10H8.00003ZM8.00003 13.5C7.44774 13.5 7.00003 13.9477 7.00003 14.5C7.00003 15.0523 7.44774 15.5 8.00003 15.5H16C16.5523 15.5 17 15.0523 17 14.5C17 13.9477 16.5523 13.5 16 13.5H8.00003Z"
fill="currentColor"
/>
</svg>
);
};
export default BetsIcon;
3 changes: 3 additions & 0 deletions public/assets/icons/bets.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bd3fa59

Please sign in to comment.