-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(events): wrap up events list mvp
- Loading branch information
Showing
25 changed files
with
684 additions
and
301 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
PUBLIC_APP_URL=http://localhost:5173 | ||
PUBLIC_SELF_HOSTED=true | ||
SECRET_PLUNK_API_KEY= | ||
SECRET_DB_DRIVER=turso | ||
SECRET_SQLITE_URL=file:./data/sqlite.db | ||
SECRET_SQLITE_KEY= |
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,4 +1,4 @@ | ||
![Logo](https://supso.co/logo.svg) | ||
![Logo](https://supso.co/logo-dark.png) | ||
|
||
# Supso | ||
|
||
|
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
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,47 @@ | ||
<script lang="ts"> | ||
import { Calendar } from '$lib/components/ui/calendar'; | ||
import * as Popover from '$lib/components/ui/popover'; | ||
import { Button } from '$lib/components/ui/button'; | ||
import { cn } from '$lib/utils'; | ||
import { CalendarIcon } from 'lucide-svelte'; | ||
import { DateFormatter, CalendarDate } from '@internationalized/date'; | ||
import { derived, type Writable } from 'svelte/store'; | ||
const df = new DateFormatter('en-US', { | ||
dateStyle: 'long' | ||
}); | ||
export let placeholder: string; | ||
export let value: Writable<string | null>; | ||
export const calendarValue = derived(value, ($value) => { | ||
if (!$value) return; | ||
const date = new Date(parseInt($value)); | ||
return new CalendarDate(date.getFullYear(), date.getMonth(), date.getDate()); | ||
}); | ||
</script> | ||
|
||
<Popover.Root> | ||
<Popover.Trigger asChild let:builder> | ||
<Button | ||
variant="outline" | ||
class={cn( | ||
'w-[180px] justify-start text-left font-normal', | ||
!$value && 'text-muted-foreground' | ||
)} | ||
builders={[builder]} | ||
> | ||
<CalendarIcon class="mr-2 h-4 w-4" /> | ||
{$value ? df.format(new Date(parseInt($value))) : placeholder} | ||
</Button> | ||
</Popover.Trigger> | ||
<Popover.Content class="w-auto p-0" align="start"> | ||
<Calendar | ||
value={$calendarValue} | ||
onValueChange={(newDate) => { | ||
if (!newDate) return value.set(null); | ||
value.set(newDate.toDate('UTC').getTime().toString()); | ||
}} | ||
class="rounded-md border shadow" | ||
/> | ||
</Popover.Content> | ||
</Popover.Root> |
This file was deleted.
Oops, something went wrong.
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,72 @@ | ||
<script lang="ts"> | ||
import { type Event } from '$lib/db/schema'; | ||
import * as Table from '$lib/components/ui/table'; | ||
import * as DropdownMenu from '$lib/components/ui/dropdown-menu'; | ||
import { Badge } from '$lib/components/ui/badge'; | ||
import { Button } from '$lib/components/ui/button'; | ||
import { CheckIcon, XIcon, MoreVerticalIcon } from 'lucide-svelte'; | ||
import { formatDate } from '$lib/format/date'; | ||
export let events: Event[]; | ||
export let hideActions: boolean = false; | ||
</script> | ||
|
||
<Table.Root> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.Head>Event</Table.Head> | ||
<Table.Head>Channel</Table.Head> | ||
<Table.Head>Notify</Table.Head> | ||
<Table.Head>Created</Table.Head> | ||
{#if !hideActions} | ||
<Table.Head class="text-right">Actions</Table.Head> | ||
{/if} | ||
</Table.Row> | ||
</Table.Header> | ||
<Table.Body> | ||
{#each events as event} | ||
<Table.Row> | ||
<Table.Cell> | ||
<a href={`/events/${event.id}`} class="flex items-center gap-2"> | ||
{#if event.emoji} | ||
<Badge variant="secondary" class="text-lg">{event.emoji}</Badge> | ||
{/if} | ||
<span>{event.event}</span> | ||
</a> | ||
</Table.Cell> | ||
<Table.Cell> | ||
<Button | ||
href={`/projects/${event.projectId}/events?channel=${event.channel}`} | ||
variant="link" | ||
class="text-foreground" | ||
> | ||
#{event.channel} | ||
</Button> | ||
</Table.Cell> | ||
<Table.Cell> | ||
{#if event.notify} | ||
<CheckIcon size={16} /> | ||
{:else} | ||
<XIcon size={16} /> | ||
{/if} | ||
</Table.Cell> | ||
<Table.Cell> | ||
{formatDate(event.createdAt ?? '')} | ||
</Table.Cell> | ||
{#if !hideActions} | ||
<Table.Cell class="flex items-center justify-end"> | ||
<DropdownMenu.Root> | ||
<DropdownMenu.Trigger> | ||
<Button size="icon" variant="secondary"><MoreVerticalIcon size={16} /></Button> | ||
</DropdownMenu.Trigger> | ||
<DropdownMenu.Content> | ||
<DropdownMenu.Item>Assign to me</DropdownMenu.Item> | ||
<DropdownMenu.Item>Delete Event</DropdownMenu.Item></DropdownMenu.Content | ||
> | ||
</DropdownMenu.Root></Table.Cell | ||
> | ||
{/if} | ||
</Table.Row> | ||
{/each} | ||
</Table.Body> | ||
</Table.Root> |
Oops, something went wrong.