-
- Device Notification
-
- {Capacitor.isNativePlatform()
- ? 'Receive notification on your device when a task is due'
- : 'This feature is only available on mobile devices'}{' '}
-
-
+
{
}}
color={deviceNotification ? 'success' : 'neutral'}
variant={deviceNotification ? 'solid' : 'outlined'}
- endDecorator={deviceNotification ? 'On' : 'Off'}
- slotProps={{
- endDecorator: {
- sx: {
- minWidth: 24,
- },
- },
- }}
+ sx={{ mr: 1 }}
/>
+
+ Device Notification
+
+ {Capacitor.isNativePlatform()
+ ? 'Receive notification on your device when a task is due'
+ : 'This feature is only available on mobile devices'}{' '}
+
+
{deviceNotification && (
@@ -329,17 +319,9 @@ const NotificationSetting = () => {
Notificaiton through other platform like Telegram or Pushover
-
-
- Custom Notification
-
- Receive notification on other platform
-
-
+
{
event.preventDefault()
@@ -360,15 +342,19 @@ const NotificationSetting = () => {
}}
color={chatID !== 0 ? 'success' : 'neutral'}
variant={chatID !== 0 ? 'solid' : 'outlined'}
- endDecorator={chatID !== 0 ? 'On' : 'Off'}
+ // endDecorator={chatID !== 0 ? 'On' : 'Off'}
slotProps={{
endDecorator: {
- sx: {
- minWidth: 24,
- },
+ sx: {},
},
}}
/>
+
+ Custom Notification
+
+ Receive notification on other platform
+
+
{chatID !== 0 && (
{
None
Telegram
Pushover
+ Webhook
{notificationTarget === '1' && (
<>
diff --git a/src/views/Settings/Settings.jsx b/src/views/Settings/Settings.jsx
index 40afc01..1cc14e3 100644
--- a/src/views/Settings/Settings.jsx
+++ b/src/views/Settings/Settings.jsx
@@ -357,22 +357,23 @@ const Settings = () => {
)}
- <>
- {webhookURL !== null && (
-
- Webhook URL
- setWebhookURL(e.target.value)}
- size='lg'
- sx={{
- width: '220px',
- mb: 1,
- }}
- />
-
- {webhookError}
-
+
+
+ {webhookURL !== null && (
+
+ Webhook URL
+ setWebhookURL(e.target.value)}
+ size='lg'
+ sx={{
+ width: '220px',
+ mb: 1,
+ }}
+ />
+ {webhookError && (
+
+ {webhookError}
)}
{
>
Save
- >
-
+
+ )}
>
)}
diff --git a/src/views/components/SubTask.jsx b/src/views/components/SubTask.jsx
new file mode 100644
index 0000000..efc1b21
--- /dev/null
+++ b/src/views/components/SubTask.jsx
@@ -0,0 +1,236 @@
+import { DndContext, closestCenter } from '@dnd-kit/core'
+import {
+ SortableContext,
+ arrayMove,
+ useSortable,
+ verticalListSortingStrategy,
+} from '@dnd-kit/sortable'
+import { CSS } from '@dnd-kit/utilities'
+import { Add, Delete, DragIndicator, Edit } from '@mui/icons-material'
+import {
+ Box,
+ Checkbox,
+ IconButton,
+ Input,
+ List,
+ ListItem,
+ Typography,
+} from '@mui/joy'
+import React, { useState } from 'react'
+import { CompleteSubTask } from '../../utils/Fetcher'
+
+function SortableItem({ task, index, handleToggle, handleDelete, editMode }) {
+ const { attributes, listeners, setNodeRef, transform, transition } =
+ useSortable({ id: task.id })
+
+ const style = {
+ transform: CSS.Transform.toString(transform),
+ transition,
+ display: 'flex',
+ alignItems: 'center',
+ gap: '0.5rem',
+ flexDirection: { xs: 'column', sm: 'row' }, // Responsive style
+ touchAction: 'none',
+ }
+
+ const [isEditing, setIsEditing] = useState(false)
+ const [editedText, setEditedText] = useState(task.name)
+
+ const handleEdit = () => {
+ setIsEditing(true)
+ }
+
+ const handleSave = () => {
+ setIsEditing(false)
+ task.name = editedText
+ }
+
+ return (
+