From a9f3992d2cf950014caa3b7eb2455e028698e457 Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Thu, 21 Mar 2024 22:37:54 +0000 Subject: [PATCH] feat: move events to section in greeting - fix no tooltip on remove in todo --- .../greeting/options/GreetingOptions.jsx | 69 +++++++++++++++---- src/features/navbar/components/Todo.jsx | 4 +- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/src/features/greeting/options/GreetingOptions.jsx b/src/features/greeting/options/GreetingOptions.jsx index 8fe2ec80..c15db46f 100644 --- a/src/features/greeting/options/GreetingOptions.jsx +++ b/src/features/greeting/options/GreetingOptions.jsx @@ -1,10 +1,21 @@ import variables from 'config/variables'; import { useState } from 'react'; -import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings'; +import { + Header, + Row, + Content, + Action, + PreferencesWrapper, + Section, +} from 'components/Layout/Settings'; import { Checkbox, Switch, Text } from 'components/Form/Settings'; +import { MdEventNote } from 'react-icons/md'; + const GreetingOptions = () => { + const [events, setEvents] = useState(false); + const [birthday, setBirthday] = useState( new Date(localStorage.getItem('birthday')) || new Date(), ); @@ -19,17 +30,12 @@ const GreetingOptions = () => { const AdditionalOptions = () => { return ( - + - { ); }; - return ( - <> + let header; + if (events) { + header = ( +
setEvents(false)} + report={false} + /> + ); + } else { + header = (
{ zoomSetting="zoomGreeting" visibilityToggle={true} /> - - - {BirthdayOptions()} - + ); + } + + return ( + <> + {header} + {events ? ( + <> + + + + + + + {BirthdayOptions()} + + ) : ( + + +
setEvents(true)} + icon={} + /> + + )} ); }; diff --git a/src/features/navbar/components/Todo.jsx b/src/features/navbar/components/Todo.jsx index c6b8cc9d..3377d06b 100644 --- a/src/features/navbar/components/Todo.jsx +++ b/src/features/navbar/components/Todo.jsx @@ -215,7 +215,9 @@ class Todo extends PureComponent { onChange={(data) => this.updateTodo('set', index, data)} readOnly={this.state.todo[index].done} /> - this.updateTodo('remove', index)} /> + + this.updateTodo('remove', index)} /> + }