Merge pull request 'minor-fixes' (#134) from minor-fixes into main

Reviewed-on: #134
This commit is contained in:
Kieran 2024-04-19 15:56:33 +00:00
commit 890f5b2987
9 changed files with 18 additions and 15 deletions

View File

@ -42,7 +42,7 @@ export function EmojiPack({ ev }: { ev: NostrEvent }) {
} }
return ( return (
<div className="outline emoji-pack"> <div className="emoji-pack">
<div className="emoji-pack-title"> <div className="emoji-pack-title">
<h4>{name}</h4> <h4>{name}</h4>
{login?.pubkey && {login?.pubkey &&

View File

@ -18,7 +18,7 @@ export default function EventReactions({ ev }: { ev: TaggedNostrEvent }) {
const totalZaps = grouped.zaps.reduce((acc, v) => acc + v.amount, 0); const totalZaps = grouped.zaps.reduce((acc, v) => acc + v.amount, 0);
const iconClass = "flex gap-2 items-center tabular-nums cursor-pointer select-none hover:text-primary transition"; const iconClass = "flex gap-2 items-center tabular-nums cursor-pointer select-none hover:text-primary transition";
return ( return (
<div className="flex gap-4 items-center"> <div className="flex flex-wrap gap-4 mt-2 items-center">
<ZapEvent ev={ev}> <ZapEvent ev={ev}>
<div className={iconClass}> <div className={iconClass}>
<Icon name="zap-filled" /> <Icon name="zap-filled" />

View File

@ -77,7 +77,7 @@ export function LiveChat({
rb.withFilter().kinds([LIVE_STREAM_CHAT, LIVE_STREAM_RAID, LIVE_STREAM_CLIP]).tag("a", [aTag]).limit(200); rb.withFilter().kinds([LIVE_STREAM_CHAT, LIVE_STREAM_RAID, LIVE_STREAM_CLIP]).tag("a", [aTag]).limit(200);
} }
}, },
true true,
); );
const login = useLogin(); const login = useLogin();
const started = useMemo(() => { const started = useMemo(() => {

View File

@ -15,7 +15,7 @@ export default function VideoGridSorted({ evs, showAll }: { evs: Array<TaggedNos
(ev: NostrEvent) => { (ev: NostrEvent) => {
return tags.find(t => t.at(1) === getHost(ev)); return tags.find(t => t.at(1) === getHost(ev));
}, },
[tags] [tags],
); );
const { live, planned, ended } = useSortedStreams(evs, showAll ? 0 : undefined); const { live, planned, ended } = useSortedStreams(evs, showAll ? 0 : undefined);
const hashtags = getTagValues(tags, "t"); const hashtags = getTagValues(tags, "t");
@ -73,10 +73,10 @@ export default function VideoGridSorted({ evs, showAll }: { evs: Array<TaggedNos
function GridSection({ header, items }: { header: ReactNode; items: Array<TaggedNostrEvent> }) { function GridSection({ header, items }: { header: ReactNode; items: Array<TaggedNostrEvent> }) {
return ( return (
<> <>
<h2 className="flex items-center gap-4"> <div className="flex items-center gap-4">
{header} <h2 className="whitespace-nowrap">{header}</h2>
<span className="h-[1px] bg-layer-1 w-full" /> <span className="h-[1px] bg-layer-1 w-full" />
</h2> </div>
<VideoGrid> <VideoGrid>
{items.map(e => ( {items.map(e => (
<VideoTile ev={e} key={e.id} /> <VideoTile ev={e} key={e.id} />

View File

@ -2,7 +2,7 @@ import { ReactNode } from "react";
export default function VideoGrid({ children }: { children: ReactNode }) { export default function VideoGrid({ children }: { children: ReactNode }) {
return ( return (
<div className="grid gap-8 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-7 3xl:grid-cols-8"> <div className="grid gap-8 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-7 3xl:grid-cols-8 items-start">
{children} {children}
</div> </div>
); );

View File

@ -19,7 +19,7 @@ const LangSelector = new LangStore();
export function useLang() { export function useLang() {
const store = useSyncExternalStore( const store = useSyncExternalStore(
c => LangSelector.hook(c), c => LangSelector.hook(c),
() => LangSelector.snapshot() () => LangSelector.snapshot(),
); );
return { return {

View File

@ -85,7 +85,7 @@ export default function Category() {
const results = useRequestBuilder(sub); const results = useRequestBuilder(sub);
return ( return (
<div> <div>
<div className="flex gap-4"> <div className="flex flex-wrap gap-4">
{AllCategories.map(a => ( {AllCategories.map(a => (
<CategoryLink key={a.id} {...a} /> <CategoryLink key={a.id} {...a} />
))} ))}

View File

@ -25,6 +25,7 @@ export function LayoutPage() {
const login = useLogin(); const login = useLogin();
const [showLogin, setShowLogin] = useState(false); const [showLogin, setShowLogin] = useState(false);
const { lang, setLang } = useLang(); const { lang, setLang } = useLang();
const country = lang.split(/[-_]/i)[1]?.toLowerCase();
useLoginEvents(login?.pubkey, true); useLoginEvents(login?.pubkey, true);
@ -38,7 +39,7 @@ export function LayoutPage() {
menuClassName="ctx-menu" menuClassName="ctx-menu"
menuButton={ menuButton={
<div className="flex gap-2 items-center"> <div className="flex gap-2 items-center">
<div className={`fi fi-${lang.split(/[-_]/i)[1]?.toLowerCase()}`}></div> {country && <div className={`fi fi-${country}`}></div>}
<div className="uppercase pointer"> <div className="uppercase pointer">
<b>{lang.includes("-") ? lang.split("-")[0] : lang}</b> <b>{lang.includes("-") ? lang.split("-")[0] : lang}</b>
</div> </div>
@ -47,7 +48,7 @@ export function LayoutPage() {
align="end" align="end"
gap={5}> gap={5}>
{AllLocales.sort().map(l => ( {AllLocales.sort().map(l => (
<MenuItem onClick={() => setLang(l)} key={l}> <MenuItem className="capitalize" onClick={() => setLang(l)} key={l}>
{new Intl.DisplayNames([l], { {new Intl.DisplayNames([l], {
type: "language", type: "language",
}).of(l)} }).of(l)}

View File

@ -71,9 +71,11 @@ function StreamInfo({ ev, goal }: { ev?: TaggedNostrEvent; goal?: TaggedNostrEve
<StreamTimer ev={ev} /> <StreamTimer ev={ev} />
</Pill> </Pill>
)} )}
<Pill> {gameId && gameInfo && (
<GameInfoCard gameId={gameId} gameInfo={gameInfo} showImage={false} link={true} /> <Pill>
</Pill> <GameInfoCard gameId={gameId} gameInfo={gameInfo} showImage={false} link={true} />
</Pill>
)}
{ev && <Tags ev={ev} />} {ev && <Tags ev={ev} />}
</div> </div>
{isMine && ( {isMine && (