>
diff --git a/frontend/src/components/Legend/Legend.tsx b/frontend/src/components/Legend/Legend.tsx
index 2b4692e..6063413 100644
--- a/frontend/src/components/Legend/Legend.tsx
+++ b/frontend/src/components/Legend/Legend.tsx
@@ -15,7 +15,7 @@ interface LegendProps {
const Legend = ({ min, max, total, palette, onSegmentFocus }: LegendProps) => {
const { t } = useTranslation('event')
const highlight = useStore(useSettingsStore, state => state.highlight)
- const setHighlight = useStore(useSettingsStore, state => state.setHighlight)
+ const setHighlight = useSettingsStore(state => state.setHighlight)
return
diff --git a/frontend/src/pages-old/Help/Help.jsx b/frontend/src/pages-old/Help/Help.jsx
deleted file mode 100644
index 198fef4..0000000
--- a/frontend/src/pages-old/Help/Help.jsx
+++ /dev/null
@@ -1,101 +0,0 @@
-import { useEffect, useState } from 'react'
-import { Link, useNavigate } from 'react-router-dom'
-import { useTranslation, Trans } from 'react-i18next'
-
-import { Button, Center, Footer, AvailabilityViewer, Logo } from '/src/components'
-
-import { StyledMain, AboutSection, P, VideoWrapper, VideoLink } from '../Home/Home.styles'
-
-import { Step, FakeCalendar, FakeTimeRange, ButtonArea } from './Help.styles'
-
-import video_thumb from '/src/res/video_thumb.jpg'
-
-const Help = () => {
- const navigate = useNavigate()
- const { t } = useTranslation(['common', 'help'])
- const [videoPlay, setVideoPlay] = useState(false)
-
- useEffect(() => {
- document.title = t('help:name')
- }, [t])
-
- return <>
-
-
-
-
-
- {t('help:name')}
- {videoPlay ? (
-
-
-
- ) : (
- {
- e.preventDefault()
- setVideoPlay(true)
- }}
- >
-
- {t('common:video.button')}
-
- )}
- {t('help:p1')}
- {t('help:p2')}
-
- {t('help:s1')}
- Use the form at crab.fit to make a new event. You only need to put in the rough time period for when your event occurs here, not your availability.
- {t('help:p4')}
-
- SunMonTueWedThuFriSat
- 11121314151617
-
- {t('help:p5')}
-
-
-
-
-
- {t('help:s2')}
- {t('help:p6')}
- {t('help:p7')}
-
-
- {t('help:s3')}
- {t('help:p8')}
- {t('help:p9')}
- {t('help:p10')}
-
-
-
-
-
-
-
-
-
-
-
-
- >
-}
-
-export default Help
diff --git a/frontend/src/pages-old/Help/Help.styles.js b/frontend/src/pages-old/Help/Help.styles.js
deleted file mode 100644
index b0e4e26..0000000
--- a/frontend/src/pages-old/Help/Help.styles.js
+++ /dev/null
@@ -1,116 +0,0 @@
-import { styled } from 'goober'
-
-export const Step = styled('h2')`
- text-decoration-color: var(--primary);
- text-decoration-style: solid;
- text-decoration-line: underline;
- margin-top: 30px;
-`
-
-export const FakeCalendar = styled('div')`
- user-select: none;
-
- & div {
- display: grid;
- grid-template-columns: repeat(7, 1fr);
- grid-gap: 2px;
- }
- & .days span {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 3px 0;
- font-weight: bold;
- user-select: none;
- opacity: .7;
- @media (max-width: 350px) {
- font-size: 12px;
- }
- }
- & .dates span {
- background-color: var(--surface);
- border: 1px solid var(--primary);
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 10px 0;
-
- &.selected {
- color: #FFF;
- background-color: var(--primary);
- }
- }
- & .dates span:first-of-type {
- border-start-start-radius: 3px;
- border-end-start-radius: 3px;
- }
- & .dates span:last-of-type {
- border-end-end-radius: 3px;
- border-start-end-radius: 3px;
- }
-`
-
-export const FakeTimeRange = styled('div')`
- user-select: none;
- background-color: var(--surface);
- border: 1px solid var(--primary);
- border-radius: 3px;
- height: 50px;
- position: relative;
- margin: 38px 6px 18px;
-
- & div {
- height: calc(100% + 20px);
- width: 20px;
- border: 1px solid var(--primary);
- background-color: var(--highlight);
- border-radius: 3px;
- position: absolute;
- top: -10px;
-
- &:after {
- content: '|||';
- font-size: 8px;
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- color: var(--shadow);
- }
-
- &:before {
- content: attr(data-label);
- position: absolute;
- bottom: calc(100% + 8px);
- text-align: center;
- left: 50%;
- transform: translateX(-50%);
- }
- }
- & .start {
- left: calc(${11 * 4.166}% - 11px);
- }
- & .end {
- left: calc(${17 * 4.166}% - 11px);
- }
- &:before {
- content: '';
- position: absolute;
- height: 100%;
- left: ${11 * 4.166}%;
- right: calc(100% - ${17 * 4.166}%);
- top: 0;
- background-color: var(--primary);
- border-radius: 2px;
- }
-`
-
-export const ButtonArea = styled('div')`
- @media print {
- display: none;
- }
-`
diff --git a/frontend/src/utils/calculateColumns.ts b/frontend/src/utils/calculateColumns.ts
index b15dce2..bfd78fa 100644
--- a/frontend/src/utils/calculateColumns.ts
+++ b/frontend/src/utils/calculateColumns.ts
@@ -20,6 +20,6 @@ export const calculateColumns = (dates: Temporal.ZonedDateTime[]): (Temporal.Pla
return partitionedDates.reduce((columns, partition, i) => [
...columns,
...partition,
- ...partitionedDates.length - 1 < i ? [null] : [], // Add spacer in between partitions
+ ...i < partitionedDates.length - 1 ? [null] : [], // Add spacer in between partitions
], [] as (Temporal.PlainDate | null)[])
}
diff --git a/frontend/src/utils/calculateRows.ts b/frontend/src/utils/calculateRows.ts
index dde2e22..07ca51c 100644
--- a/frontend/src/utils/calculateRows.ts
+++ b/frontend/src/utils/calculateRows.ts
@@ -21,6 +21,6 @@ export const calculateRows = (dates: Temporal.ZonedDateTime[]): (Temporal.PlainT
...rows,
...partition,
partition[partition.length - 1].add({ minutes: 15 }),
- ...partitionedDates.length - 1 < i ? [null, null] : [], // Add spacer in between partitions
+ ...i < partitionedDates.length - 1 ? [null, null] : [], // Add spacer in between partitions
], [] as (Temporal.PlainTime | null)[])
}
diff --git a/frontend/src/utils/getWeekdayNames.ts b/frontend/src/utils/getWeekdayNames.ts
new file mode 100644
index 0000000..62f6f2a
--- /dev/null
+++ b/frontend/src/utils/getWeekdayNames.ts
@@ -0,0 +1,13 @@
+import { Temporal } from '@js-temporal/polyfill'
+
+/**
+ * Get the days of the week in a chosen locale.
+ * Note, this is brittle and will not work for additional calendars.
+ */
+export const getWeekdayNames = (locale: string, fmt: Intl.DateTimeFormatOptions['weekday'] = 'long') => {
+ // In ISO8601 (proleptic gregorian)
+ const knownMonday = Temporal.PlainDate.from({ year: 2023, month: 1, day: 2 })
+
+ return Array.from({ length: 7 })
+ .map((_, i) => knownMonday.add({ days: i }).toLocaleString(locale, { weekday: fmt }))
+}
diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts
index 509774a..5561189 100644
--- a/frontend/src/utils/index.ts
+++ b/frontend/src/utils/index.ts
@@ -5,3 +5,4 @@ export * from './convertTimesToDates'
export * from './calculateAvailability'
export * from './calculateRows'
export * from './calculateColumns'
+export * from './getWeekdayNames'