diff --git a/resources/js/components/SVG.tsx b/resources/js/components/SVG.tsx new file mode 100644 index 0000000..90452f7 --- /dev/null +++ b/resources/js/components/SVG.tsx @@ -0,0 +1,36 @@ +import React, {ComponentProps, FC} from "react" + +const SVGSkeleton: FC = ({paths, viewBox = "0 0 24 24", className = "", title = null, ...props}) => { + return + {title && { title }} + {paths} + +} + +interface SVGSkeletonProps { + paths: string, + viewBox?: string, + className?: string, + title?: string, +} + +export const DraggableSVG: FC> = (props) => SVGSkeleton({ + paths: , + ...props +}) + +export const PlaySVG: FC> = (props) => SVGSkeleton({ + viewBox: "0 0 448 512", + paths: , + ...props +}) + +export const StopSVG: FC> = (props) => SVGSkeleton({ + paths: , + ...props +}) diff --git a/resources/js/components/Tracker.tsx b/resources/js/components/Tracker.tsx index 4811152..6466ff8 100644 --- a/resources/js/components/Tracker.tsx +++ b/resources/js/components/Tracker.tsx @@ -1,6 +1,7 @@ import React, {useEffect, useState} from "react" import useTracker from "../hooks/TraskerHook" import {Link} from "react-router-dom"; +import {StopSVG} from "./SVG"; const Tracker = () => { @@ -29,11 +30,13 @@ const Tracker = () => { return
{currentTimeTracker ?
- + {currentTimeTracker.to_do.name} {timer} - +
:
--:--
} diff --git a/resources/js/components/toDos/ToDoFinish.tsx b/resources/js/components/toDos/ToDoFinish.tsx index 96d8a0c..383af5e 100644 --- a/resources/js/components/toDos/ToDoFinish.tsx +++ b/resources/js/components/toDos/ToDoFinish.tsx @@ -1,6 +1,7 @@ import React, {FC, useEffect, useState} from "react" import useAxiosTools from "../../hooks/AxiosTools"; import {toDo} from "../../utilities/types"; +import {PlaySVG} from "../SVG"; const ToDoFinish: FC = ({reload}) => { @@ -35,10 +36,10 @@ const ToDoFinish: FC = ({reload}) => { } return
- {errorLabel()} diff --git a/resources/js/components/toDos/ToDoIndex.tsx b/resources/js/components/toDos/ToDoIndex.tsx index 7be590d..0bda68a 100644 --- a/resources/js/components/toDos/ToDoIndex.tsx +++ b/resources/js/components/toDos/ToDoIndex.tsx @@ -5,6 +5,7 @@ import {Link} from "react-router-dom"; import useTracker from "../../hooks/TraskerHook"; import {Simulate} from "react-dom/test-utils"; import load = Simulate.load; +import {DraggableSVG, PlaySVG} from "../SVG"; const ToDoIndex: FC = ({reload, setReload}) => { @@ -50,7 +51,7 @@ const ToDoIndex: FC = ({reload, setReload}) => { {errorLabel()}
    {toDos.map(toDo =>
  • - Move + toggleCheck(toDo)} @@ -59,9 +60,10 @@ const ToDoIndex: FC = ({reload, setReload}) => { className={`${toDo.checked ? 'line-through' : ''} flex-1`}> {toDo.name} - {!toDo.checked && startTrackToDo(toDo)}> - Play + }
  • )}