diff --git a/src/components/BinaryClock.tsx b/src/components/BinaryClock.tsx index ffc0d26..2013cd7 100644 --- a/src/components/BinaryClock.tsx +++ b/src/components/BinaryClock.tsx @@ -28,23 +28,90 @@ const DEFAULTS = { const BinaryClock: React.FC = args => { const props = {...DEFAULTS, ...args}; - const digits = useBinaryTime( - props.orientation === Orientation.Landscape - ? BinaryTimeMode.DOUBLE_DIGITS - : BinaryTimeMode.SINGLE_DIGITS, + if (props.orientation === Orientation.Landscape) { + return ; + } else if (props.orientation === Orientation.Portrait) { + return ; + } else { + throw new Error(`Invalid orientation: ${props.orientation}`); + } +}; + +const LandscapeClock: React.FC = props => { + const digits = useBinaryTime(BinaryTimeMode.DOUBLE_DIGITS); + return ( + + + + + + + + ); +}; +const PortraitClock: React.FC = props => { + const digits = useBinaryTime(BinaryTimeMode.SINGLE_DIGITS); return ( - {digits.map((digit, idx) => ( - - ))} + + + ); };