-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a78a860
commit e8c491e
Showing
5 changed files
with
38 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
src/components/ProblemTile.svelte → src/components/RecursiveProblemTile.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Problem } from '@/event_helpers/problems'; | ||
import { ndk } from '@/ndk'; | ||
import { derived, get, writable } from 'svelte/store'; | ||
|
||
const _problems = get(ndk).storeSubscribe([{ kinds: [31971 as number] }], { subId: 'problems' }); | ||
|
||
export const problems = derived(_problems, ($problems) => | ||
$problems.map(Problem.fromEvent).filter((problem) => problem.isValid()) | ||
); | ||
|
||
export let selected = writable<Problem | undefined>(undefined); | ||
|
||
export let bloom = writable(false); //todo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,15 @@ | ||
<script lang="ts"> | ||
import { Problem } from '@/event_helpers/problems'; | ||
import { ndk } from '@/ndk'; | ||
import { NDKEvent } from '@nostr-dev-kit/ndk'; | ||
import type { NDKEventStore } from '@nostr-dev-kit/ndk-svelte'; | ||
import { onDestroy } from 'svelte'; | ||
import { derived } from 'svelte/store'; | ||
import MailLayout from '../layouts/MailLayout.svelte'; | ||
import MailList from '../layouts/MailList.svelte'; | ||
import * as Resizable from '$lib/components/ui/resizable'; | ||
import { selected } from '@/stores/problems'; | ||
import ProblemView from '../components/ProblemView.svelte'; | ||
import { Badge } from '@/components/ui/badge'; | ||
import Filters from '../components/Filters.svelte'; | ||
let problems: NDKEventStore<NDKEvent> | undefined; | ||
onDestroy(() => { | ||
problems?.unsubscribe(); | ||
}); | ||
problems = $ndk.storeSubscribe([{ kinds: [31971 as number] }], { subId: 'rockets' }); | ||
const validProblems = derived(problems, ($problems) => | ||
$problems.map(Problem.fromEvent).filter((problem) => problem.isValid()) | ||
); | ||
let selected: Problem; | ||
import MailList from '../layouts/MailList.svelte'; | ||
</script> | ||
|
||
<MailLayout> | ||
<div slot="list"> | ||
<MailList items={$validProblems} bloom={false} bind:selected /> | ||
</div> | ||
<div slot="problem"><ProblemView problem={selected} /></div> | ||
</MailLayout> | ||
<Resizable.PaneGroup direction="horizontal" class="h-full items-stretch overflow-hidden"> | ||
<Resizable.Pane defaultSize={30} minSize={30} maxSize={50}> | ||
<MailList></MailList> | ||
</Resizable.Pane> | ||
|
||
<Resizable.Handle withHandle /> | ||
<Resizable.Pane maxSize={85}><ProblemView problem={$selected}></ProblemView></Resizable.Pane> | ||
</Resizable.PaneGroup> |