From b7ee1c0f26e4fa4a7f6f623583461f5a9278fae3 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 28 Jul 2024 22:55:14 -0400 Subject: Update landing Get start section --- src/views/Landing/FeaturesSection.jsx | 12 --- src/views/Landing/Footer.jsx | 26 +++--- src/views/Landing/GettingStarted.jsx | 162 ++++++++++++++++++++++++++++++++++ src/views/Landing/HomeHero.jsx | 13 +-- src/views/Landing/Landing.jsx | 3 + src/views/components/NavBar.jsx | 11 --- 6 files changed, 177 insertions(+), 50 deletions(-) create mode 100644 src/views/Landing/GettingStarted.jsx diff --git a/src/views/Landing/FeaturesSection.jsx b/src/views/Landing/FeaturesSection.jsx index 32dcbc8..dbabd43 100644 --- a/src/views/Landing/FeaturesSection.jsx +++ b/src/views/Landing/FeaturesSection.jsx @@ -110,18 +110,6 @@ function FeaturesSection() { return ( - - Donetick is under development - - - - - Donetick is beta software. and is still under development. thing may - change, break, or disappear at any time. Please use it at your own - risk and discretion. I will do my best to keep the service running - - - Why Donetick? diff --git a/src/views/Landing/Footer.jsx b/src/views/Landing/Footer.jsx index 11a011a..3047554 100644 --- a/src/views/Landing/Footer.jsx +++ b/src/views/Landing/Footer.jsx @@ -47,17 +47,6 @@ function Footer() { tick✓ - - Beta - @@ -65,11 +54,11 @@ function Footer() { Github - Core(Backend) + Donetick + Docker Images + + - Packages + Releases diff --git a/src/views/Landing/GettingStarted.jsx b/src/views/Landing/GettingStarted.jsx new file mode 100644 index 0000000..44aa532 --- /dev/null +++ b/src/views/Landing/GettingStarted.jsx @@ -0,0 +1,162 @@ +import { + AddHome, + AutoAwesome, + Cloud, + GitHub, + InstallMobile, + Storage, +} from '@mui/icons-material' +import { Box, Button, Card, Grid, styled, Typography } from '@mui/joy' +const IconContainer = styled('div')({ + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + borderRadius: '50%', + minWidth: '60px', + height: '60px', + marginRight: '16px', +}) + +const ButtonContainer = styled('div')({ + display: 'flex', + justifyContent: 'center', + marginTop: 'auto', +}) + +function StartOptionCard({ icon: Icon, title, description, button, index }) { + return ( + + {/* Changes are within this div */} + + {Icon} + + + {title} + + + + + {description} + + + {button} + + ) +} + +const GettingStarted = () => { + const information = [ + { + title: 'Donetick Web', + icon: , + description: + 'The easiest way! just create account and start using DoneTick', + button: ( + + ), + }, + { + title: 'Selfhosted', + icon: , + description: 'Download the binary and manage your own DoneTick instance', + button: ( + + ), + }, + { + title: 'Hassio Addon', + icon: , + description: + 'have Home Assistant? install DoneTick as a Home Assistant Addon with single click', + button: ( + + ), + }, + ] + return ( + + + Getting Started + + + + + you can start using DoneTick in multiple ways, easiest way is to use + Donetick Web and you can start in seconds, or if you are into + selfhosting you can download the binary and run it on your own server, + or if you are using Home Assistant you can install DoneTick as a Home + Assistant Addon + +
+ + {information.map((info, index) => ( + + + + ))} + +
+
+
+ ) +} + +export default GettingStarted diff --git a/src/views/Landing/HomeHero.jsx b/src/views/Landing/HomeHero.jsx index 644c9cc..35286ec 100644 --- a/src/views/Landing/HomeHero.jsx +++ b/src/views/Landing/HomeHero.jsx @@ -61,17 +61,6 @@ const HomeHero = () => { > tick - - Beta -
) @@ -167,7 +156,7 @@ const HomeHero = () => { className='hover:scale-105' onClick={() => { // new window open to https://github.com/Donetick: - window.open('https://github.com/donetick', '_blank') + window.open('https://github.com/donetick/donetick', '_blank') }} startDecorator={} > diff --git a/src/views/Landing/Landing.jsx b/src/views/Landing/Landing.jsx index 4ca1b60..7e70a03 100644 --- a/src/views/Landing/Landing.jsx +++ b/src/views/Landing/Landing.jsx @@ -9,6 +9,7 @@ import DemoMyChore from './DemoMyChore' import DemoScheduler from './DemoScheduler' import FeaturesSection from './FeaturesSection' import Footer from './Footer' +import GettingStarted from './GettingStarted' import HomeHero from './HomeHero' const Landing = () => { const Navigate = useNavigate() @@ -39,6 +40,8 @@ const Landing = () => { + + {/* */} { tick✓ - - Beta - Date: Mon, 29 Jul 2024 01:00:39 -0400 Subject: Fix service worker caching index.html causing blank page --- vite.config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vite.config.js b/vite.config.js index 5af4b6f..f8e9fde 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,7 +14,10 @@ export default defineConfig({ 'safari-pinned-tab.svg', 'mstile-150x150.png', ], - injectManifest: true, + injectManifest: { + globPatterns: ['**/*.{js,css,html,png,svg}'], + globIgnores: ['index.html'], + }, manifest: { name: 'Donetick: Simplify Tasks & Chores, Together.', short_name: 'Donetick', @@ -55,6 +58,10 @@ export default defineConfig({ background_color: '#ffffff', display: 'standalone', }, + workbox: { + skipWaiting: true, // Force the waiting service worker to become the active service worker + clientsClaim: true, // Take control of uncontrolled clients as soon as the service worker becomes active + }, }), ], -- cgit From ff745e9b8385206464dd75e656add19c017f9e3a Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Mon, 29 Jul 2024 02:01:59 -0400 Subject: Fix service worker caching index.html causing blank page --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 83fd033..5b392a7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "donetick", "private": true, - "version": "0.1.65", + "version": "0.1.70", "type": "module", "lint-staged": { "*.{js,jsx,ts,tsx}": [ -- cgit From 8e0c467d003f96fcedb239bc30d864892c4e68ec Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Mon, 29 Jul 2024 02:10:17 -0400 Subject: Fix service worker caching index.html causing blank page --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5b392a7..7edd069 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "donetick", "private": true, - "version": "0.1.70", + "version": "0.1.71", "type": "module", "lint-staged": { "*.{js,jsx,ts,tsx}": [ -- cgit From 539cf5c24aff952253f8df4602d4f038b66bcb8e Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Mon, 29 Jul 2024 02:46:24 -0400 Subject: Update landing page with version number in footer --- src/views/Landing/Footer.jsx | 4 ++++ src/views/Landing/GettingStarted.jsx | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/views/Landing/Footer.jsx b/src/views/Landing/Footer.jsx index 3047554..d8cd4a4 100644 --- a/src/views/Landing/Footer.jsx +++ b/src/views/Landing/Footer.jsx @@ -4,6 +4,7 @@ import Box from '@mui/joy/Box' import Link from '@mui/joy/Link' import Typography from '@mui/joy/Typography' import * as React from 'react' +import { version } from '../../../package.json' function Footer() { return ( @@ -103,6 +104,9 @@ function Footer() { Changelog(soon) + + V{version} + {/* diff --git a/src/views/Landing/GettingStarted.jsx b/src/views/Landing/GettingStarted.jsx index 44aa532..ede365d 100644 --- a/src/views/Landing/GettingStarted.jsx +++ b/src/views/Landing/GettingStarted.jsx @@ -7,6 +7,7 @@ import { Storage, } from '@mui/icons-material' import { Box, Button, Card, Grid, styled, Typography } from '@mui/joy' +import { useNavigate } from 'react-router-dom' const IconContainer = styled('div')({ display: 'flex', alignItems: 'center', @@ -65,6 +66,7 @@ function StartOptionCard({ icon: Icon, title, description, button, index }) { } const GettingStarted = () => { + const navigate = useNavigate() const information = [ { title: 'Donetick Web', @@ -72,7 +74,14 @@ const GettingStarted = () => { description: 'The easiest way! just create account and start using DoneTick', button: ( - ), -- cgit From b5f17dc7a6f706a302d01fc129f5bf7edf6d8471 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 4 Aug 2024 22:34:49 -0400 Subject: Update dependencies and configuration files to support the use OpenReply to do Session replay --- .env | 3 ++- package-lock.json | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- package.json | 3 ++- src/App.jsx | 10 ++++++++++ 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/.env b/.env index b7e8b90..29ce2e6 100644 --- a/.env +++ b/.env @@ -1,2 +1,3 @@ VITE_APP_API_URL=http://localhost:2021 -VITE_IS_LANDING_DEFAULT=false \ No newline at end of file +VITE_IS_LANDING_DEFAULT=false +VITE_OPENREPLAY_PROJECT_KEY= diff --git a/package-lock.json b/package-lock.json index 21700ff..efde8e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,19 @@ { - "name": "fe-template", - "version": "0.1.61", + "name": "donetick", + "version": "0.1.72", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "fe-template", - "version": "0.1.61", + "name": "donetick", + "version": "0.1.72", "dependencies": { "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.15.2", "@mui/joy": "^5.0.0-beta.20", "@mui/material": "^5.15.2", + "@openreplay/tracker": "^14.0.4", "@tanstack/react-query": "^5.17.0", "aos": "^2.3.4", "dotenv": "^16.4.5", @@ -2481,6 +2482,12 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@medv/finder": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@medv/finder/-/finder-3.2.0.tgz", + "integrity": "sha512-JmU7JIBwyL8RAzefvzALT4sP2M0biGk8i2invAgpQmma/QgfsaqoHIvJ7S0YC8n9hUVG8X3Leul2nGa06PvhbQ==", + "license": "MIT" + }, "node_modules/@mui/base": { "version": "5.0.0-beta.29", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.29.tgz", @@ -2839,6 +2846,20 @@ "node": ">= 8" } }, + "node_modules/@openreplay/tracker": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@openreplay/tracker/-/tracker-14.0.4.tgz", + "integrity": "sha512-Mz+MPw9EYbH6tpZ3d1u2yLJsY+MaoBmJX0gQt4HtvGlwJnd7xJvF37xHY8/e3N1Tc7zENsrf7xcpiZXabNKoVQ==", + "license": "MIT", + "dependencies": { + "@medv/finder": "^3.2.0", + "error-stack-parser": "^2.0.6", + "fflate": "^0.8.2" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -4747,6 +4768,15 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, "node_modules/es-abstract": { "version": "1.22.3", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", @@ -5327,6 +5357,12 @@ "reusify": "^1.0.4" } }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -8064,6 +8100,12 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "deprecated": "Please use @jridgewell/sourcemap-codec instead" }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "license": "MIT" + }, "node_modules/streamx": { "version": "2.18.0", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.18.0.tgz", diff --git a/package.json b/package.json index 7edd069..651d891 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "donetick", "private": true, - "version": "0.1.71", + "version": "0.1.72", "type": "module", "lint-staged": { "*.{js,jsx,ts,tsx}": [ @@ -25,6 +25,7 @@ "@mui/icons-material": "^5.15.2", "@mui/joy": "^5.0.0-beta.20", "@mui/material": "^5.15.2", + "@openreplay/tracker": "^14.0.4", "@tanstack/react-query": "^5.17.0", "aos": "^2.3.4", "dotenv": "^16.4.5", diff --git a/src/App.jsx b/src/App.jsx index e436ecc..de8a3dd 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,6 @@ import NavBar from '@/views/components/NavBar' import { Button, Snackbar, Typography, useColorScheme } from '@mui/joy' +import Tracker from '@openreplay/tracker' import { useEffect, useState } from 'react' import { Outlet } from 'react-router-dom' import { useRegisterSW } from 'virtual:pwa-register/react' @@ -19,6 +20,8 @@ const remove = className => { const intervalMS = 5 * 60 * 1000 // 5 minutes function App() { + startOpenReplay() + const { mode, systemMode } = useColorScheme() const [userProfile, setUserProfile] = useState(null) const [showUpdateSnackbar, setShowUpdateSnackbar] = useState(true) @@ -115,4 +118,11 @@ function App() { ) } +const startOpenReplay = () => { + if (!import.meta.env.VITE_OPENREPLAY_PROJECT_KEY) return + const tracker = new Tracker({ + projectKey: import.meta.env.VITE_OPENREPLAY_PROJECT_KEY, + }) + tracker.start() +} export default App -- cgit From e9745683748ac5ecfdf704607441a3204d8c5516 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sat, 10 Aug 2024 02:08:49 -0400 Subject: Update Fetcher.jsx to include UpdateChoreAssignee function and ChoreCard.jsx to handle assignee change --- src/utils/Fetcher.jsx | 10 ++++++++++ src/views/Chores/ChoreCard.jsx | 23 ++++++++++++++++------- src/views/Modals/Inputs/SelectModal.jsx | 4 ++-- src/views/components/NavBar.jsx | 10 +++++----- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/utils/Fetcher.jsx b/src/utils/Fetcher.jsx index 17b6cd9..5b3bbd9 100644 --- a/src/utils/Fetcher.jsx +++ b/src/utils/Fetcher.jsx @@ -83,6 +83,15 @@ const SkipChore = id => { body: JSON.stringify({}), }) } + +const UpdateChoreAssignee = (id, assignee) => { + return Fetch(`${API_URL}/chores/${id}/assignee`, { + method: 'PUT', + headers: HEADERS(), + body: JSON.stringify({ assignee:Number(assignee) }), + }) +} + const CreateChore = chore => { return Fetch(`${API_URL}/chores/`, { method: 'POST', @@ -306,4 +315,5 @@ export { UpdateChoreHistory, UpdateThingState, UpdateUserDetails, + UpdateChoreAssignee, } diff --git a/src/views/Chores/ChoreCard.jsx b/src/views/Chores/ChoreCard.jsx index 97e407a..fdf025e 100644 --- a/src/views/Chores/ChoreCard.jsx +++ b/src/views/Chores/ChoreCard.jsx @@ -39,7 +39,7 @@ import moment from 'moment' import React, { useEffect } from 'react' import { useNavigate } from 'react-router-dom' import { API_URL } from '../../Config' -import { MarkChoreComplete, SkipChore } from '../../utils/Fetcher' +import { MarkChoreComplete, SkipChore, UpdateChoreAssignee } from '../../utils/Fetcher' import { Fetch } from '../../utils/TokenManager' import ConfirmationModal from '../Modals/Inputs/ConfirmationModal' import DateModal from '../Modals/Inputs/DateModal' @@ -219,7 +219,16 @@ const ChoreCard = ({ }) } const handleAssigneChange = assigneeId => { - // TODO: Implement assignee change + UpdateChoreAssignee(chore.id, assigneeId).then(response => { + if (response.ok) { + response.json().then(data => { + const newChore = data.res + onChoreUpdate(newChore, 'assigned') + }) + } + } + ) + } const handleCompleteWithNote = note => { Fetch(`${API_URL}/chores/${chore.id}/do`, { @@ -547,10 +556,6 @@ const ChoreCard = ({ Delegate to someone else - - - Complete as someone else - { @@ -620,10 +625,14 @@ const ChoreCard = ({ options={performers} displayKey='displayName' title={`Delegate to someone else`} + placeholder={'Select a performer'} onClose={() => { setIsChangeAssigneeModalOpen(false) }} - onSave={handleAssigneChange} + onSave={(selected)=>{ + handleAssigneChange(selected.id) + } + } /> { onSave(options.find(item => item.id === selected)) @@ -20,7 +20,7 @@ function SelectModal({ isOpen, onClose, onSave, options, title, displayKey }) { {title} - {options.map((item, index) => ( + setError(null)} + autoHideDuration={5000} + message={error} + > + {error} +
) } diff --git a/src/views/ChoreEdit/ChoreView.jsx b/src/views/ChoreEdit/ChoreView.jsx index 172ad9b..b77b511 100644 --- a/src/views/ChoreEdit/ChoreView.jsx +++ b/src/views/ChoreEdit/ChoreView.jsx @@ -3,6 +3,7 @@ import { CancelScheduleSend, Check, Checklist, + Edit, History, PeopleAlt, Person, @@ -258,7 +259,7 @@ const ChoreView = () => { > {infoCards.map((detail, index) => ( - + {/* divider between the list items: */} @@ -411,7 +412,15 @@ const ChoreView = () => { }} /> )} - + - or - - + + + More + + - + + + Date: Sat, 10 Aug 2024 02:31:05 -0400 Subject: Update ChoreView --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 651d891..3e9cd92 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "donetick", "private": true, - "version": "0.1.72", + "version": "0.1.73", "type": "module", "lint-staged": { "*.{js,jsx,ts,tsx}": [ -- cgit From 3a4519cb640fee59cdb4e6d9e3e9ddbcef46a37d Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 1 Sep 2024 14:11:08 -0400 Subject: Add CookiePermissionSnackbar component to Landing page, Better UI to selected dates --- package.json | 2 +- src/views/Chores/ChoreCard.jsx | 40 +++++++++++++++++++------- src/views/Landing/CookiePermissionSnackbar.jsx | 40 ++++++++++++++++++++++++++ src/views/Landing/Landing.jsx | 3 +- 4 files changed, 73 insertions(+), 12 deletions(-) create mode 100644 src/views/Landing/CookiePermissionSnackbar.jsx diff --git a/package.json b/package.json index 3e9cd92..ea12bfe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "donetick", "private": true, - "version": "0.1.73", + "version": "0.1.74", "type": "module", "lint-staged": { "*.{js,jsx,ts,tsx}": [ diff --git a/src/views/Chores/ChoreCard.jsx b/src/views/Chores/ChoreCard.jsx index fdf025e..29ee933 100644 --- a/src/views/Chores/ChoreCard.jsx +++ b/src/views/Chores/ChoreCard.jsx @@ -3,7 +3,6 @@ import { Check, Delete, Edit, - HowToReg, KeyboardDoubleArrowUp, LocalOffer, ManageSearch, @@ -39,7 +38,11 @@ import moment from 'moment' import React, { useEffect } from 'react' import { useNavigate } from 'react-router-dom' import { API_URL } from '../../Config' -import { MarkChoreComplete, SkipChore, UpdateChoreAssignee } from '../../utils/Fetcher' +import { + MarkChoreComplete, + SkipChore, + UpdateChoreAssignee, +} from '../../utils/Fetcher' import { Fetch } from '../../utils/TokenManager' import ConfirmationModal from '../Modals/Inputs/ConfirmationModal' import DateModal from '../Modals/Inputs/DateModal' @@ -226,9 +229,7 @@ const ChoreCard = ({ onChoreUpdate(newChore, 'assigned') }) } - } - ) - + }) } const handleCompleteWithNote = note => { Fetch(`${API_URL}/chores/${chore.id}/do`, { @@ -314,8 +315,28 @@ const ChoreCard = ({ return 'Yearly' } else if (chore.frequencyType === 'days_of_the_week') { let days = JSON.parse(chore.frequencyMetadata).days - days = days.map(d => moment().day(d).format('ddd')) - return days.join(', ') + if (days.length > 4) { + const allDays = [ + 'Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + ] + const selectedDays = days.map(d => moment().day(d).format('dddd')) + const notSelectedDay = allDays.filter( + day => !selectedDays.includes(day), + ) + const notSelectedShortdays = notSelectedDay.map(d => + moment().day(d).format('ddd'), + ) + return `Daily except ${notSelectedShortdays.join(', ')}` + } else { + days = days.map(d => moment().day(d).format('ddd')) + return days.join(', ') + } } else if (chore.frequencyType === 'day_of_the_month') { let freqData = JSON.parse(chore.frequencyMetadata) const months = freqData.months.map(m => moment().month(m).format('MMM')) @@ -629,10 +650,9 @@ const ChoreCard = ({ onClose={() => { setIsChangeAssigneeModalOpen(false) }} - onSave={(selected)=>{ + onSave={selected => { handleAssigneChange(selected.id) - } - } + }} /> { + useEffect(() => { + const cookiePermission = Cookies.get('cookies_permission') + + if (cookiePermission !== 'true') { + setOpen(true) + } + }, []) + + const [open, setOpen] = useState(false) + const handleClose = () => { + // Cookies.set('cookies_permission', 'true') + setOpen(false) + } + + return ( + { + if (reason === 'clickaway') { + return + } + // Cookies.set('cookies_permission', 'true') + handleClose() + }} + > + We use cookies to ensure you get the best experience on our website. + + + ) +} + +export default CookiePermissionSnackbar diff --git a/src/views/Landing/Landing.jsx b/src/views/Landing/Landing.jsx index 7e70a03..a323ecc 100644 --- a/src/views/Landing/Landing.jsx +++ b/src/views/Landing/Landing.jsx @@ -3,6 +3,7 @@ import AOS from 'aos' import 'aos/dist/aos.css' import { useEffect } from 'react' import { useNavigate } from 'react-router-dom' +import CookiePermissionSnackbar from './CookiePermissionSnackbar' import DemoAssignee from './DemoAssignee' import DemoHistory from './DemoHistory' import DemoMyChore from './DemoMyChore' @@ -52,7 +53,7 @@ const Landing = () => { mb: 5, }} > - +