Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dolanske committed Jul 29, 2024
1 parent 82ec095 commit fc3849d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/src/style/index.css" />
<title>C O U N T D O W N</title>
<title>Upcoming Hivecom Events</title>

<meta name="title" content="Hivecom event countdown" />
<meta
Expand Down
9 changes: 7 additions & 2 deletions src/components/Sidebar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { button, div, h2, hr, img, p } from '@dolanske/cascade'
import type { Ref } from '@vue/reactivity'
import { type Ref, computed } from '@vue/reactivity'
import type { FormattedEvent } from '../types'
import { FAKE_EVENT_TITLE } from '../data'

interface Props {
formattedEvents: Ref<FormattedEvent[]>
Expand All @@ -25,11 +26,15 @@ function setActiveHash(e: any) {
}

export const Sidebar = div().setup((ctx, props: Props) => {
const upcomingEventsString = computed(() =>
`${props.formattedEvents.value.filter(e => e.title !== FAKE_EVENT_TITLE).length} upcoming`,
)

ctx.class('sidebar')
ctx.nest([
img().attr('src', 'https://mavulp.github.io/countdown/logo.svg'),
h2('Hivecom \n countdown'),
p(`${props.formattedEvents.value.length} upcoming`),
p(upcomingEventsString),
hr(),
button('Upcoming')
.class({ active: ['#upcoming', ''].includes(window.location.hash) })
Expand Down

0 comments on commit fc3849d

Please sign in to comment.