Skip to content

Commit

Permalink
Merge pull request #335 from web-ridge/fix-require-recycle
Browse files Browse the repository at this point in the history
chore: fix require cycle warning
  • Loading branch information
iM-GeeKy authored Sep 17, 2023
2 parents 0c618f0 + 53fc02b commit 57b5e50
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Time/AmPmSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MD2Theme, Text, TouchableRipple, useTheme } from 'react-native-paper'
import { useMemo } from 'react'
import Color from 'color'
import { inputTypes, PossibleInputTypes, useSwitchColors } from './timeUtils'
import { DisplayModeContext } from './TimePicker'
import { DisplayModeContext } from '../contexts/DisplayModeContext'

export default function AmPmSwitcher({
onChange,
Expand Down
2 changes: 1 addition & 1 deletion src/Time/AnalogClock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { useLatest } from '../utils'
import AnalogClockHours from './AnalogClockHours'
import AnimatedClockSwitcher from './AnimatedClockSwitcher'
import AnalogClockMinutes from './AnalogClockMinutes'
import { DisplayModeContext } from './TimePicker'
import { DisplayModeContext } from '../contexts/DisplayModeContext'
function AnalogClock({
hours,
minutes,
Expand Down
6 changes: 1 addition & 5 deletions src/Time/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import {
import AnalogClock from './AnalogClock'
import { circleSize } from './timeUtils'
import TimeInputs from './TimeInputs'

export const DisplayModeContext = React.createContext<{
mode: 'AM' | 'PM' | undefined
setMode: React.Dispatch<React.SetStateAction<'AM' | 'PM' | undefined>>
}>({ mode: 'AM', setMode: () => {} })
import { DisplayModeContext } from '../contexts/DisplayModeContext'

type onChangeFunc = ({
hours,
Expand Down
6 changes: 6 additions & 0 deletions src/contexts/DisplayModeContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as React from 'react'

export const DisplayModeContext = React.createContext<{
mode: 'AM' | 'PM' | undefined
setMode: React.Dispatch<React.SetStateAction<'AM' | 'PM' | undefined>>
}>({ mode: 'AM', setMode: () => {} })

0 comments on commit 57b5e50

Please sign in to comment.