fix: tags alignment

This commit is contained in:
Alejandro Gomez
2023-07-03 14:59:29 +02:00
parent f1a705f6c9
commit 425730d12b
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 moment from "moment";
import { TaggedRawEvent } from "@snort/system"; import { TaggedRawEvent } from "@snort/system";
import { StreamState } from "index"; import { StreamState } from "index";
import { findTag } from "utils"; 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 status = findTag(ev, "status");
const start = findTag(ev, "starts"); const start = findTag(ev, "starts");
return ( return (
<div className="tags"> <div className="tags">
{children}
{status === StreamState.Planned && ( {status === StreamState.Planned && (
<span className="pill"> <span className="pill">
{status === StreamState.Planned ? "Starts " : ""} {status === StreamState.Planned ? "Starts " : ""}

View File

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