fix: tags alignment

This commit is contained in:
Alejandro Gomez 2023-07-03 14:59:29 +02:00
parent f1a705f6c9
commit 425730d12b
No known key found for this signature in database
GPG Key ID: 4DF39E566658C817
2 changed files with 14 additions and 3 deletions

View File

@ -1,13 +1,21 @@
import type { ReactNode } from "react";
import moment from "moment";
import { TaggedRawEvent } from "@snort/system";
import { StreamState } from "index";
import { findTag } from "utils";
export function Tags({ ev }: { ev: TaggedRawEvent }) {
export function Tags({
children,
ev,
}: {
children?: ReactNode;
ev: TaggedRawEvent;
}) {
const status = findTag(ev, "status");
const start = findTag(ev, "starts");
return (
<div className="tags">
{children}
{status === StreamState.Planned && (
<span className="pill">
{status === StreamState.Planned ? "Starts " : ""}

View File

@ -46,8 +46,11 @@ function ProfileInfo({ link }: { link: NostrLink }) {
<div className="f-grow stream-info">
<h1>{findTag(thisEvent.data, "title")}</h1>
<p>{findTag(thisEvent.data, "summary")}</p>
<StatePill state={status as StreamState} />
{thisEvent?.data && <Tags ev={thisEvent.data} />}
{thisEvent?.data && (
<Tags ev={thisEvent.data}>
<StatePill state={status as StreamState} />
</Tags>
)}
{isMine && (
<div className="actions">
{thisEvent.data && (