Skip to content

Commit

Permalink
Pass props directory to clock
Browse files Browse the repository at this point in the history
  • Loading branch information
ZEBAS204 committed Mar 27, 2023
1 parent 153734c commit f9c7cd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 5 additions & 1 deletion src/components/timer/Clock.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { Text } from '@chakra-ui/react'

export default function wClock({ remainingtimeToDisplay = '00:00:00' }) {
export default function wClock({
remainingtimeToDisplay = '00:00:00',
...rest
}) {
return (
<Text
role="timer"
fontFamily="Inter, Arial"
bgGradient="linear(to-b, #2a71fc, #6501f9)"
_dark={{
Expand Down
12 changes: 2 additions & 10 deletions src/components/timer/CountDown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ const ShapeButton = ({ icon, children, ...props }) => (
</Button>
)

export default function CountDown({
parentRunning = false,
remainingtimeToDisplay,
}) {
export default function CountDown({ parentRunning = false, ...clockProps }) {
const { t } = useTranslation()
const { toggleRunning, sendReset } = useTimerContext()
const [isPickerVisible, setPickerVisible] = useState(false)
Expand Down Expand Up @@ -52,7 +49,6 @@ export default function CountDown({
<>
<Flex
aria-label={t(`timer.${isPickerVisible ? 'picker' : 'title'}`)}
role={isPickerVisible ? null : 'timer'}
justifyContent="center"
alignItems="center"
borderRadius="20px"
Expand All @@ -64,11 +60,7 @@ export default function CountDown({
}}
clipPath="polygon(0 0,25% 0,calc(25% + 15px) 15px,calc(75% - 15px) 15px,75% 0,100% 0,100% 100%,60% 100%,calc(60% - 15px) calc(100% - 15px),calc(40% + 15px) calc(100% - 15px),40% 100%,0 100%)"
>
{isPickerVisible ? (
<TimePicker />
) : (
<Clock remainingtimeToDisplay={remainingtimeToDisplay} />
)}
{isPickerVisible ? <TimePicker /> : <Clock {...clockProps} />}
</Flex>

<Flex
Expand Down

1 comment on commit f9c7cd4

@vercel
Copy link

@vercel vercel bot commented on f9c7cd4 Mar 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.