Skip to content

Commit

Permalink
remove EventDetail
Browse files Browse the repository at this point in the history
  • Loading branch information
ticruz38 committed Nov 15, 2024
1 parent d3631ff commit e9b8a69
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 83 deletions.
7 changes: 0 additions & 7 deletions src/app/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import ChannelsList from "src/app/views/ChannelsList.svelte"
import DataExport from "src/app/views/DataExport.svelte"
import DataImport from "src/app/views/DataImport.svelte"
import EventDetail from "src/app/views/EventDetail.svelte"
import FeedCreate from "src/app/views/FeedCreate.svelte"
import FeedEdit from "src/app/views/FeedEdit.svelte"
import FeedList from "src/app/views/FeedList.svelte"
Expand Down Expand Up @@ -113,12 +112,6 @@
},
})
router.register("/events/:address", EventDetail, {
serializers: {
address: asNaddr("address"),
},
})
router.register("/groups", GroupList)
router.register("/help/:topic", Help)
Expand Down
16 changes: 1 addition & 15 deletions src/app/shared/EventActions.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import {ctx} from "@welshman/lib"
import {Address} from "@welshman/util"
import {repository, pubkey} from "@welshman/app"
import {repository} from "@welshman/app"
import OverflowMenu from "src/partials/OverflowMenu.svelte"
import {router} from "src/app/util/router"
Expand All @@ -20,20 +20,6 @@
label: "Share",
icon: "share-nodes",
})
if (event.pubkey === $pubkey) {
actions.push({
onClick: () => router.at("events").of(address.toString()).cx({event}).at("edit").open(),
label: "Edit",
icon: "edit",
})
actions.push({
onClick: () => router.at("events").of(address.toString()).cx({event}).at("delete").open(),
label: "Delete",
icon: "trash",
})
}
}
}
</script>
Expand Down
11 changes: 3 additions & 8 deletions src/app/shared/EventInfo.svelte
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
<script lang="ts">
import cx from "classnames"
import {fromPairs} from "ramda"
import {Tags, getAddress} from "@welshman/util"
import {Tags} from "@welshman/util"
import {deriveIsDeletedByAddress} from "@welshman/store"
import {repository} from "@welshman/app"
import {secondsToDate, formatTimestamp, formatTimestampAsDate, getLocale} from "src/util/misc"
import Anchor from "src/partials/Anchor.svelte"
import Chip from "src/partials/Chip.svelte"
import PersonLink from "src/app/shared/PersonLink.svelte"
import EventActions from "src/app/shared/EventActions.svelte"
import NoteContentKind1 from "src/app/shared/NoteContentKind1.svelte"
import {router} from "src/app/util/router"
import {getSetting} from "src/engine"
export let event
export let showDate = false
export let actionsInline = false
const address = getAddress(event)
const timeFmt = new Intl.DateTimeFormat(getLocale(), {timeStyle: "short"})
const datetimeFmt = new Intl.DateTimeFormat(getLocale(), {dateStyle: "short", timeStyle: "short"})
const detailPath = router.at("events").of(address).toString()
const deleted = deriveIsDeletedByAddress(repository, event)
$: tags = Tags.fromEvent(event)
Expand All @@ -37,9 +32,9 @@
<div class="flex flex-grow flex-col gap-2">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<Anchor class={cx("text-2xl", {"line-through": $deleted})} href={detailPath}>
<div class="text-2xl" class:line-through={$deleted}>
{title || name}
</Anchor>
</div>
{#if $deleted}
<Chip danger small>Deleted</Chip>
{/if}
Expand Down
7 changes: 1 addition & 6 deletions src/app/views/Bech32Entity.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import Spinner from "src/partials/Spinner.svelte"
import NoteDetail from "src/app/views/NoteDetail.svelte"
import PersonDetail from "src/app/views/PersonDetail.svelte"
import EventDetail from "src/app/views/EventDetail.svelte"
export let entity, type, data, relays
</script>
Expand All @@ -16,11 +15,7 @@
<NoteDetail id={data} {relays} />
{:else if type === "naddr"}
{@const address = new Address(data.kind, data.pubkey, data.identifier).toString()}
{#if data.kind === 31923}
<EventDetail {address} relays={data.relays} />
{:else}
<NoteDetail {address} relays={data.relays} />
{/if}
<NoteDetail {address} relays={data.relays} />
{:else if type === "nprofile"}
<PersonDetail pubkey={data.pubkey} {relays} />
{:else if type === "npub"}
Expand Down
46 changes: 0 additions & 46 deletions src/app/views/EventDetail.svelte

This file was deleted.

3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"module": "esnext",
"target": "es2021",
"paths": {
"src/*": ["src/*"]
"src/*": ["src/*"],
// "@welshman/*": ["../welshman/packages/*/src/"]
},
"isolatedModules": true,
"noImplicitAny": false,
Expand Down
9 changes: 9 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ export default defineConfig(async () => {
resolve: {
alias: {
src: path.resolve(__dirname, "src"),
"@welshman/app": path.resolve(__dirname, "../welshman/packages/app/src/"),
"@welshman/content": path.resolve(__dirname, "../welshman/packages/content/src/"),
"@welshman/dvm": path.resolve(__dirname, "../welshman/packages/dvm/src/"),
"@welshman/feeds": path.resolve(__dirname, "../welshman/packages/feeds/src/"),
"@welshman/lib": path.resolve(__dirname, "../welshman/packages/lib/src/"),
"@welshman/net": path.resolve(__dirname, "../welshman/packages/net/src/"),
"@welshman/signer": path.resolve(__dirname, "../welshman/packages/signer/src/"),
"@welshman/store": path.resolve(__dirname, "../welshman/packages/store/src/"),
"@welshman/util": path.resolve(__dirname, "../welshman/packages/util/src/"),
},
},
plugins: [
Expand Down

0 comments on commit e9b8a69

Please sign in to comment.