Commit 03b30d0 1 parent 499ec8a commit 03b30d0 Copy full SHA for 03b30d0
File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <article class =" event mb-medium p-medium pt-none" :class =" event.submission_type.en === 'Break' && 'break'" >
2
+ <article class =" event mb-medium p-medium pt-none" :class =" event.submission_type.en === 'Break' && 'break'" ref = " el " >
3
3
<div class =" pt-xsmall pb-2xsmall flex between" style =" margin-left : -0.75rem " >
4
4
<div v-if =" event.submission_type.en !== 'Break'" class =" badge h-fit" >
5
5
<template v-if =" ! event .submission_type .en .includes (' Workshop' )" >
46
46
</template >
47
47
48
48
<script setup lang="ts">
49
- import { format , differenceInMinutes } from ' date-fns' ;
49
+ import { format , differenceInMinutes , isWithinInterval } from ' date-fns' ;
50
50
import { renderMarkdown } from ' Content/renderContent' ;
51
- import { type PropType } from ' vue'
51
+ import { onMounted , ref , type PropType } from ' vue'
52
52
import type { PretalxEvent , Break , BreakParsed } from ' @/types/pretalx' ;
53
53
import SpeakerItem from ' ./SpeakerItem.vue'
54
54
import LinkIcon from ' ./icons/LinkIcon.vue'
@@ -71,6 +71,12 @@ const getSlug = (event: PretalxEvent) => {
71
71
return ` online-${event .title .replace (/ [ ] / g , ' -' ).replace (/ [^ a-zA-Z0-9 -] / g , ' ' ).toLowerCase ()} `
72
72
}
73
73
74
+ const el = ref (null );
75
+ const isOngoing = isWithinInterval (new Date (), { start: new Date (props .event .slot .start ), end: new Date (props .event .slot .end ) })
76
+ onMounted (() => {
77
+ if (isOngoing ) el .value ?.scrollIntoView ();
78
+ });
79
+
74
80
</script >
75
81
76
82
<style scoped>
You can’t perform that action at this time.
0 commit comments