diff --git a/client/src/api/cards.js b/client/src/api/cards.js index 8781af93..5240038f 100755 --- a/client/src/api/cards.js +++ b/client/src/api/cards.js @@ -8,11 +8,11 @@ export const transformCard = (card) => ({ ...(card.dueDate && { dueDate: new Date(card.dueDate), }), - ...(card.timer && { - timer: { - ...card.timer, - ...(card.timer.startedAt && { - startedAt: new Date(card.timer.startedAt), + ...(card.stopwatch && { + stopwatch: { + ...card.stopwatch, + ...(card.stopwatch.startedAt && { + startedAt: new Date(card.stopwatch.startedAt), }), }, }), @@ -23,11 +23,11 @@ export const transformCardData = (data) => ({ ...(data.dueDate && { dueDate: data.dueDate.toISOString(), }), - ...(data.timer && { - timer: { - ...data.timer, - ...(data.timer.startedAt && { - startedAt: data.timer.startedAt.toISOString(), + ...(data.stopwatch && { + stopwatch: { + ...data.stopwatch, + ...(data.stopwatch.startedAt && { + startedAt: data.stopwatch.startedAt.toISOString(), }), }, }), diff --git a/client/src/components/Card/ActionsStep.jsx b/client/src/components/Card/ActionsStep.jsx index 559dc2c2..dbd349e7 100644 --- a/client/src/components/Card/ActionsStep.jsx +++ b/client/src/components/Card/ActionsStep.jsx @@ -9,7 +9,7 @@ import { useSteps } from '../../hooks'; import BoardMembershipsStep from '../BoardMembershipsStep'; import LabelsStep from '../LabelsStep'; import DueDateEditStep from '../DueDateEditStep'; -import TimerEditStep from '../TimerEditStep'; +import StopwatchEditStep from '../StopwatchEditStep'; import CardMoveStep from '../CardMoveStep'; import DeleteStep from '../DeleteStep'; @@ -19,7 +19,7 @@ const StepTypes = { USERS: 'USERS', LABELS: 'LABELS', EDIT_DUE_DATE: 'EDIT_DUE_DATE', - EDIT_TIMER: 'EDIT_TIMER', + EDIT_STOPWATCH: 'EDIT_STOPWATCH', MOVE: 'MOVE', DELETE: 'DELETE', }; @@ -68,8 +68,8 @@ const ActionsStep = React.memo( openStep(StepTypes.EDIT_DUE_DATE); }, [openStep]); - const handleEditTimerClick = useCallback(() => { - openStep(StepTypes.EDIT_TIMER); + const handleEditStopwatchClick = useCallback(() => { + openStep(StepTypes.EDIT_STOPWATCH); }, [openStep]); const handleMoveClick = useCallback(() => { @@ -89,10 +89,10 @@ const ActionsStep = React.memo( [onUpdate], ); - const handleTimerUpdate = useCallback( - (timer) => { + const handleStopwatchUpdate = useCallback( + (stopwatch) => { onUpdate({ - timer, + stopwatch, }); }, [onUpdate], @@ -133,11 +133,11 @@ const ActionsStep = React.memo( onClose={onClose} /> ); - case StepTypes.EDIT_TIMER: + case StepTypes.EDIT_STOPWATCH: return ( - @@ -197,8 +197,8 @@ const ActionsStep = React.memo( context: 'title', })} - - {t('action.editTimer', { + + {t('action.editStopwatch', { context: 'title', })} diff --git a/client/src/components/Card/Card.jsx b/client/src/components/Card/Card.jsx index 86e26d5f..37521a06 100755 --- a/client/src/components/Card/Card.jsx +++ b/client/src/components/Card/Card.jsx @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import { Draggable } from 'react-beautiful-dnd'; import { usePopup } from '../../lib/popup'; -import { startTimer, stopTimer } from '../../utils/timer'; +import { startStopwatch, stopStopwatch } from '../../utils/stopwatch'; import Paths from '../../constants/Paths'; import Tasks from './Tasks'; import NameEdit from './NameEdit'; @@ -14,7 +14,7 @@ import ActionsStep from './ActionsStep'; import User from '../User'; import Label from '../Label'; import DueDate from '../DueDate'; -import Timer from '../Timer'; +import Stopwatch from '../Stopwatch'; import styles from './Card.module.scss'; @@ -24,7 +24,7 @@ const Card = React.memo( index, name, dueDate, - timer, + stopwatch, coverUrl, boardId, listId, @@ -60,15 +60,15 @@ const Card = React.memo( } }, []); - const handleToggleTimerClick = useCallback( + const handleToggleStopwatchClick = useCallback( (event) => { event.preventDefault(); onUpdate({ - timer: timer.startedAt ? stopTimer(timer) : startTimer(timer), + stopwatch: stopwatch.startedAt ? stopStopwatch(stopwatch) : startStopwatch(stopwatch), }); }, - [timer, onUpdate], + [stopwatch, onUpdate], ); const handleNameUpdate = useCallback( @@ -104,7 +104,7 @@ const Card = React.memo( )}
{name}
{tasks.length > 0 && } - {(dueDate || timer || notificationsTotal > 0) && ( + {(dueDate || stopwatch || notificationsTotal > 0) && ( {notificationsTotal > 0 && ( )} - {timer && ( + {stopwatch && ( - )} @@ -171,7 +171,7 @@ const Card = React.memo( { + const handleToggleStopwatchClick = useCallback(() => { onUpdate({ - timer: timer.startedAt ? stopTimer(timer) : startTimer(timer), + stopwatch: stopwatch.startedAt ? stopStopwatch(stopwatch) : startStopwatch(stopwatch), }); - }, [timer, onUpdate]); + }, [stopwatch, onUpdate]); const handleNameUpdate = useCallback( (newName) => { @@ -116,10 +116,10 @@ const CardModal = React.memo( [onUpdate], ); - const handleTimerUpdate = useCallback( - (newTimer) => { + const handleStopwatchUpdate = useCallback( + (newStopwatch) => { onUpdate({ - timer: newTimer, + stopwatch: newStopwatch, }); }, [onUpdate], @@ -160,7 +160,7 @@ const CardModal = React.memo( const BoardMembershipsPopup = usePopup(BoardMembershipsStep); const LabelsPopup = usePopup(LabelsStep); const DueDateEditPopup = usePopup(DueDateEditStep); - const TimerEditPopup = usePopup(TimerEditStep); + const StopwatchEditPopup = usePopup(StopwatchEditStep); const CardMovePopup = usePopup(CardMoveStep); const DeletePopup = usePopup(DeleteStep); @@ -185,7 +185,7 @@ const CardModal = React.memo( - {(users.length > 0 || labels.length > 0 || dueDate || timer) && ( + {(users.length > 0 || labels.length > 0 || dueDate || stopwatch) && (
{users.length > 0 && (
@@ -294,30 +294,33 @@ const CardModal = React.memo(
)} - {timer && ( + {stopwatch && (
- {t('common.timer', { + {t('common.stopwatch', { context: 'title', })}
{canEdit ? ( - - - + + + ) : ( - + )} {canEdit && ( - + - +