feat: add styles

This commit is contained in:
Alejandro Gomez
2023-06-24 14:36:46 +02:00
parent 018022689e
commit c28f927cb4
3 changed files with 25 additions and 18 deletions

View File

@ -12,7 +12,6 @@
font-weight: 600; font-weight: 600;
font-size: 24px; font-size: 24px;
line-height: 30px; line-height: 30px;
padding: 0px 0px 4px;
} }
.live-chat>.messages { .live-chat>.messages {
@ -78,29 +77,41 @@
.top-zappers h3 { .top-zappers h3 {
margin: 0; margin: 0;
text-transform: uppercase; font-size: 16px;
font-size: 12px; font-family: Outfit;
font-weight: 300; font-weight: 600;
color: #EEE;
} }
.top-zappers-container { .top-zappers-container {
display: flex; display: flex;
gap: 8px;
justify-content: space-between; justify-content: space-between;
padding-top: 12px;
padding-bottom: 20px;
border-bottom: 1px solid var(--border, #171717);
overflow-y: scroll;
} }
.top-zapper { .top-zapper {
display: flex; display: flex;
flex-direction: row; padding: 4px 8px 4px 4px;
align-items: center; align-items: center;
gap: 8px;
border-radius: 49px;
border: 1px solid var(--border, #171717);
} }
.top-zapper .top-zapper-amount { .top-zapper .top-zapper-amount {
margin: 0 8px 0 4px; font-size: 15px;
font-family: Outfit;
font-weight: 700;
line-height: 22px;
margin: 0;
} }
.top-zapper .top-zapper-name { .top-zapper .top-zapper-name {
font-size: 14px; font-size: 14px;
margin: 0;
} }
.zapper-gold-icon { .zapper-gold-icon {

View File

@ -41,7 +41,7 @@ function TopZappers({ zaps }: { zaps: ParsedZap[] }) {
const sortedZappers = useMemo(() => { const sortedZappers = useMemo(() => {
const sorted = [...new Set([...zappers])]; const sorted = [...new Set([...zappers])];
sorted.sort((a, b) => totalZapped(b, zaps) - totalZapped(a, zaps)); sorted.sort((a, b) => totalZapped(b, zaps) - totalZapped(a, zaps));
return sorted.slice(0, 3); return sorted;
}, [zappers]); }, [zappers]);
return ( return (
@ -58,15 +58,13 @@ function TopZappers({ zaps }: { zaps: ParsedZap[] }) {
: "zapper-bronze-icon"; : "zapper-bronze-icon";
return ( return (
<div className="top-zapper" key={pk}> <div className="top-zapper" key={pk}>
<Icon name="zap" className={iconClass} />
<p className="top-zapper-amount">{formatSats(total)}</p>
<div className="top-zapper-name">
{pk === "anon" ? ( {pk === "anon" ? (
<p>Anon</p> <p className="top-zapper-name">Anon</p>
) : ( ) : (
<Profile pubkey={pk} options={{ showName: false }} /> <Profile pubkey={pk} options={{ showName: false }} />
)} )}
</div> <Icon name="zap" className={iconClass} />
<p className="top-zapper-amount">{formatSats(total)}</p>
</div> </div>
); );
})} })}

View File

@ -33,9 +33,7 @@ export function Profile({
return ( return (
<div className="profile"> <div className="profile">
{(options?.showAvatar ?? true) && ( {(options?.showAvatar ?? true) && <img src={profile?.picture ?? ""} />}
<img alt={profile?.name || pubkey} src={profile?.picture ?? ""} />
)}
{(options?.showName ?? true) && {(options?.showName ?? true) &&
(options?.overrideName ?? getName(pubkey, profile))} (options?.overrideName ?? getName(pubkey, profile))}
</div> </div>