diff --git a/package.json b/package.json index 0a2cb57..c3b9f8f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "timetrack.desktop", "productName": "timetrack.desktop", - "version": "2.0.1", + "version": "2.1.0", "description": "Simple desktop application to track your time spent on different projects.", "main": ".vite/build/main.js", "scripts": { diff --git a/src/components/LoadingComponent.tsx b/src/components/LoadingComponent.tsx new file mode 100644 index 0000000..a5fb436 --- /dev/null +++ b/src/components/LoadingComponent.tsx @@ -0,0 +1,24 @@ +import React, { FC, useEffect, useRef, useState, ReactNode } from 'react'; +export const LoadingComponent: FC = () => { + return <> +
+
+
+
+
+
+
+ 15% +
+
+
+
+
+
+ + + +
+ ; +} + diff --git a/src/components/ModalConfirm.tsx b/src/components/ModalConfirm.tsx index 81e5e14..c66604e 100644 --- a/src/components/ModalConfirm.tsx +++ b/src/components/ModalConfirm.tsx @@ -6,15 +6,15 @@ interface BaseLayoutProps { callback?: (status: boolean) => void; } -export const ModalConfirm: FC = ({ callback, message }) => { - const onYesButtonClick = (evt: MouseEvent) => { +export const ModalConfirm: FC = ({ callback, message, children }) => { + const onYesButtonClick = (evt: React.MouseEvent) => { evt.preventDefault(); if (callback) { callback(true); } } - const onNoButtonClick = (evt: MouseEvent) => { + const onNoButtonClick = (evt: React.MouseEvent) => { evt.preventDefault(); if (callback) { callback(false); @@ -26,7 +26,7 @@ export const ModalConfirm: FC = ({ callback, message }) => {
-

{message ? message : "Are you sure?" }

+ {children ? children :

{message ? message : "Are you sure?" }

}
diff --git a/src/components/Projects.tsx b/src/components/Projects.tsx index 71f66cf..1c33445 100644 --- a/src/components/Projects.tsx +++ b/src/components/Projects.tsx @@ -118,9 +118,6 @@ export const Projects: FC = () => {
{projects.map((project, idx: number) => (
- - -

{project.name}

))} diff --git a/src/components/Search.tsx b/src/components/Search.tsx index d084d59..76e2763 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -1,37 +1,24 @@ -import React, { FC, useEffect, useRef, useState, ReactNode } from 'react'; +import React, { FC, useRef, useState } from 'react'; import moment from 'moment'; -import { Datafetcher } from './../lib/Datafetcher'; +import { LoadingComponent } from './LoadingComponent'; +import { ModalConfirm } from './ModalConfirm'; import { useAppDispatch } from './Store/hooks' type Props = { searchResult: SearchQueryResult } -const LoadingComponent: FC = () => { - return <> -
-
-
-
-
-
-
- 15% -
-
-
-
-
-
- - - -
- ; -} - const SearchResultsProjectsComponent: FC = ({ searchResult }) => { + const [DeleteProjectConfirmModal, setDeleteProjectConfirmModal] = useState(null); + const showDeleteProjectConfirmModal = (evt: React.MouseEvent) => { + evt.preventDefault(); + const modal = {console.log(result);}}> +

Are you sure you want to delete this project?

+
+ setDeleteProjectConfirmModal(modal); + } return <> + { DeleteProjectConfirmModal } { searchResult.projects.length ? searchResult.projects.map((project: DBProject, idx: number) =>
@@ -41,8 +28,7 @@ const SearchResultsProjectsComponent: FC = ({ searchResult }) => {
- - +
@@ -65,7 +51,6 @@ const SearchResultsTaskDefinitionsComponent: FC = ({ searchResult }) => {
-
@@ -91,7 +76,6 @@ const SearchResultsTasksComponent: FC = ({ searchResult }) => {
-
diff --git a/src/components/Tasks.tsx b/src/components/Tasks.tsx index ced6993..d6e0792 100644 --- a/src/components/Tasks.tsx +++ b/src/components/Tasks.tsx @@ -285,24 +285,19 @@ const Component: FC = ({ selectedProject, activeTasks, tasks }) => {

Today

{tasks.map((task, idx: number) => { - return
- - - -
-
-
-

{task.name}

-
-
-
-
-
-
- -
-
-

{task.date}

+ return
+
+
+

{task.name}

+
+
+

+ +

+
+
+

{task.date}

+
diff --git a/src/index.css b/src/index.css index 61667c1..65b1e81 100644 --- a/src/index.css +++ b/src/index.css @@ -28,6 +28,12 @@ max-width: 100%; } +.tasklist-item.is-active { + border-left: 5px solid; + color: var(--bulma-success-on-scheme); + border-left-color: var(--bulma-success-on-scheme) !important; +} + form.pdf-export-form .field, form.search-form .field { /* TODO: find a better way to do this diff --git a/src/lib/Utils.ts b/src/lib/Utils.ts index 7def06d..f4a2be7 100644 --- a/src/lib/Utils.ts +++ b/src/lib/Utils.ts @@ -28,7 +28,7 @@ const removeActiveClassnameGeneric = (rootQuery: string, itemsQuery: string) => } export const removeActiveClassnameTasks = () => { - removeActiveClassnameGeneric('[data-tasks-list]', '.panel-block'); + removeActiveClassnameGeneric('[data-tasks-list]', '.tasklist-item'); } export const removeActiveClassnameTaskDefinitions = () => {