From bce51bb2c4c710370e5d7b98d00847c7b1484de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Malak?= Date: Fri, 5 Nov 2021 17:16:19 +0100 Subject: [PATCH] Added option to set custom day and month --- CHANGELOG.md | 2 +- .../Home/Header/functions/getDateTime.ts | 5 +- .../Settings/OtherSettings/OtherSettings.tsx | 53 +++++++++++++++++++ client/src/interfaces/Config.ts | 2 + client/src/interfaces/Forms.ts | 2 + client/src/store/actions/config.ts | 23 ++++++-- client/src/store/reducers/config.ts | 2 +- client/src/utility/index.ts | 1 + client/src/utility/storeUIConfig.ts | 8 +++ .../utility/templateObjects/configTemplate.ts | 3 ++ .../templateObjects/settingsTemplate.ts | 3 ++ utils/init/initialConfig.json | 4 +- 12 files changed, 99 insertions(+), 9 deletions(-) create mode 100644 client/src/utility/storeUIConfig.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 1011cad..7749da3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ### v1.7.4 (TBA) -- [WIP] Added option to set custom greetings and date ([#103](https://github.com/pawelmalak/flame/issues/103)) +- Added option to set custom greetings and date ([#103](https://github.com/pawelmalak/flame/issues/103)) - Added iOS "Add to homescreen" icon ([#131](https://github.com/pawelmalak/flame/issues/131)) - Added 3 new themes diff --git a/client/src/components/Home/Header/functions/getDateTime.ts b/client/src/components/Home/Header/functions/getDateTime.ts index 9f1d601..db79c69 100644 --- a/client/src/components/Home/Header/functions/getDateTime.ts +++ b/client/src/components/Home/Header/functions/getDateTime.ts @@ -1,5 +1,5 @@ export const getDateTime = (): string => { - const days = [ + const days = localStorage.getItem('daySchema')?.split(';') || [ 'Sunday', 'Monday', 'Tuesday', @@ -8,7 +8,8 @@ export const getDateTime = (): string => { 'Friday', 'Saturday', ]; - const months = [ + + const months = localStorage.getItem('monthSchema')?.split(';') || [ 'January', 'February', 'March', diff --git a/client/src/components/Settings/OtherSettings/OtherSettings.tsx b/client/src/components/Settings/OtherSettings/OtherSettings.tsx index b076735..c5b45ae 100644 --- a/client/src/components/Settings/OtherSettings/OtherSettings.tsx +++ b/client/src/components/Settings/OtherSettings/OtherSettings.tsx @@ -81,6 +81,7 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
formSubmitHandler(e)}> {/* OTHER OPTIONS */} + {/* PAGE TITLE */} { onChange={(e) => inputChangeHandler(e)} /> + + {/* DATE FORMAT */} + + {/* PIN CATEGORIES */} + + {/* SORT TYPE */} + + {/* APPS OPPENING */} + + {/* BOOKMARKS OPPENING */} { + + {/* CUSTOM GREETINGS */} { used + + {/* CUSTOM DAYS */} + + + inputChangeHandler(e)} + /> + Names must be separated with semicolon + + + {/* CUSTOM MONTHS */} + + + inputChangeHandler(e)} + /> + Names must be separated with semicolon + + + {/* HIDE APPS */} + + {/* HIDE CATEGORIES */} { onChange={(e) => inputChangeHandler(e)} /> + + {/* USE DOCKER API */} + + {/* UNPIN DOCKER APPS */}