Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions app/(app)/event/[naddr]/_components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,7 @@ export default function Header({ event }: { event: NDKEvent }) {
const endDate = getTagValues("end", tags)
? new Date(parseInt(getTagValues("end", tags) as string) * 1000)
: null;
const getLocation = () => {
let temp = getTagAllValues("location", tags);
if (temp[0]) {
return temp;
}
return getTagAllValues("address", tags);
};
const location = getLocation();
const location = getTagAllValues("location", tags);
const rawEvent = event.rawEvent();
const priceInBTC = parseFloat(getTagValues("price", rawEvent.tags) ?? "0");
const isMember =
Expand Down
4 changes: 1 addition & 3 deletions app/(app)/event/[naddr]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ export default function EventPage({
const { tags } = event;
const eventTagId = event.tagId();

const location = getTagAllValues("location", tags)[0]
? getTagAllValues("location", tags)
: getTagAllValues("address", tags);
const location = getTagAllValues("location", tags)
const geohash = getTagValues("g", tags);
const hosts = getTagsAllValues("p", tags)
.filter(([pubkey, relay, role]) => role === "host")
Expand Down
2 changes: 1 addition & 1 deletion app/(app)/explore/_components/CalendarCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function CalendarCard({ calendar }: CalendarCardProps) {
const image = getTagValues("image", tags);
const banner =
getTagValues("banner", tags) ?? profile?.image ?? profile?.banner ?? BANNER;
const description = content ?? getTagValues("about", tags);
const description = content ?? '';
const calendarEvents = getTagsValues("a", tags);
const calendarEventIdentifiers = calendarEvents
.filter(Boolean)
Expand Down
3 changes: 1 addition & 2 deletions components/Cards/CalendarEvent/LargeFeedCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ type LargeFeedCardProps = {
export default function LargeFeedCard({ event }: LargeFeedCardProps) {
const { tags, pubkey, content } = event;
const image = getTagValues("image", tags);
const location =
getTagValues("location", tags) ?? getTagValues("address", tags);
const location = getTagValues("location", tags);
const users = getTagsValues("p", tags).filter(Boolean);
const startDate = getTagValues("start", tags)
? new Date(parseInt(getTagValues("start", tags) as string) * 1000)
Expand Down
11 changes: 2 additions & 9 deletions components/Cards/CalendarEvent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { NostrEvent } from "@nostr-dev-kit/ndk";
import {
getTagAllValues,
getTagValues,
getTagsAllValues,
getTagsValues,
} from "@/lib/nostr/utils";
import useProfile from "@/lib/hooks/useProfile";
Expand All @@ -31,7 +32,6 @@ export default function CalendarEventCard({
const title = getTagValues("name", tags) || "Untitled";
const image =
getTagValues("image", tags) ??
getTagValues("picture", tags) ??
getTagValues("banner", tags) ??
profile?.banner;

Expand All @@ -42,14 +42,7 @@ export default function CalendarEventCard({
const endDate = getTagValues("end", tags)
? new Date(parseInt(getTagValues("end", tags) as string) * 1000)
: null;
const getLocation = () => {
let temp = getTagAllValues("location", tags);
if (temp[0]) {
return temp;
}
return getTagAllValues("address", tags);
};
const location = getLocation();
const location = getTagsAllValues("location", tags);

const users = getTagsValues("p", tags);
const hashtags = getTagsValues("t", tags);
Expand Down
1 change: 0 additions & 1 deletion components/Modals/CreateCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default function CreateCalendarEventModal() {
const tags: string[][] = [
["d", random],
["name", name],
["description", description],
["p", currentUser.pubkey, "", "host"],
];

Expand Down
7 changes: 0 additions & 7 deletions components/Modals/CreateCalendarEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export default function CreateCalendarEventModal({
const tags: string[][] = [
["d", random],
["name", title],
["description", description],
["start", toUnix(convertToTimezone(startDate, timezone)).toString()],
["end", toUnix(convertToTimezone(endDate, timezone)).toString()],
["start_tzid", timezone],
Expand All @@ -135,12 +134,6 @@ export default function CreateCalendarEventModal({
location.name,
location.address,
]);
tags.push([
"address",
`${location.name}, ${location.address}`,
location.name,
location.address,
]);
tags.push(["g", location.geohash]);
}

Expand Down
6 changes: 2 additions & 4 deletions components/SubscriptionCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ export default function SubscriptionCard({ event }: { event: NDKEvent }) {
const { tags } = event;
const rawEvent = event.rawEvent();
const title = getTagValues("title", tags) ?? getTagValues("name", tags) ?? "";
const image =
getTagValues("image", tags) ?? getTagValues("picture", tags) ?? BANNER;
const description =
getTagValues("description", tags) ?? getTagValues("summary", tags) ?? "";
const image = getTagValues("image", tags) ?? BANNER;
const description = event.content ?? "";
const delegate = getTagValues("delegate", tags);
const priceInBTC = parseFloat(getTagValues("price", rawEvent.tags) ?? "0");

Expand Down