Move DarkModeContext into components/utils
parent
e7b7c47146
commit
8de4080789
|
@ -18,7 +18,6 @@ import { Link } from '@/design-system/typography/link'
|
|||
import { Body, Intro } from '@/design-system/typography/paragraphs'
|
||||
import { useIframeResizer } from '@/hooks/useIframeResizer'
|
||||
|
||||
import { DarkModeProvider } from '../contexts/DarkModeContext'
|
||||
import { Message } from '../design-system'
|
||||
import * as safeLocalStorage from '../storage/safeLocalStorage'
|
||||
import { store } from '../store/store'
|
||||
|
@ -26,6 +25,7 @@ import { inIframe } from '../utils'
|
|||
import { TrackingContext } from './ATInternetTracking'
|
||||
import { createTracker } from './ATInternetTracking/Tracker'
|
||||
import { ServiceWorker } from './ServiceWorker'
|
||||
import { DarkModeProvider } from './utils/DarkModeContext'
|
||||
|
||||
type SiteName = 'mon-entreprise' | 'infrance' | 'publicodes'
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import React, { useCallback, useState } from 'react'
|
|||
import { useDispatch, useSelector } from 'react-redux'
|
||||
import styled from 'styled-components'
|
||||
|
||||
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import { Grid } from '@/design-system/layout'
|
||||
import { Strong } from '@/design-system/typography'
|
||||
import { Body, SmallBody } from '@/design-system/typography/paragraphs'
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Trans, useTranslation } from 'react-i18next'
|
|||
import { useSelector } from 'react-redux'
|
||||
import styled, { css } from 'styled-components'
|
||||
|
||||
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import { Grid } from '@/design-system/layout'
|
||||
import { Link } from '@/design-system/typography/link'
|
||||
import { SmallBody } from '@/design-system/typography/paragraphs'
|
||||
|
|
|
@ -4,7 +4,10 @@ import { Trans, useTranslation } from 'react-i18next'
|
|||
import styled from 'styled-components'
|
||||
|
||||
import { FabriqueSocialEntreprise } from '@/api/fabrique-social'
|
||||
import { ForceThemeProvider, ThemeType } from '@/contexts/DarkModeContext'
|
||||
import {
|
||||
ForceThemeProvider,
|
||||
ThemeType,
|
||||
} from '@/components/utils/DarkModeContext'
|
||||
import { Message } from '@/design-system'
|
||||
import { Card } from '@/design-system/card'
|
||||
import { SearchField } from '@/design-system/field'
|
||||
|
|
|
@ -5,7 +5,7 @@ import styled from 'styled-components'
|
|||
|
||||
import FeedbackButton from '@/components/Feedback'
|
||||
import LegalNotice from '@/components/LegalNotice'
|
||||
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import { Button } from '@/design-system/buttons'
|
||||
import { Emoji } from '@/design-system/emoji'
|
||||
import { FooterContainer } from '@/design-system/footer'
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
import { useTranslation } from 'react-i18next'
|
||||
import styled, { css } from 'styled-components'
|
||||
|
||||
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import { Palette, SmallPalette } from '@/types/styled'
|
||||
|
||||
import { Emoji } from '../emoji'
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import { ReactNode } from 'react'
|
||||
import styled, { DefaultTheme } from 'styled-components'
|
||||
|
||||
import { ForceThemeProvider, ThemeType } from '@/contexts/DarkModeContext'
|
||||
import {
|
||||
ForceThemeProvider,
|
||||
ThemeType,
|
||||
} from '@/components/utils/DarkModeContext'
|
||||
|
||||
const InnerContainer = styled.div`
|
||||
margin-right: auto;
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
|||
import { useTranslation } from 'react-i18next'
|
||||
import styled, { DefaultTheme, css } from 'styled-components'
|
||||
|
||||
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import { Palette, SmallPalette } from '@/types/styled'
|
||||
|
||||
import { Emoji } from '../emoji'
|
||||
|
|
|
@ -4,7 +4,7 @@ import { AriaButtonProps } from '@react-types/button'
|
|||
import React, { ReactElement, Ref, RefObject, useEffect, useRef } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
|
||||
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import { Button } from '@/design-system/buttons'
|
||||
import { omit } from '@/utils'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
|
||||
import { DarkModeContext } from '@/contexts/DarkModeContext'
|
||||
import { DarkModeContext } from '@/components/utils/DarkModeContext'
|
||||
|
||||
export const useDarkMode = () => {
|
||||
return React.useContext(DarkModeContext)
|
||||
|
|
|
@ -9,8 +9,8 @@ import {
|
|||
} from '@/api/fabrique-social'
|
||||
import { CompanyDetails } from '@/components/company/Details'
|
||||
import { CompanySearchField } from '@/components/company/SearchField'
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import { useEngine } from '@/components/utils/EngineContext'
|
||||
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
|
||||
import AnswerGroup from '@/design-system/answer-group'
|
||||
import { Button } from '@/design-system/buttons'
|
||||
import { Emoji } from '@/design-system/emoji'
|
||||
|
|
|
@ -30,12 +30,12 @@ import { PlaceDesEntreprisesButton } from '@/components/PlaceDesEntreprises'
|
|||
import { CompanyDetails } from '@/components/company/Details'
|
||||
import RuleInput from '@/components/conversation/RuleInput'
|
||||
import { FromTop } from '@/components/ui/animate'
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import DefaultHelmet from '@/components/utils/DefaultHelmet'
|
||||
import { useEngine } from '@/components/utils/EngineContext'
|
||||
import { ScrollToTop } from '@/components/utils/Scroll'
|
||||
import { Markdown } from '@/components/utils/markdown'
|
||||
import useSimulationConfig from '@/components/utils/useSimulationConfig'
|
||||
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
|
||||
import { Message, Popover } from '@/design-system'
|
||||
import { Button } from '@/design-system/buttons'
|
||||
import { Emoji } from '@/design-system/emoji'
|
||||
|
|
Loading…
Reference in New Issue