Skip to content

Commit

Permalink
problem: can't view problem event
Browse files Browse the repository at this point in the history
  • Loading branch information
gsovereignty committed Sep 19, 2024
1 parent 4b120d5 commit 700fd18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/components/ProblemPreviewCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import { Avatar, Name } from '@nostr-dev-kit/ndk-svelte-components';
import ProfileCard from './ProfileCard.svelte';
import type { Problem } from '@/event_helpers/problems';
import { devmode } from '@/stores/session';
import { Button } from '@/components/ui/button';
export let problem: Problem;
</script>

<Card.Root class="overflow-hidden rounded-lg bg-white shadow-md">
<Card.Root class="overflow-hidden rounded-lg bg-white shadow-md dark:bg-slate-800">
<Card.Content class="p-6">
<div class="mb-2 text-lg font-semibold">{problem.tldr}</div>
<HoverCard.Root>
Expand All @@ -33,6 +35,12 @@
</HoverCard.Content>
</HoverCard.Root>

<div class="text-gray-700">{problem.para}</div>
<div class="text-gray-700 dark:text-white">{problem.para}</div>
</Card.Content>
{#if $devmode}
<Card.Footer
><Button on:click={() => console.log(problem.event.rawEvent())}>Print to console</Button
></Card.Footer
>
{/if}
</Card.Root>
2 changes: 1 addition & 1 deletion src/lib/event_helpers/problems.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NDKEvent } from '@nostr-dev-kit/ndk';

export class Problem {
private readonly event: NDKEvent;
public readonly event: NDKEvent;

constructor(
event: NDKEvent,
Expand Down

0 comments on commit 700fd18

Please sign in to comment.