diff --git a/.github/workflows/deploy_api.yml b/.github/workflows/deploy_api.yml index d991a3e..979366a 100644 --- a/.github/workflows/deploy_api.yml +++ b/.github/workflows/deploy_api.yml @@ -12,6 +12,7 @@ jobs: build-and-push: name: Deploy to Fly.io runs-on: ubuntu-latest + if: github.repository == 'GRA0007/crab.fit' defaults: run: diff --git a/.github/workflows/deploy_frontend.yml b/.github/workflows/deploy_frontend.yml index 28b8624..9791cb5 100644 --- a/.github/workflows/deploy_frontend.yml +++ b/.github/workflows/deploy_frontend.yml @@ -16,6 +16,7 @@ jobs: deploy: name: Deploy to Vercel runs-on: ubuntu-latest + if: github.repository == 'GRA0007/crab.fit' defaults: run: diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json index 64e2189..8ec79a2 100644 --- a/frontend/.eslintrc.json +++ b/frontend/.eslintrc.json @@ -10,7 +10,16 @@ "react-hooks/exhaustive-deps": "off", "space-infix-ops": "warn", "comma-spacing": "warn", - "react-hooks/rules-of-hooks": "off" + "react-hooks/rules-of-hooks": "off", + "eqeqeq": "error", + "no-return-await": "warn", + "no-var": "error", + "prefer-const": "warn", + "eol-last": ["warn", "always"], + "indent": ["warn", 2], + "semi": ["error", "never"], + "arrow-parens": ["error", "as-needed"], + "jsx-quotes": ["warn", "prefer-double"] }, "overrides": [ { diff --git a/frontend/src/app/[id]/page.tsx b/frontend/src/app/[id]/page.tsx index 0090a33..a3af022 100644 --- a/frontend/src/app/[id]/page.tsx +++ b/frontend/src/app/[id]/page.tsx @@ -41,20 +41,20 @@ const Page = async ({ params }: PageProps) => {
} > - -

{event.name}

- {t('common:created', { date: relativeTimeFormat(Temporal.Instant.fromEpochSeconds(event.created_at), i18n.language) })} + +

{event.name}

+ {t('common:created', { date: relativeTimeFormat(Temporal.Instant.fromEpochSeconds(event.created_at), i18n.language) })} - - {`https://crab.fit/${event.id}`} - -

- ___ -

-
+ + {`https://crab.fit/${event.id}`} + +

+ ___ +

+
diff --git a/frontend/src/components/AvailabilityEditor/components/RecentEvents/RecentEvents.tsx b/frontend/src/components/AvailabilityEditor/components/RecentEvents/RecentEvents.tsx index 871d96d..173074b 100644 --- a/frontend/src/components/AvailabilityEditor/components/RecentEvents/RecentEvents.tsx +++ b/frontend/src/components/AvailabilityEditor/components/RecentEvents/RecentEvents.tsx @@ -22,12 +22,10 @@ const RecentEvents = ({ eventId, times, onImport }: RecentEventsProps) => { const { t, i18n } = useTranslation('event') const allRecents = useStore(useRecentsStore, state => state.recents) - const recents = useMemo(() => - allRecents - ?.filter(hasAvailability) - .filter(e => e.id !== eventId && e.user.availability.some(a => times.includes(a))) ?? [], - [allRecents] - ) + const recents = useMemo(() => allRecents + ?.filter(hasAvailability) + .filter(e => e.id !== eventId && e.user.availability.some(a => times.includes(a))) ?? [], + [allRecents]) const [isOpen, setIsOpen] = useState(false) const [selected, setSelected] = useState() diff --git a/frontend/src/components/CalendarField/components/Month/Month.tsx b/frontend/src/components/CalendarField/components/Month/Month.tsx index ed570d8..8c4b099 100644 --- a/frontend/src/components/CalendarField/components/Month/Month.tsx +++ b/frontend/src/components/CalendarField/components/Month/Month.tsx @@ -121,7 +121,7 @@ const Month = ({ value, onChange }: MonthProps) => { {hasPastDates &&
- + {t('form.dates.warnings.date_in_past')}
} diff --git a/frontend/src/components/Footer/Footer.tsx b/frontend/src/components/Footer/Footer.tsx index 7f7d690..6ceb727 100644 --- a/frontend/src/components/Footer/Footer.tsx +++ b/frontend/src/components/Footer/Footer.tsx @@ -17,19 +17,19 @@ const Footer = async ({ isSmall }: FooterProps) => { return isRunningInApp ? null // Cannot show external donation link in an Android app :
- {t('donate.info')} - -
+ id="donate" // Required to allow scrolling directly to the footer + className={makeClass(styles.footer, isSmall && styles.small)} + > + {t('donate.info')} + + } export default Footer diff --git a/frontend/src/components/ToggleField/ToggleField.tsx b/frontend/src/components/ToggleField/ToggleField.tsx index f7787b7..efef954 100644 --- a/frontend/src/components/ToggleField/ToggleField.tsx +++ b/frontend/src/components/ToggleField/ToggleField.tsx @@ -21,28 +21,28 @@ const ToggleField = ({ value, onChange, }: ToggleFieldProps) => - {/* TODO: Better description viewer */} - {label && } + {/* TODO: Better description viewer */} + {label && } -
- {Object.entries(options).map(([key, label]) => -
- onChange(key as TValue)} - onClick={() => onChange(key as TValue)} - /> - -
- )} -
-
+
+ {Object.entries(options).map(([key, label]) => +
+ onChange(key as TValue)} + onClick={() => onChange(key as TValue)} + /> + +
+ )} +
+ export default ToggleField diff --git a/frontend/src/i18n/locales/en-GB/event.json b/frontend/src/i18n/locales/en-GB/event.json index 0db3146..e784c62 100644 --- a/frontend/src/i18n/locales/en-GB/event.json +++ b/frontend/src/i18n/locales/en-GB/event.json @@ -63,6 +63,7 @@ "select_all": "Select all", "select_none": "Select none", "select_invert": "Invert selection", + "google_cal": "Sync with Google Calendar", "outlook_cal": "Sync with Outlook Calendar", "integration": { diff --git a/frontend/src/res/OutlookIcon.tsx b/frontend/src/res/OutlookIcon.tsx index 493ea99..c5b780e 100644 --- a/frontend/src/res/OutlookIcon.tsx +++ b/frontend/src/res/OutlookIcon.tsx @@ -1,20 +1,20 @@ const OutlookIcon = (props: React.ComponentProps<'svg'>) => - - - + + + - - - - - + + + + + export default OutlookIcon diff --git a/frontend/src/utils/detectBrowser.ts b/frontend/src/utils/detectBrowser.ts index 0ca620c..c20f5b3 100644 --- a/frontend/src/utils/detectBrowser.ts +++ b/frontend/src/utils/detectBrowser.ts @@ -20,6 +20,7 @@ export const detectBrowser = () => { const isChrome = !!window.chrome // Edge (based on chromium) detection + // eslint-disable-next-line eqeqeq const isEdgeChromium = isChrome && (navigator.userAgent.indexOf("Edg") != -1) if (isEdgeChromium) return 'edge_chromium'