Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: () => {} })