From a83a632420d1fc6cbfb9e75a7d3201e7ebd0613c Mon Sep 17 00:00:00 2001 From: Antoine Jaussoin Date: Thu, 17 Oct 2024 20:06:49 +0100 Subject: [PATCH] Format everything --- biome.json | 9 +++- frontend/src/Theme.ts | 2 +- frontend/src/api/index.ts | 20 +++---- frontend/src/common/models.ts | 2 +- frontend/src/common/payloads.ts | 6 +-- frontend/src/crypto/__tests__/crypto.test.ts | 2 +- frontend/src/global/state.ts | 4 +- frontend/src/hooks/useFormatDate.ts | 2 +- frontend/src/hooks/useGiphy.ts | 4 +- frontend/src/hooks/useOnHover.ts | 2 +- frontend/src/hooks/useOpenClose.ts | 2 +- frontend/src/hooks/usePreviousSessions.ts | 4 +- frontend/src/hooks/useQuota.ts | 2 +- frontend/src/hooks/useStateFetch.ts | 2 +- frontend/src/state/columns.ts | 6 +-- frontend/src/stripe/get-stripe.ts | 2 +- frontend/src/track.ts | 6 +-- frontend/src/translations/i18n.ts | 4 +- frontend/src/translations/languages.ts | 2 +- frontend/src/translations/useLanguage.ts | 10 ++-- frontend/src/views/account/usePortalUrl.ts | 2 +- frontend/src/views/admin/api.ts | 2 +- .../game/__tests__/is-search-match.test.ts | 2 +- .../__tests__/partcipants-notifiers.test.ts | 2 +- .../game/board/__tests__/moving-logic.test.ts | 8 +-- .../board/__tests__/permissions-logic.test.ts | 14 ++--- .../game/board/header/useRemainingVotes.ts | 2 +- .../game/board/usePostUserPermissions.ts | 10 ++-- .../game/board/useSessionUserPermissions.ts | 4 +- frontend/src/views/game/is-search-match.ts | 4 +- .../src/views/game/summary/useMarkdown.ts | 12 ++--- frontend/src/views/game/summary/useSummary.ts | 12 ++--- frontend/src/views/game/useColumns.ts | 6 +-- frontend/src/views/game/useGame.ts | 54 +++++++++---------- frontend/src/views/game/useSession.ts | 4 +- frontend/src/views/game/useTimer.ts | 2 +- frontend/src/views/game/utils.ts | 4 +- frontend/src/views/subscribe/api.ts | 2 +- .../views/subscribe/components/useProducts.ts | 2 +- frontend/src/views/subscribe/types.ts | 2 +- .../components/Accordion/accordion.style.js | 6 +-- .../src/common/components/Accordion/index.js | 10 ++-- .../common/components/Alert/alert.style.js | 4 +- .../src/common/components/Alert/index.js | 2 +- .../src/common/components/BlogPost/index.js | 2 +- marketing/src/common/components/Box/index.js | 6 +-- marketing/src/common/components/Card/index.js | 14 ++--- .../components/Checkbox/checkbox.style.js | 2 +- .../src/common/components/Checkbox/index.js | 2 +- .../components/DatePicker/datepicker.style.js | 6 +-- .../src/common/components/DatePicker/index.js | 2 +- .../DateRangePicker/daterangepicker.style.js | 6 +-- .../components/DateRangePicker/index.js | 4 +- .../src/common/components/Dropdown/index.js | 4 +- .../FeatureBlock/featureBlock.style.js | 22 ++++---- .../common/components/FeatureBlock/index.js | 2 +- .../components/GlideCarousel/glide.style.js | 24 ++++----- .../components/GlideCarousel/glideSlide.js | 2 +- .../common/components/GlideCarousel/index.js | 4 +- .../src/common/components/Image/index.js | 2 +- .../src/common/components/InputGroup/index.js | 4 +- marketing/src/common/components/Link/index.js | 2 +- marketing/src/common/components/List/index.js | 2 +- .../src/common/components/ListGrid/index.js | 2 +- marketing/src/common/components/NoSSR.js | 2 +- .../src/common/components/Radio/index.js | 2 +- .../common/components/Radio/radio.style.js | 2 +- .../src/common/components/RadioGroup/index.js | 2 +- .../components/Range-with-RC-SLIDE/index.js | 2 +- .../Range-with-RC-SLIDE/range.style.js | 2 +- .../src/common/components/Range/index.js | 4 +- .../src/common/components/Range/range.test.js | 6 +-- .../src/common/components/Select/index.js | 2 +- .../common/components/Select/select.style.js | 2 +- .../src/common/components/Switch/index.js | 2 +- .../common/components/Switch/switch.style.js | 4 +- marketing/src/common/components/Tabs/index.js | 2 +- marketing/src/common/components/Text/index.js | 6 +-- .../src/common/components/Tooltip/index.js | 6 +-- .../components/Tooltip/tooltip.style.js | 14 ++--- marketing/src/common/components/base.js | 24 ++++----- .../src/common/components/useToggle/index.ts | 2 +- .../src/common/data/WebAppCreative/index.js | 14 ++--- marketing/src/common/hooks/useMount.js | 2 +- .../src/common/i18n/locale-for-datefns.ts | 2 +- marketing/src/lib/getBlog.ts | 4 +- marketing/src/middleware.ts | 2 +- 87 files changed, 247 insertions(+), 242 deletions(-) diff --git a/biome.json b/biome.json index 522338e82..d51fb9ed2 100644 --- a/biome.json +++ b/biome.json @@ -6,7 +6,12 @@ "ignore": ["dist/**/*", ".next/**/*"], "include": ["src/**/*.js", "src/**/*.ts"] }, - "formatter": { "enabled": true, "indentStyle": "space", "indentWidth": 2, "ignore": ["backend/src/db/migrations"] }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2, + "ignore": ["backend/src/db/migrations"] + }, "organizeImports": { "enabled": true }, "linter": { "enabled": true, @@ -22,7 +27,7 @@ "linter": { "rules": { "correctness": { - "noUndeclaredVariables": "off" + "noUndeclaredVariables": "off" } } } diff --git a/frontend/src/Theme.ts b/frontend/src/Theme.ts index 5b4b5d443..38475ef22 100644 --- a/frontend/src/Theme.ts +++ b/frontend/src/Theme.ts @@ -1,5 +1,5 @@ -import { type PaletteColorOptions, createTheme } from '@mui/material/styles'; import { colors } from '@mui/material'; +import { type PaletteColorOptions, createTheme } from '@mui/material/styles'; import config from './utils/getConfig'; const theme = createTheme({ diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 7192d1ff5..8b99b88c8 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -1,25 +1,25 @@ import type { + BackendCapabilities, + DeleteAccountPayload, + FullUser, + Product, + RegisterPayload, + ResetChangePasswordPayload, + ResetPasswordPayload, Session, - SessionTemplate, SessionMetadata, - RegisterPayload, + SessionTemplate, ValidateEmailPayload, - ResetPasswordPayload, - ResetChangePasswordPayload, - FullUser, - Product, - BackendCapabilities, - DeleteAccountPayload, } from 'common'; -import config from '../utils/getConfig'; import { v4 } from 'uuid'; import { CHECK_PREFIX, encrypt } from '../crypto/crypto'; +import config from '../utils/getConfig'; import { getItem, setItem } from '../utils/localStorage'; import { + fetchDelete, fetchGet, fetchPost, fetchPostGet, - fetchDelete, requestConfig, } from './fetch'; diff --git a/frontend/src/common/models.ts b/frontend/src/common/models.ts index 69bd2d691..712a36407 100644 --- a/frontend/src/common/models.ts +++ b/frontend/src/common/models.ts @@ -1,4 +1,4 @@ -import type { SessionOptions, Session } from './types.js'; +import type { Session, SessionOptions } from './types.js'; export const defaultOptions: SessionOptions = { allowActions: true, diff --git a/frontend/src/common/payloads.ts b/frontend/src/common/payloads.ts index de0b8d1b5..c355ef422 100644 --- a/frontend/src/common/payloads.ts +++ b/frontend/src/common/payloads.ts @@ -1,10 +1,10 @@ import type { - Plan, - Currency, - StripeLocales, AccessErrorType, CoachMessage, + Currency, + Plan, Session, + StripeLocales, } from './types.js'; export interface RegisterPayload { diff --git a/frontend/src/crypto/__tests__/crypto.test.ts b/frontend/src/crypto/__tests__/crypto.test.ts index f651c4e2b..8ff09b92f 100644 --- a/frontend/src/crypto/__tests__/crypto.test.ts +++ b/frontend/src/crypto/__tests__/crypto.test.ts @@ -1,5 +1,5 @@ -import { encrypt, decrypt } from '../crypto'; import { describe, expect, it } from 'vitest'; +import { decrypt, encrypt } from '../crypto'; describe('Cryptography', () => { it('Can encrypt and decrypt successfuly with the correct key', () => { diff --git a/frontend/src/global/state.ts b/frontend/src/global/state.ts index acb0e2c5f..b4b426213 100644 --- a/frontend/src/global/state.ts +++ b/frontend/src/global/state.ts @@ -1,6 +1,6 @@ -import { selector } from 'recoil'; -import type { BackendCapabilities } from 'common'; import { fetchBackendCapabilities } from 'api'; +import type { BackendCapabilities } from 'common'; +import { selector } from 'recoil'; const defaultBackendCapabilities: BackendCapabilities = { adminEmail: '', diff --git a/frontend/src/hooks/useFormatDate.ts b/frontend/src/hooks/useFormatDate.ts index 2a8a897c5..b341e5446 100644 --- a/frontend/src/hooks/useFormatDate.ts +++ b/frontend/src/hooks/useFormatDate.ts @@ -1,6 +1,6 @@ import { - formatDistanceToNow as formatDistanceToNowBase, type Locale, + formatDistanceToNow as formatDistanceToNowBase, } from 'date-fns'; import englishLocale from 'date-fns/locale/en-GB'; import { useEffect, useState } from 'react'; diff --git a/frontend/src/hooks/useGiphy.ts b/frontend/src/hooks/useGiphy.ts index f923e50e4..151b77b94 100644 --- a/frontend/src/hooks/useGiphy.ts +++ b/frontend/src/hooks/useGiphy.ts @@ -1,7 +1,7 @@ -import { useState, useEffect, useCallback } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { getGiphyUrl } from '../api'; -import useOriginal from './useOriginal'; import { trackEvent } from '../track'; +import useOriginal from './useOriginal'; /** * Implements logic to show or hide the Gipy Image. diff --git a/frontend/src/hooks/useOnHover.ts b/frontend/src/hooks/useOnHover.ts index 16ba8c083..2a1ebc7a7 100644 --- a/frontend/src/hooks/useOnHover.ts +++ b/frontend/src/hooks/useOnHover.ts @@ -1,4 +1,4 @@ -import { useRef, useState, useEffect } from 'react'; +import { useEffect, useRef, useState } from 'react'; export default function useOnHover(): [ boolean, diff --git a/frontend/src/hooks/useOpenClose.ts b/frontend/src/hooks/useOpenClose.ts index 743506c64..3e0adfc6b 100644 --- a/frontend/src/hooks/useOpenClose.ts +++ b/frontend/src/hooks/useOpenClose.ts @@ -1,4 +1,4 @@ -import { useState, useCallback } from 'react'; +import { useCallback, useState } from 'react'; type OpenCloseCallback = () => void; diff --git a/frontend/src/hooks/usePreviousSessions.ts b/frontend/src/hooks/usePreviousSessions.ts index f141938f2..8a665a320 100644 --- a/frontend/src/hooks/usePreviousSessions.ts +++ b/frontend/src/hooks/usePreviousSessions.ts @@ -1,7 +1,7 @@ import type { SessionMetadata } from 'common'; -import useUser from '../state/user/useUser'; +import { useCallback, useEffect, useState } from 'react'; import { fetchPreviousSessions } from '../api'; -import { useState, useEffect, useCallback } from 'react'; +import useUser from '../state/user/useUser'; let CACHE: SessionMetadata[] = []; diff --git a/frontend/src/hooks/useQuota.ts b/frontend/src/hooks/useQuota.ts index c0efb8d2f..66fd4ff0c 100644 --- a/frontend/src/hooks/useQuota.ts +++ b/frontend/src/hooks/useQuota.ts @@ -2,9 +2,9 @@ import type { Quota } from 'common'; import { useCallback, useMemo } from 'react'; import { useRecoilState } from 'recoil'; import { - quotaState, DEFAULT_QUOTA, LOCAL_STORAGE_POSTS_KEY, + quotaState, } from '../auth/QuotaManager'; import useUser from '../state/user/useUser'; import { setItem } from '../utils/localStorage'; diff --git a/frontend/src/hooks/useStateFetch.ts b/frontend/src/hooks/useStateFetch.ts index a824d73ca..ce68956c4 100644 --- a/frontend/src/hooks/useStateFetch.ts +++ b/frontend/src/hooks/useStateFetch.ts @@ -1,4 +1,4 @@ -import { useState, useEffect, type Dispatch, type SetStateAction } from 'react'; +import { type Dispatch, type SetStateAction, useEffect, useState } from 'react'; type UseStateFetchValue = [ T, diff --git a/frontend/src/state/columns.ts b/frontend/src/state/columns.ts index e36a617b2..22dce193f 100644 --- a/frontend/src/state/columns.ts +++ b/frontend/src/state/columns.ts @@ -1,9 +1,9 @@ import type { ColumnDefinition, ColumnDefinitionType } from 'common'; -import { v4 } from 'uuid'; +import isEqual from 'lodash/isEqual'; import keyBy from 'lodash/keyBy'; -import type { ColumnSettings, Template, TranslationFunction } from './types'; +import { v4 } from 'uuid'; import { getTemplateColumns } from './templates'; -import isEqual from 'lodash/isEqual'; +import type { ColumnSettings, Template, TranslationFunction } from './types'; export function buildDefaults( template: Template, diff --git a/frontend/src/stripe/get-stripe.ts b/frontend/src/stripe/get-stripe.ts index e1aa04878..503c61b73 100644 --- a/frontend/src/stripe/get-stripe.ts +++ b/frontend/src/stripe/get-stripe.ts @@ -1,4 +1,4 @@ -import { loadStripe, type Stripe } from '@stripe/stripe-js'; +import { type Stripe, loadStripe } from '@stripe/stripe-js'; import config from '../utils/getConfig'; let stripePromise: Promise; diff --git a/frontend/src/track.ts b/frontend/src/track.ts index d8ffc1fe4..d72302279 100644 --- a/frontend/src/track.ts +++ b/frontend/src/track.ts @@ -1,10 +1,10 @@ -import ReactGA from 'react-ga4'; -import type { Plan, TrackingEvent } from 'common'; import * as Sentry from '@sentry/browser'; -import config from './utils/getConfig'; +import type { Plan, TrackingEvent } from 'common'; import { isProduction } from 'is-production'; import { noop } from 'lodash'; +import ReactGA from 'react-ga4'; import type { InitOptions } from 'react-ga4/types/ga4'; +import config from './utils/getConfig'; let sentryErrorCount = 0; diff --git a/frontend/src/translations/i18n.ts b/frontend/src/translations/i18n.ts index 0d31e6f29..407e08a0c 100644 --- a/frontend/src/translations/i18n.ts +++ b/frontend/src/translations/i18n.ts @@ -1,9 +1,9 @@ import i18n, { type CallbackError } from 'i18next'; -import { initReactI18next } from 'react-i18next'; import LanguageDetector from 'i18next-browser-languagedetector'; import resourcesToBackend from 'i18next-resources-to-backend'; -import config from 'utils/getConfig'; import { isProduction } from 'is-production'; +import { initReactI18next } from 'react-i18next'; +import config from 'utils/getConfig'; i18n .use( diff --git a/frontend/src/translations/languages.ts b/frontend/src/translations/languages.ts index b7bbde4a4..a0fa0192a 100644 --- a/frontend/src/translations/languages.ts +++ b/frontend/src/translations/languages.ts @@ -1,5 +1,5 @@ -import type { Locale } from 'date-fns'; import type { StripeLocales } from 'common'; +import type { Locale } from 'date-fns'; const arDZ = () => import('date-fns/locale/ar-DZ'); const zhCN = () => import('date-fns/locale/zh-CN'); const zhTW = () => import('date-fns/locale/zh-TW'); diff --git a/frontend/src/translations/useLanguage.ts b/frontend/src/translations/useLanguage.ts index 258242ecb..cf651fc14 100644 --- a/frontend/src/translations/useLanguage.ts +++ b/frontend/src/translations/useLanguage.ts @@ -1,11 +1,11 @@ -import { useCallback, useMemo } from 'react'; -import languages, { type Language } from './languages'; -import { useTranslation } from 'react-i18next'; import { updateLanguage } from 'api'; -import { trackEvent } from 'track'; import type { TrackingEvent } from 'common'; -import useUser from 'state/user/useUser'; +import { useCallback, useMemo } from 'react'; +import { useTranslation } from 'react-i18next'; import { useSetUser } from 'state/user/useSetUser'; +import useUser from 'state/user/useUser'; +import { trackEvent } from 'track'; +import languages, { type Language } from './languages'; type UseLanguageResult = [ language: Language, diff --git a/frontend/src/views/account/usePortalUrl.ts b/frontend/src/views/account/usePortalUrl.ts index 1d776cacf..988b0353e 100644 --- a/frontend/src/views/account/usePortalUrl.ts +++ b/frontend/src/views/account/usePortalUrl.ts @@ -1,6 +1,6 @@ -import { getPortalUrl } from './api'; import { useEffect, useState } from 'react'; import useUser from '../../state/user/useUser'; +import { getPortalUrl } from './api'; export default function usePortalUrl(): string | null { const [url, setUrl] = useState(null); diff --git a/frontend/src/views/admin/api.ts b/frontend/src/views/admin/api.ts index d0255620f..7489a72f5 100644 --- a/frontend/src/views/admin/api.ts +++ b/frontend/src/views/admin/api.ts @@ -1,10 +1,10 @@ -import { fetchGet, fetchPatch, fetchPost } from '../../api/fetch'; import type { AdminChangePasswordPayload, AdminStats, FullUser, MergeUsersPayload, } from 'common'; +import { fetchGet, fetchPatch, fetchPost } from '../../api/fetch'; export async function changePassword(userId: string, password: string) { return await fetchPatch('/api/admin/user', { diff --git a/frontend/src/views/game/__tests__/is-search-match.test.ts b/frontend/src/views/game/__tests__/is-search-match.test.ts index ac9fe00dc..2e84f48c3 100644 --- a/frontend/src/views/game/__tests__/is-search-match.test.ts +++ b/frontend/src/views/game/__tests__/is-search-match.test.ts @@ -1,5 +1,5 @@ -import { searchLogic } from '../is-search-match'; import { describe, expect, it } from 'vitest'; +import { searchLogic } from '../is-search-match'; describe('Search Match logic', () => { it('Should be a match if there is no search (as everything matches)', () => { diff --git a/frontend/src/views/game/__tests__/partcipants-notifiers.test.ts b/frontend/src/views/game/__tests__/partcipants-notifiers.test.ts index c9157b0a4..d17cfcab2 100644 --- a/frontend/src/views/game/__tests__/partcipants-notifiers.test.ts +++ b/frontend/src/views/game/__tests__/partcipants-notifiers.test.ts @@ -1,10 +1,10 @@ import type { Participant } from 'common'; +import { describe, expect, it } from 'vitest'; import { getAddedParticipants, getRemovedParticipants, joinNames, } from '../participants-notifiers'; -import { describe, expect, it } from 'vitest'; function p(id: string, online = true): Participant { return { diff --git a/frontend/src/views/game/board/__tests__/moving-logic.test.ts b/frontend/src/views/game/board/__tests__/moving-logic.test.ts index b6b83c5d3..ca5ebfcd6 100644 --- a/frontend/src/views/game/board/__tests__/moving-logic.test.ts +++ b/frontend/src/views/game/board/__tests__/moving-logic.test.ts @@ -1,8 +1,8 @@ -import { getMovingEntities, calculateRank } from '../moving-logic'; -import type { ColumnContent } from '../../types'; -import type { Post, User, PostGroup } from 'common'; -import { getMiddle, getNext, getPrevious } from '../../lexorank'; +import type { Post, PostGroup, User } from 'common'; import { describe, expect, it } from 'vitest'; +import { getMiddle, getNext, getPrevious } from '../../lexorank'; +import type { ColumnContent } from '../../types'; +import { calculateRank, getMovingEntities } from '../moving-logic'; function p( id: string, diff --git a/frontend/src/views/game/board/__tests__/permissions-logic.test.ts b/frontend/src/views/game/board/__tests__/permissions-logic.test.ts index f69840a79..83cf7a736 100644 --- a/frontend/src/views/game/board/__tests__/permissions-logic.test.ts +++ b/frontend/src/views/game/board/__tests__/permissions-logic.test.ts @@ -1,19 +1,19 @@ import { - postPermissionLogic, - sessionPermissionLogic, -} from '../permissions-logic'; -import { + type BackendCapabilities, type Post, type Session, - type User, type SessionOptions, + type User, + type VoteExtract, type VoteType, defaultOptions, - type VoteExtract, - type BackendCapabilities, } from 'common'; import { v4 } from 'uuid'; import { describe, expect, it } from 'vitest'; +import { + postPermissionLogic, + sessionPermissionLogic, +} from '../permissions-logic'; const userBase: User = { photo: null, diff --git a/frontend/src/views/game/board/header/useRemainingVotes.ts b/frontend/src/views/game/board/header/useRemainingVotes.ts index 418e34adc..879a1fa2c 100644 --- a/frontend/src/views/game/board/header/useRemainingVotes.ts +++ b/frontend/src/views/game/board/header/useRemainingVotes.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react'; -import { numberOfVotes } from '../permissions-logic'; import useUser from '../../../../state/user/useUser'; import useSession from '../../useSession'; +import { numberOfVotes } from '../permissions-logic'; interface RemainingVotes { up: number | null; diff --git a/frontend/src/views/game/board/usePostUserPermissions.ts b/frontend/src/views/game/board/usePostUserPermissions.ts index 15e42ec66..cb837197e 100644 --- a/frontend/src/views/game/board/usePostUserPermissions.ts +++ b/frontend/src/views/game/board/usePostUserPermissions.ts @@ -1,12 +1,12 @@ import type { Post } from 'common'; -import { - postPermissionLogic, - type PostUserPermissions, -} from './permissions-logic'; +import useBackendCapabilities from 'global/useBackendCapabilities'; import useUser from '../../../state/user/useUser'; import useSession from '../useSession'; import { useShouldLockSession } from '../useTimer'; -import useBackendCapabilities from 'global/useBackendCapabilities'; +import { + type PostUserPermissions, + postPermissionLogic, +} from './permissions-logic'; export function usePostUserPermissions(post: Post): PostUserPermissions { const { session } = useSession(); diff --git a/frontend/src/views/game/board/useSessionUserPermissions.ts b/frontend/src/views/game/board/useSessionUserPermissions.ts index 64a2d7ca7..b87b504b2 100644 --- a/frontend/src/views/game/board/useSessionUserPermissions.ts +++ b/frontend/src/views/game/board/useSessionUserPermissions.ts @@ -1,11 +1,11 @@ -import useUser from '../../../state/user/useUser'; import useCanDecrypt from '../../../crypto/useCanDecrypt'; import useIsDisabled from '../../../hooks/useIsDisabled'; +import useUser from '../../../state/user/useUser'; import useSession from '../useSession'; import { useShouldLockSession } from '../useTimer'; import { - sessionPermissionLogic, type SessionUserPermissions, + sessionPermissionLogic, } from './permissions-logic'; export default function useSessionUserPermissions(): SessionUserPermissions { diff --git a/frontend/src/views/game/is-search-match.ts b/frontend/src/views/game/is-search-match.ts index b888e3044..f4c61ad8a 100644 --- a/frontend/src/views/game/is-search-match.ts +++ b/frontend/src/views/game/is-search-match.ts @@ -1,8 +1,8 @@ import type { Post } from 'common'; -import { postPermissionLogic } from './board/permissions-logic'; -import { useCallback } from 'react'; import useBackendCapabilities from 'global/useBackendCapabilities'; +import { useCallback } from 'react'; import useUser from 'state/user/useUser'; +import { postPermissionLogic } from './board/permissions-logic'; import useSession from './useSession'; type SearchPredicate = (post: Post) => boolean; diff --git a/frontend/src/views/game/summary/useMarkdown.ts b/frontend/src/views/game/summary/useMarkdown.ts index 7a9a0b768..c18ecceb6 100644 --- a/frontend/src/views/game/summary/useMarkdown.ts +++ b/frontend/src/views/game/summary/useMarkdown.ts @@ -1,13 +1,13 @@ -import { useMemo } from 'react'; +import { format } from 'date-fns'; import flatten from 'lodash/flatten'; -import sortedUniq from 'lodash/sortedUniq'; import sortBy from 'lodash/sortBy'; -import { format } from 'date-fns'; -import useColumns from '../useColumns'; +import sortedUniq from 'lodash/sortedUniq'; +import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import { useSummary } from './useSummary'; -import type { ColumnStatsItem, ActionItem } from './types'; +import useColumns from '../useColumns'; import useSession from '../useSession'; +import type { ActionItem, ColumnStatsItem } from './types'; +import { useSummary } from './useSummary'; export default function useMarkdown() { const { session } = useSession(); diff --git a/frontend/src/views/game/summary/useSummary.ts b/frontend/src/views/game/summary/useSummary.ts index edba55039..81cf658df 100644 --- a/frontend/src/views/game/summary/useSummary.ts +++ b/frontend/src/views/game/summary/useSummary.ts @@ -5,16 +5,16 @@ import type { Session, User, } from 'common'; -import sortBy from 'lodash/sortBy'; +import useBackendCapabilities from 'global/useBackendCapabilities'; import flattenDeep from 'lodash/flattenDeep'; -import type { ColumnContent } from '../types'; -import type { ColumnStats, ColumnStatsItem, Stats, ActionItem } from './types'; -import { countVotes, countVotesForGroup } from '../utils'; -import { postPermissionLogic } from '../board/permissions-logic'; +import sortBy from 'lodash/sortBy'; import { useMemo } from 'react'; import useUser from '../../../state/user/useUser'; +import { postPermissionLogic } from '../board/permissions-logic'; +import type { ColumnContent } from '../types'; import useSession from '../useSession'; -import useBackendCapabilities from 'global/useBackendCapabilities'; +import { countVotes, countVotesForGroup } from '../utils'; +import type { ActionItem, ColumnStats, ColumnStatsItem, Stats } from './types'; export function useSummary(columns: ColumnContent[]): Stats { const { session } = useSession(); diff --git a/frontend/src/views/game/useColumns.ts b/frontend/src/views/game/useColumns.ts index a2bd85c23..28f2a1fd6 100644 --- a/frontend/src/views/game/useColumns.ts +++ b/frontend/src/views/game/useColumns.ts @@ -1,9 +1,9 @@ -import { useMemo } from 'react'; +import type { ColumnDefinition, Post, PostGroup } from 'common'; import sortBy from 'lodash/sortBy'; +import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { ColumnContent } from './types'; import { extrapolate } from '../../state/columns'; -import type { ColumnDefinition, Post, PostGroup } from 'common'; +import type { ColumnContent } from './types'; import useSession from './useSession'; const emptyPosts: Post[] = []; diff --git a/frontend/src/views/game/useGame.ts b/frontend/src/views/game/useGame.ts index 63065a794..e73d56521 100644 --- a/frontend/src/views/game/useGame.ts +++ b/frontend/src/views/game/useGame.ts @@ -1,54 +1,54 @@ -import { useEffect, useMemo, useState, useCallback, useRef } from 'react'; import { Actions, + type AllSessionSettings, + type ChatMessagePayload, + type Message, + type Participant, type Post, type PostGroup, - type VoteType, - type Participant, + type Session, + type SessionSettings, type UnauthorizedAccessPayload, - type WsLikeUpdatePayload, - type WsPostUpdatePayload, - type WsDeletePostPayload, - type WsDeleteGroupPayload, type VoteExtract, - type WsReceiveLikeUpdatePayload, - type WsErrorPayload, + type VoteType, type WebsocketMessage, - type Session, - type WsGroupUpdatePayload, - type Message, - type WsUserReadyPayload, - type ChatMessagePayload, type WsCancelVotesPayload, + type WsDeleteGroupPayload, + type WsDeletePostPayload, + type WsErrorPayload, + type WsGroupUpdatePayload, + type WsLikeUpdatePayload, + type WsPostUpdatePayload, type WsReceiveCancelVotesPayload, + type WsReceiveLikeUpdatePayload, type WsReceiveTimerStartPayload, type WsSaveSessionSettingsPayload, - type SessionSettings, - type AllSessionSettings, + type WsUserReadyPayload, } from 'common'; -import { v4 } from 'uuid'; +import { addSeconds } from 'date-fns'; +import { isProduction } from 'is-production'; +import { omit } from 'lodash'; import find from 'lodash/find'; -import { setScope, trackAction, trackEvent } from '../../track'; +import { useSnackbar } from 'notistack'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { useSetRecoilState } from 'recoil'; import io, { type Socket } from 'socket.io-client'; +import { v4 } from 'uuid'; +import useMutableRead from '../../hooks/useMutableRead'; import { useUserMetadata } from '../../state/user/useUser'; +import { setScope, trackAction, trackEvent } from '../../track'; import { getMiddle, getNext } from './lexorank'; -import { useSnackbar } from 'notistack'; import { getAddedParticipants, getRemovedParticipants, joinNames, } from './participants-notifiers'; -import { omit } from 'lodash'; +import { TimerState } from './state'; import type { AckItem } from './types'; -import useMutableRead from '../../hooks/useMutableRead'; import useParticipants from './useParticipants'; -import useUnauthorised from './useUnauthorised'; import useSession from './useSession'; -import { useTranslation } from 'react-i18next'; -import { useSetRecoilState } from 'recoil'; -import { TimerState } from './state'; -import { addSeconds } from 'date-fns'; -import { isProduction } from 'is-production'; +import useUnauthorised from './useUnauthorised'; export type Status = /** diff --git a/frontend/src/views/game/useSession.ts b/frontend/src/views/game/useSession.ts index ca2c9a96b..5343832a3 100644 --- a/frontend/src/views/game/useSession.ts +++ b/frontend/src/views/game/useSession.ts @@ -1,10 +1,10 @@ import type { + Message, Post, PostGroup, Session, - VoteExtract, - Message, SessionSettings, + VoteExtract, } from 'common'; import { findIndex } from 'lodash'; import { useCallback } from 'react'; diff --git a/frontend/src/views/game/useTimer.ts b/frontend/src/views/game/useTimer.ts index 90fb5a4da..cddf045a2 100644 --- a/frontend/src/views/game/useTimer.ts +++ b/frontend/src/views/game/useTimer.ts @@ -1,6 +1,6 @@ import { useRecoilValue } from 'recoil'; -import { TimerState } from './state'; import { useHasRunOut } from './TimerProvider'; +import { TimerState } from './state'; import useSession from './useSession'; export function useTimer() { diff --git a/frontend/src/views/game/utils.ts b/frontend/src/views/game/utils.ts index cba7959c4..f04bf0d33 100644 --- a/frontend/src/views/game/utils.ts +++ b/frontend/src/views/game/utils.ts @@ -1,7 +1,7 @@ -import type { Post, VoteType, PostGroup } from 'common'; +import type { Post, PostGroup, VoteType } from 'common'; import groupBy from 'lodash/groupBy'; -import toPairs from 'lodash/toPairs'; import sum from 'lodash/sum'; +import toPairs from 'lodash/toPairs'; export function countVotes(post: Post, type: VoteType): number { return post.votes.filter((v) => v.type === type).length; diff --git a/frontend/src/views/subscribe/api.ts b/frontend/src/views/subscribe/api.ts index cb5ce212f..2bcfe9739 100644 --- a/frontend/src/views/subscribe/api.ts +++ b/frontend/src/views/subscribe/api.ts @@ -1,7 +1,7 @@ import type { CreateSubscriptionPayload, - Plan, Currency, + Plan, StripeLocales, } from 'common'; import { fetchGet, fetchPostGet } from '../../api/fetch'; diff --git a/frontend/src/views/subscribe/components/useProducts.ts b/frontend/src/views/subscribe/components/useProducts.ts index 5257ede29..f60b85053 100644 --- a/frontend/src/views/subscribe/components/useProducts.ts +++ b/frontend/src/views/subscribe/components/useProducts.ts @@ -1,5 +1,5 @@ -import { useEffect, useState } from 'react'; import type { Product } from 'common'; +import { useEffect, useState } from 'react'; import { getProducts } from '../../../api'; export default function useProducts(): Product[] { diff --git a/frontend/src/views/subscribe/types.ts b/frontend/src/views/subscribe/types.ts index cb16c5e93..63c66293a 100644 --- a/frontend/src/views/subscribe/types.ts +++ b/frontend/src/views/subscribe/types.ts @@ -1,4 +1,4 @@ -import type { Plan, Currency } from 'common'; +import type { Currency, Plan } from 'common'; export interface Order { plan: Plan; diff --git a/marketing/src/common/components/Accordion/accordion.style.js b/marketing/src/common/components/Accordion/accordion.style.js index d9eac059b..9b718dac9 100755 --- a/marketing/src/common/components/Accordion/accordion.style.js +++ b/marketing/src/common/components/Accordion/accordion.style.js @@ -1,11 +1,11 @@ -import styled, { keyframes } from 'styled-components'; import { - AccordionItemHeading, - AccordionItemButton, Accordion, AccordionItem, + AccordionItemButton, + AccordionItemHeading, AccordionItemPanel, } from 'react-accessible-accordion'; +import styled, { keyframes } from 'styled-components'; import 'react-accessible-accordion/dist/fancy-example.css'; const fadeIn = keyframes` diff --git a/marketing/src/common/components/Accordion/index.js b/marketing/src/common/components/Accordion/index.js index 2ad78e18e..99a4ae281 100755 --- a/marketing/src/common/components/Accordion/index.js +++ b/marketing/src/common/components/Accordion/index.js @@ -1,14 +1,14 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { - AccordionWrapper, + AccordionBodyWrapper, + AccordionItemButtonWrapper, AccordionItemWrapper, AccordionTitleWrapper, - AccordionItemButtonWrapper, - AccordionBodyWrapper, + AccordionWrapper, + CloseIcon, IconWrapper, OpenIcon, - CloseIcon, } from './accordion.style'; const Accordion = ({ diff --git a/marketing/src/common/components/Alert/alert.style.js b/marketing/src/common/components/Alert/alert.style.js index d6464f2c8..bf85f138f 100755 --- a/marketing/src/common/components/Alert/alert.style.js +++ b/marketing/src/common/components/Alert/alert.style.js @@ -1,8 +1,8 @@ +import { themeGet } from '@styled-system/theme-get'; import styled from 'styled-components'; import { variant } from 'styled-system'; -import { themeGet } from '@styled-system/theme-get'; -import { colorStyle } from '../customVariant'; import { base } from '../base'; +import { colorStyle } from '../customVariant'; const AlertStyle = styled.div` /* Alert default style */ diff --git a/marketing/src/common/components/Alert/index.js b/marketing/src/common/components/Alert/index.js index 6ee88a04a..d5945a431 100755 --- a/marketing/src/common/components/Alert/index.js +++ b/marketing/src/common/components/Alert/index.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import AlertStyle from './alert.style'; const Alert = ({ className, isMaterial, children, ...props }) => { diff --git a/marketing/src/common/components/BlogPost/index.js b/marketing/src/common/components/BlogPost/index.js index e248e96a0..f1c765a79 100755 --- a/marketing/src/common/components/BlogPost/index.js +++ b/marketing/src/common/components/BlogPost/index.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import NextImage from '../NextImage'; const BlogPost = ({ className, thumbUrl, title, excerpt, link }) => { diff --git a/marketing/src/common/components/Box/index.js b/marketing/src/common/components/Box/index.js index b288a9115..79990394b 100755 --- a/marketing/src/common/components/Box/index.js +++ b/marketing/src/common/components/Box/index.js @@ -1,10 +1,10 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import styled, { css } from 'styled-components'; import { - flexWrap, - flexDirection, alignItems, + flexDirection, + flexWrap, justifyContent, } from 'styled-system'; import { base, themed } from '../base'; diff --git a/marketing/src/common/components/Card/index.js b/marketing/src/common/components/Card/index.js index 67599fc11..ac1297dcc 100755 --- a/marketing/src/common/components/Card/index.js +++ b/marketing/src/common/components/Card/index.js @@ -1,19 +1,19 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import styled from 'styled-components'; import { - borders, - borderColor, - borderRadius, - boxShadow, backgroundImage, - backgroundSize, backgroundPosition, backgroundRepeat, + backgroundSize, + borderColor, + borderRadius, + borders, + boxShadow, opacity, } from 'styled-system'; -import { cards } from '../customVariant'; import { base, themed } from '../base'; +import { cards } from '../customVariant'; const CardWrapper = styled('div')( base, diff --git a/marketing/src/common/components/Checkbox/checkbox.style.js b/marketing/src/common/components/Checkbox/checkbox.style.js index 0811ba4cc..402cded84 100755 --- a/marketing/src/common/components/Checkbox/checkbox.style.js +++ b/marketing/src/common/components/Checkbox/checkbox.style.js @@ -1,5 +1,5 @@ -import styled from 'styled-components'; import { themeGet } from '@styled-system/theme-get'; +import styled from 'styled-components'; import { base } from '../base'; const CheckBoxStyle = styled.div` diff --git a/marketing/src/common/components/Checkbox/index.js b/marketing/src/common/components/Checkbox/index.js index fb3afd1f0..4bf5b499d 100755 --- a/marketing/src/common/components/Checkbox/index.js +++ b/marketing/src/common/components/Checkbox/index.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import useToggle from '../useToggle'; import CheckBoxStyle from './checkbox.style'; diff --git a/marketing/src/common/components/DatePicker/datepicker.style.js b/marketing/src/common/components/DatePicker/datepicker.style.js index 100c462b6..df1c0c5a0 100755 --- a/marketing/src/common/components/DatePicker/datepicker.style.js +++ b/marketing/src/common/components/DatePicker/datepicker.style.js @@ -1,10 +1,10 @@ -import styled from 'styled-components'; import { themeGet } from '@styled-system/theme-get'; +import styled from 'styled-components'; import { base } from '../base'; -import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'; -import aphroditeInterface from 'react-with-styles-interface-aphrodite'; import DefaultTheme from 'react-dates/lib/theme/DefaultTheme'; +import aphroditeInterface from 'react-with-styles-interface-aphrodite'; +import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'; ThemedStyleSheet.registerInterface(aphroditeInterface); ThemedStyleSheet.registerTheme(DefaultTheme); diff --git a/marketing/src/common/components/DatePicker/index.js b/marketing/src/common/components/DatePicker/index.js index cdb627aed..ae7bce71f 100755 --- a/marketing/src/common/components/DatePicker/index.js +++ b/marketing/src/common/components/DatePicker/index.js @@ -1,5 +1,5 @@ -import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; +import React, { Fragment, Component } from 'react'; import { SingleDatePicker } from 'react-dates'; import 'react-dates/lib/css/_datepicker.css'; import DatePickerStyle from './datepicker.style'; diff --git a/marketing/src/common/components/DateRangePicker/daterangepicker.style.js b/marketing/src/common/components/DateRangePicker/daterangepicker.style.js index 3df1dfa3a..1c841196f 100755 --- a/marketing/src/common/components/DateRangePicker/daterangepicker.style.js +++ b/marketing/src/common/components/DateRangePicker/daterangepicker.style.js @@ -1,10 +1,10 @@ -import styled from 'styled-components'; import { themeGet } from '@styled-system/theme-get'; +import styled from 'styled-components'; import { base } from '../base'; -import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'; -import aphroditeInterface from 'react-with-styles-interface-aphrodite'; import DefaultTheme from 'react-dates/lib/theme/DefaultTheme'; +import aphroditeInterface from 'react-with-styles-interface-aphrodite'; +import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'; ThemedStyleSheet.registerInterface(aphroditeInterface); ThemedStyleSheet.registerTheme(DefaultTheme); diff --git a/marketing/src/common/components/DateRangePicker/index.js b/marketing/src/common/components/DateRangePicker/index.js index 38b3cca16..faabea6ca 100755 --- a/marketing/src/common/components/DateRangePicker/index.js +++ b/marketing/src/common/components/DateRangePicker/index.js @@ -1,9 +1,9 @@ -import React, { Fragment, Component } from 'react'; import PropTypes from 'prop-types'; +import React, { Fragment, Component } from 'react'; import { DateRangePicker } from 'react-dates'; import 'react-dates/lib/css/_datepicker.css'; -import DateRangePickerStyle from './daterangepicker.style'; import moment from 'moment'; +import DateRangePickerStyle from './daterangepicker.style'; class DateRangePickerBox extends Component { constructor(props) { diff --git a/marketing/src/common/components/Dropdown/index.js b/marketing/src/common/components/Dropdown/index.js index f9f83c9d3..88a49e5f7 100755 --- a/marketing/src/common/components/Dropdown/index.js +++ b/marketing/src/common/components/Dropdown/index.js @@ -1,8 +1,8 @@ import React, { useState, useEffect } from 'react'; import { - DropdownMenuWrapper, - DropdownMenuItemsWrapper, DropdownMenuItemWrapper, + DropdownMenuItemsWrapper, + DropdownMenuWrapper, } from './dropdown.style'; const DropdownMenu = (props) => { diff --git a/marketing/src/common/components/FeatureBlock/featureBlock.style.js b/marketing/src/common/components/FeatureBlock/featureBlock.style.js index 5682efdf0..793bdad3e 100755 --- a/marketing/src/common/components/FeatureBlock/featureBlock.style.js +++ b/marketing/src/common/components/FeatureBlock/featureBlock.style.js @@ -1,22 +1,22 @@ import styled from 'styled-components'; import { - color, - width, - height, - display, - space, - borders, + alignItems, borderColor, - boxShadow, borderRadius, + borders, + boxShadow, + color, + display, + flexDirection, flexWrap, - alignItems, + fontSize, + height, justifyContent, - flexDirection, - position, overflow, - fontSize, + position, + space, textAlign, + width, } from 'styled-system'; // FeatureBlock wrapper style diff --git a/marketing/src/common/components/FeatureBlock/index.js b/marketing/src/common/components/FeatureBlock/index.js index 9c505f87b..ad3909f11 100755 --- a/marketing/src/common/components/FeatureBlock/index.js +++ b/marketing/src/common/components/FeatureBlock/index.js @@ -1,5 +1,5 @@ -import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; +import React, { Fragment } from 'react'; import FeatureBlockWrapper, { IconWrapper, ContentWrapper, diff --git a/marketing/src/common/components/GlideCarousel/glide.style.js b/marketing/src/common/components/GlideCarousel/glide.style.js index 91a2f4cad..5969b4864 100755 --- a/marketing/src/common/components/GlideCarousel/glide.style.js +++ b/marketing/src/common/components/GlideCarousel/glide.style.js @@ -1,21 +1,21 @@ import styled from 'styled-components'; import { - width, - height, - display, - space, - color, + alignItems, + borderRadius, borders, + bottom, boxShadow, - borderRadius, - position, - top, + color, + display, + flexWrap, + height, + justifyContent, left, + position, right, - bottom, - alignItems, - justifyContent, - flexWrap, + space, + top, + width, } from 'styled-system'; // Glide wrapper style diff --git a/marketing/src/common/components/GlideCarousel/glideSlide.js b/marketing/src/common/components/GlideCarousel/glideSlide.js index a0f93b4b2..40b9f7ac4 100755 --- a/marketing/src/common/components/GlideCarousel/glideSlide.js +++ b/marketing/src/common/components/GlideCarousel/glideSlide.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { GlideSlideWrapper } from './glide.style'; // Glide Slide wrapper component diff --git a/marketing/src/common/components/GlideCarousel/index.js b/marketing/src/common/components/GlideCarousel/index.js index 7e56d2fc8..4c746d6ac 100755 --- a/marketing/src/common/components/GlideCarousel/index.js +++ b/marketing/src/common/components/GlideCarousel/index.js @@ -1,6 +1,6 @@ -import React, { Fragment, useEffect } from 'react'; -import PropTypes from 'prop-types'; import Glide from '@glidejs/glide'; +import PropTypes from 'prop-types'; +import React, { Fragment, useEffect } from 'react'; import '@glidejs/glide/dist/css/glide.core.min.css'; import GlideWrapper, { diff --git a/marketing/src/common/components/Image/index.js b/marketing/src/common/components/Image/index.js index 69e65c5fe..37ea7431e 100755 --- a/marketing/src/common/components/Image/index.js +++ b/marketing/src/common/components/Image/index.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import styled from 'styled-components'; import { base, themed } from '../base'; diff --git a/marketing/src/common/components/InputGroup/index.js b/marketing/src/common/components/InputGroup/index.js index 5ae9b33f5..00cbb77d5 100755 --- a/marketing/src/common/components/InputGroup/index.js +++ b/marketing/src/common/components/InputGroup/index.js @@ -1,6 +1,6 @@ -import React, { useState, useRef } from 'react'; -import PropTypes from 'prop-types'; import useOnClickOutside from 'common/hooks/useOnClickOutside'; +import PropTypes from 'prop-types'; +import React, { useState, useRef } from 'react'; import ComponentWrapper, { Input, SelectWrapper, diff --git a/marketing/src/common/components/Link/index.js b/marketing/src/common/components/Link/index.js index dabafeff6..625f94847 100755 --- a/marketing/src/common/components/Link/index.js +++ b/marketing/src/common/components/Link/index.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import styled from 'styled-components'; import { base, themed } from '../base'; diff --git a/marketing/src/common/components/List/index.js b/marketing/src/common/components/List/index.js index 8a76b2d60..228dad9bb 100755 --- a/marketing/src/common/components/List/index.js +++ b/marketing/src/common/components/List/index.js @@ -1,5 +1,5 @@ -import React, { Fragment } from 'react'; import Link from 'next/link'; +import React, { Fragment } from 'react'; import { ListWrapper } from './list.style'; const List = ({ className, icon, text, link, ...props }) => ( diff --git a/marketing/src/common/components/ListGrid/index.js b/marketing/src/common/components/ListGrid/index.js index 4a9f6f2fd..1b400e6ac 100755 --- a/marketing/src/common/components/ListGrid/index.js +++ b/marketing/src/common/components/ListGrid/index.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import Box from '../Box'; import Button from '../Button'; import Loader from '../Loader'; diff --git a/marketing/src/common/components/NoSSR.js b/marketing/src/common/components/NoSSR.js index e34c739b3..3326a98fd 100755 --- a/marketing/src/common/components/NoSSR.js +++ b/marketing/src/common/components/NoSSR.js @@ -1,5 +1,5 @@ -import { Fragment } from 'react'; import dynamic from 'next/dynamic'; +import { Fragment } from 'react'; const NoSSR = ({ children }) => children; diff --git a/marketing/src/common/components/Radio/index.js b/marketing/src/common/components/Radio/index.js index af6ce25da..28e01ea42 100755 --- a/marketing/src/common/components/Radio/index.js +++ b/marketing/src/common/components/Radio/index.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import { useToggle } from '../useToggle'; import RadioBoxStyle from './radio.style'; diff --git a/marketing/src/common/components/Radio/radio.style.js b/marketing/src/common/components/Radio/radio.style.js index f7bd73db4..857952c6b 100755 --- a/marketing/src/common/components/Radio/radio.style.js +++ b/marketing/src/common/components/Radio/radio.style.js @@ -1,5 +1,5 @@ -import styled from 'styled-components'; import { themeGet } from '@styled-system/theme-get'; +import styled from 'styled-components'; import { base } from '../base'; const RadioBoxStyle = styled.div` diff --git a/marketing/src/common/components/RadioGroup/index.js b/marketing/src/common/components/RadioGroup/index.js index 2e1deb94d..682b83f5e 100755 --- a/marketing/src/common/components/RadioGroup/index.js +++ b/marketing/src/common/components/RadioGroup/index.js @@ -1,5 +1,5 @@ -import React, { useState } from 'react'; import PropTypes from 'prop-types'; +import React, { useState } from 'react'; import ComponentWrapper from './radioGroup.style'; const RadioGroup = ({ className, name, value, items, onUpdate }) => { diff --git a/marketing/src/common/components/Range-with-RC-SLIDE/index.js b/marketing/src/common/components/Range-with-RC-SLIDE/index.js index 38bc2adea..bda2fd4c5 100755 --- a/marketing/src/common/components/Range-with-RC-SLIDE/index.js +++ b/marketing/src/common/components/Range-with-RC-SLIDE/index.js @@ -1,7 +1,7 @@ -import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import Slider from 'rc-slider'; import Tooltip from 'rc-tooltip'; +import React, { Fragment } from 'react'; import 'rc-slider/assets/index.css'; import RangeBoxStyle from './range.style'; diff --git a/marketing/src/common/components/Range-with-RC-SLIDE/range.style.js b/marketing/src/common/components/Range-with-RC-SLIDE/range.style.js index 2890e8c76..027fbcb99 100755 --- a/marketing/src/common/components/Range-with-RC-SLIDE/range.style.js +++ b/marketing/src/common/components/Range-with-RC-SLIDE/range.style.js @@ -1,5 +1,5 @@ -import styled from 'styled-components'; import { themeGet } from '@styled-system/theme-get'; +import styled from 'styled-components'; import { base } from '../base'; const RangeBoxStyle = styled.div``; diff --git a/marketing/src/common/components/Range/index.js b/marketing/src/common/components/Range/index.js index 3fec5f6bb..7528b1a71 100755 --- a/marketing/src/common/components/Range/index.js +++ b/marketing/src/common/components/Range/index.js @@ -1,7 +1,7 @@ -import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; -import RangeBoxStyle from './range.style'; +import React, { Fragment } from 'react'; import Rheostat from 'rheostat'; +import RangeBoxStyle from './range.style'; import 'rheostat/initialize'; const handleChange = (props) => { diff --git a/marketing/src/common/components/Range/range.test.js b/marketing/src/common/components/Range/range.test.js index 673c14142..9ee6aa229 100755 --- a/marketing/src/common/components/Range/range.test.js +++ b/marketing/src/common/components/Range/range.test.js @@ -1,10 +1,10 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; import { expect } from 'chai'; import { shallow } from 'enzyme'; +import { string } from 'postcss-selector-parser'; +import React from 'react'; +import ReactDOM from 'react-dom'; import sinon from 'sinon'; import RangeBox from './index'; -import { string } from 'postcss-selector-parser'; describe(' Component', () => { // const minProps = { diff --git a/marketing/src/common/components/Select/index.js b/marketing/src/common/components/Select/index.js index 5395cb6ac..d58b4f5db 100755 --- a/marketing/src/common/components/Select/index.js +++ b/marketing/src/common/components/Select/index.js @@ -1,6 +1,6 @@ +import PropTypes from 'prop-types'; import React from 'react'; import ReactSelect from 'react-select'; -import PropTypes from 'prop-types'; import SelectStyle from './select.style'; const Select = ({ className, labelText, labelPosition, ...props }) => { diff --git a/marketing/src/common/components/Select/select.style.js b/marketing/src/common/components/Select/select.style.js index 47b313f8a..d29ad643f 100755 --- a/marketing/src/common/components/Select/select.style.js +++ b/marketing/src/common/components/Select/select.style.js @@ -1,5 +1,5 @@ -import styled from 'styled-components'; import { themeGet } from '@styled-system/theme-get'; +import styled from 'styled-components'; const SelectStyle = styled.div` /* Select label default style */ diff --git a/marketing/src/common/components/Switch/index.js b/marketing/src/common/components/Switch/index.js index b183e3946..2a524e7b4 100755 --- a/marketing/src/common/components/Switch/index.js +++ b/marketing/src/common/components/Switch/index.js @@ -1,5 +1,5 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import useToggle from '../useToggle'; import SwitchStyle from './switch.style'; diff --git a/marketing/src/common/components/Switch/switch.style.js b/marketing/src/common/components/Switch/switch.style.js index 570504b02..d413b81ad 100755 --- a/marketing/src/common/components/Switch/switch.style.js +++ b/marketing/src/common/components/Switch/switch.style.js @@ -1,7 +1,7 @@ -import styled from 'styled-components'; import { themeGet } from '@styled-system/theme-get'; -import { lightenColor } from '../lightenDarken'; +import styled from 'styled-components'; import { base } from '../base'; +import { lightenColor } from '../lightenDarken'; const SwitchStyle = styled.div` /* Switch default style */ diff --git a/marketing/src/common/components/Tabs/index.js b/marketing/src/common/components/Tabs/index.js index 7d65bfaf7..552359213 100755 --- a/marketing/src/common/components/Tabs/index.js +++ b/marketing/src/common/components/Tabs/index.js @@ -1,5 +1,5 @@ -import React, { useState } from 'react'; import PropTypes from 'prop-types'; +import React, { useState } from 'react'; import TabWrapper, { TabMenu, MenuItem, diff --git a/marketing/src/common/components/Text/index.js b/marketing/src/common/components/Text/index.js index c3614b2df..9e50451e1 100755 --- a/marketing/src/common/components/Text/index.js +++ b/marketing/src/common/components/Text/index.js @@ -1,12 +1,12 @@ -import React from 'react'; import PropTypes from 'prop-types'; +import React from 'react'; import styled from 'styled-components'; import { fontFamily, fontWeight, - textAlign, - lineHeight, letterSpacing, + lineHeight, + textAlign, } from 'styled-system'; import { base, themed } from '../base'; diff --git a/marketing/src/common/components/Tooltip/index.js b/marketing/src/common/components/Tooltip/index.js index d42c583f6..0783abf4c 100755 --- a/marketing/src/common/components/Tooltip/index.js +++ b/marketing/src/common/components/Tooltip/index.js @@ -1,10 +1,10 @@ -import React, { useState } from 'react'; import PropTypes from 'prop-types'; +import React, { useState } from 'react'; import { - TooltipStyle, - TriggerStyle, BubbleSize, BubbleStyle, + TooltipStyle, + TriggerStyle, } from './tooltip.style'; const Tooltip = ({ diff --git a/marketing/src/common/components/Tooltip/tooltip.style.js b/marketing/src/common/components/Tooltip/tooltip.style.js index e55bbe62e..627ae4366 100755 --- a/marketing/src/common/components/Tooltip/tooltip.style.js +++ b/marketing/src/common/components/Tooltip/tooltip.style.js @@ -1,17 +1,17 @@ import styled from 'styled-components'; import { - fontSize, - fontWeight, + borderRadius, boxShadow, color, - space, - borderRadius, - width, - maxWidth, - minWidth, + fontSize, + fontWeight, height, maxHeight, + maxWidth, minHeight, + minWidth, + space, + width, } from 'styled-system'; const TooltipStyle = styled.span` diff --git a/marketing/src/common/components/base.js b/marketing/src/common/components/base.js index 71a64ace1..49c5bea0a 100755 --- a/marketing/src/common/components/base.js +++ b/marketing/src/common/components/base.js @@ -1,21 +1,21 @@ /** this is our Base Component every components must be Extend it */ import { - space, - borders, + alignSelf, borderColor, - width, - minWidth, - maxWidth, - height, - minHeight, - maxHeight, + borders, + color, + compose, display, - fontSize, flex, + fontSize, + height, + maxHeight, + maxWidth, + minHeight, + minWidth, order, - alignSelf, - color, - compose, + space, + width, } from 'styled-system'; export const themed = (key) => (props) => props.theme[key]; diff --git a/marketing/src/common/components/useToggle/index.ts b/marketing/src/common/components/useToggle/index.ts index 6ea9e84a6..5b80b1ad9 100755 --- a/marketing/src/common/components/useToggle/index.ts +++ b/marketing/src/common/components/useToggle/index.ts @@ -1,4 +1,4 @@ -import { useState, useCallback } from 'react'; +import { useCallback, useState } from 'react'; export default function useToggle(initialValue: boolean) { const [value, setValue] = useState(initialValue); diff --git a/marketing/src/common/data/WebAppCreative/index.js b/marketing/src/common/data/WebAppCreative/index.js index 0c70fdb27..caa5dce59 100755 --- a/marketing/src/common/data/WebAppCreative/index.js +++ b/marketing/src/common/data/WebAppCreative/index.js @@ -13,27 +13,27 @@ import icon6 from '@/common/assets/image/webAppCreative/icons/6.png'; import icon7 from '@/common/assets/image/webAppCreative/icons/7.png'; import asana from '@/common/assets/image/webAppCreative/icons/asana.png'; +import donut from '@/common/assets/image/webAppCreative/icons/donut.png'; +import dribbble from '@/common/assets/image/webAppCreative/icons/dribbble.png'; import drive from '@/common/assets/image/webAppCreative/icons/drive.png'; import dropbox from '@/common/assets/image/webAppCreative/icons/dropbox.png'; +import facebook from '@/common/assets/image/webAppCreative/icons/facebook.png'; import fontAwesome from '@/common/assets/image/webAppCreative/icons/fontawesome.png'; import github from '@/common/assets/image/webAppCreative/icons/github.png'; import googleCloud from '@/common/assets/image/webAppCreative/icons/google-cloud.png'; +import icecream from '@/common/assets/image/webAppCreative/icons/icecream.png'; import messenger from '@/common/assets/image/webAppCreative/icons/messenger.png'; import nginx from '@/common/assets/image/webAppCreative/icons/nginx.png'; +import pizza from '@/common/assets/image/webAppCreative/icons/pizza.png'; import slack2 from '@/common/assets/image/webAppCreative/icons/slack.png'; import smashingMag from '@/common/assets/image/webAppCreative/icons/smashing-mag.png'; +import twitter from '@/common/assets/image/webAppCreative/icons/twitter.png'; import zeplin from '@/common/assets/image/webAppCreative/icons/zeplin.png'; import zoom from '@/common/assets/image/webAppCreative/icons/zoom.png'; -import icecream from '@/common/assets/image/webAppCreative/icons/icecream.png'; -import donut from '@/common/assets/image/webAppCreative/icons/donut.png'; -import pizza from '@/common/assets/image/webAppCreative/icons/pizza.png'; +import siteLogo from '@/common/assets/image/webAppCreative/logo.png'; import post1 from '@/common/assets/image/webAppCreative/post1.png'; import post2 from '@/common/assets/image/webAppCreative/post2.png'; import post3 from '@/common/assets/image/webAppCreative/post3.png'; -import siteLogo from '@/common/assets/image/webAppCreative/logo.png'; -import facebook from '@/common/assets/image/webAppCreative/icons/facebook.png'; -import twitter from '@/common/assets/image/webAppCreative/icons/twitter.png'; -import dribbble from '@/common/assets/image/webAppCreative/icons/dribbble.png'; export const clients = [envato, evernote, forbes, geekwire, slack, usaToday]; diff --git a/marketing/src/common/hooks/useMount.js b/marketing/src/common/hooks/useMount.js index 183e955f1..5f0f6110c 100755 --- a/marketing/src/common/hooks/useMount.js +++ b/marketing/src/common/hooks/useMount.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; export default function useMount() { const [isMount, setIsMount] = useState(false); diff --git a/marketing/src/common/i18n/locale-for-datefns.ts b/marketing/src/common/i18n/locale-for-datefns.ts index 1ea618817..740b5bc23 100644 --- a/marketing/src/common/i18n/locale-for-datefns.ts +++ b/marketing/src/common/i18n/locale-for-datefns.ts @@ -1,6 +1,6 @@ +import de from 'date-fns/locale/de'; import en from 'date-fns/locale/en-GB'; import fr from 'date-fns/locale/fr'; -import de from 'date-fns/locale/de'; import nl from 'date-fns/locale/nl'; export function localeToDateFns(locale: string): Locale { diff --git a/marketing/src/lib/getBlog.ts b/marketing/src/lib/getBlog.ts index 9d8b6afce..218f85152 100644 --- a/marketing/src/lib/getBlog.ts +++ b/marketing/src/lib/getBlog.ts @@ -1,7 +1,7 @@ import fs from 'fs'; +import { basename, join } from 'node:path'; import matter from 'gray-matter'; -import { join, basename } from 'node:path'; -import { groupBy, values, sortBy } from 'lodash-es'; +import { groupBy, sortBy, values } from 'lodash-es'; export type BlogMetadataGroup = { slug: string; diff --git a/marketing/src/middleware.ts b/marketing/src/middleware.ts index bceabada1..40c5cb0fd 100644 --- a/marketing/src/middleware.ts +++ b/marketing/src/middleware.ts @@ -1,6 +1,6 @@ import { addYears } from 'date-fns'; import type { ResponseCookie } from 'next/dist/compiled/@edge-runtime/cookies'; -import { NextResponse, type NextRequest } from 'next/server'; +import { type NextRequest, NextResponse } from 'next/server'; import parse from 'url-parse'; // https://www.retrospected.com/?campaignid=19686942887&creative=648178043912&device=c&keyword=retro