From 70a35423112615b92b0e4f4d58079960eb47dfda Mon Sep 17 00:00:00 2001 From: Robert Eggl Date: Mon, 23 Dec 2024 23:01:18 +0100 Subject: [PATCH] feat(timetable): update dropdown menu items and localization strings --- android/app/src/main/res/drawable/check.xml | 11 ++ bun.lockb | Bin 677632 -> 677632 bytes ios/Podfile.lock | 8 +- package.json | 12 +- src/components/Menu/DropdownMenuCheckIcon.tsx | 28 ---- src/components/Menu/DropdownMenuTrigger.tsx | 3 +- .../Timetable/{Menu.web.tsx => Menu.ios.tsx} | 65 +++++---- src/components/Timetable/Menu.tsx | 129 +++++++++--------- src/components/Timetable/TimetableScreen.tsx | 1 - .../Timetable/WeekEventComponent.tsx | 2 +- src/localization/de/timetable.json | 7 +- src/localization/en/timetable.json | 7 +- 12 files changed, 131 insertions(+), 142 deletions(-) create mode 100644 android/app/src/main/res/drawable/check.xml delete mode 100644 src/components/Menu/DropdownMenuCheckIcon.tsx rename src/components/Timetable/{Menu.web.tsx => Menu.ios.tsx} (64%) diff --git a/android/app/src/main/res/drawable/check.xml b/android/app/src/main/res/drawable/check.xml new file mode 100644 index 00000000..4241129c --- /dev/null +++ b/android/app/src/main/res/drawable/check.xml @@ -0,0 +1,11 @@ + + + + diff --git a/bun.lockb b/bun.lockb index dfd4fd482c0c7d53c29ffb0f316292dc3ccc70f5..dee33e0f12f8a708ea5ebbc5b537e404d0f1250e 100755 GIT binary patch delta 1791 zcma)5c{G%39R9vBeP9M0*y6C5edno2E8W^S48(15ETvRw!GUToH^1JTG|Z>;hQW z!vxUa1|4C?{gLU`#M zGqu!vWTvHud=+R+unW=(4Bfzyt>?c7^a|1yyn zZJj81@u}r()P+=ydy-nR$BMk&-EpUT58oYLw6;z+y?fQu7OSQSUo8fu5{4iclE_L> z9Fl_OAMDAU$j9VsW*Yl$!#tZNzm~8Jt2MInXKv9x+m{`t@@%pgDP1wTLF8it4h9Em zZZFR2_FL=1uZ#WzJ3L@i9zdxDq1UApV*$e7UvKZLBhh zcSO%E7}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y4n^O(%(mzcp(roHnsKZ@WH@y74x#!!Fy)!0$_Z^+kqAOA`I1xFRj-9t|mH7y$NhJ8Y#X z+oVR&$27{2KPSzVKL=&304))(gODOpmjG#?`9K0h5Tme&Vj_f>umpY-SP2jjwB&jv zLL6_<7;&6Lp)q1O0TES=0l?r12xtR9T;ZDjmaa;>X$jEM&=_6F_83UYQ5GDgX}laQ%+tz7`&5!ETkA0_Sp+m#I!g!=?4(6dbYaaGQa;mWF5$mt;szp``AuYhN$g4}RCc+zs frIAAmaP4x7(RY3JGO;SnT1H_Jk*Z>37zh3b9u@XQ diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 5258dcbc..e01598d1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -318,11 +318,11 @@ PODS: - hermes-engine (0.76.5): - hermes-engine/Pre-built (= 0.76.5) - hermes-engine/Pre-built (0.76.5) - - maplibre-react-native (10.0.0-beta.11): - - maplibre-react-native/DynamicLibrary (= 10.0.0-beta.11) + - maplibre-react-native (10.0.0-beta.13): + - maplibre-react-native/DynamicLibrary (= 10.0.0-beta.13) - React - React-Core - - maplibre-react-native/DynamicLibrary (10.0.0-beta.11): + - maplibre-react-native/DynamicLibrary (10.0.0-beta.13): - React - React-Core - RCT-Folly (2024.01.01.00): @@ -2788,7 +2788,7 @@ SPEC CHECKSUMS: fmt: 10c6e61f4be25dc963c36bd73fc7b1705fe975be glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a hermes-engine: 06a9c6900587420b90accc394199527c64259db4 - maplibre-react-native: e0b56ed1bc9d8c895e5999ba5ee03268f5b734bf + maplibre-react-native: fd8dd338959f3bb5038ce85d21eb60498176a8da RCT-Folly: bf5c0376ffe4dd2cf438dcf86db385df9fdce648 RCTDeprecation: fb7d408617e25d7f537940000d766d60149c5fea RCTRequired: 9aaf0ffcc1f41f0c671af863970ef25c422a9920 diff --git a/package.json b/package.json index d4cfaea5..d5988c8a 100644 --- a/package.json +++ b/package.json @@ -33,16 +33,16 @@ "@gorhom/bottom-sheet": "^5.0.6", "@howljs/calendar-kit": "^2.2.1", "@kichiyaki/react-native-barcode-generator": "^0.6.7", - "@maplibre/maplibre-react-native": "^10.0.0-beta.11", + "@maplibre/maplibre-react-native": "^10.0.0-beta.13", "@react-native-community/datetimepicker": "8.2.0", "@react-native-community/netinfo": "11.4.1", "@react-native-menu/menu": "^1.1.7", "@react-navigation/native": "^7.0.14", "@react-navigation/stack": "^7.1.1", "@shopify/flash-list": "1.7.1", - "@tanstack/query-sync-storage-persister": "^5.62.8", - "@tanstack/react-query": "^5.62.8", - "@tanstack/react-query-persist-client": "^5.62.8", + "@tanstack/query-sync-storage-persister": "^5.62.9", + "@tanstack/react-query": "^5.62.9", + "@tanstack/react-query-persist-client": "^5.62.9", "@th3rdwave/react-navigation-bottom-sheet": "0.3.2", "burnt": "^0.12.2", "color": "^4.2.3", @@ -129,8 +129,8 @@ "@types/prop-types": "^15.7.14", "@types/react": "~18.3.18", "@types/sanitize-html": "^2.13.0", - "@typescript-eslint/eslint-plugin": "^8.18.1", - "@typescript-eslint/parser": "^8.18.1", + "@typescript-eslint/eslint-plugin": "^8.18.2", + "@typescript-eslint/parser": "^8.18.2", "ajv": "^8.17.1", "babel-plugin-formatjs": "^10.5.29", "babel-plugin-transform-inline-environment-variables": "^0.4.4", diff --git a/src/components/Menu/DropdownMenuCheckIcon.tsx b/src/components/Menu/DropdownMenuCheckIcon.tsx deleted file mode 100644 index e25a18f0..00000000 --- a/src/components/Menu/DropdownMenuCheckIcon.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { Check } from 'lucide-react-native' -import React from 'react' -import { StyleSheet } from 'react-native' -import * as DropdownMenu from 'zeego/dropdown-menu' - -type ItemProps = React.ComponentProps<(typeof DropdownMenu)['ItemIcon']> - -const DropdownMenuCheckIcon = DropdownMenu.create((props: ItemProps) => { - return ( - - - - ) -}, 'ItemIcon') - -const styles = StyleSheet.create({ - // eslint-disable-next-line react-native/no-color-literals - check: { - color: 'white', - }, -}) -export default DropdownMenuCheckIcon diff --git a/src/components/Menu/DropdownMenuTrigger.tsx b/src/components/Menu/DropdownMenuTrigger.tsx index 40de9220..02f226cd 100644 --- a/src/components/Menu/DropdownMenuTrigger.tsx +++ b/src/components/Menu/DropdownMenuTrigger.tsx @@ -20,7 +20,8 @@ const stylesheet = createStyleSheet((theme) => ({ borderWidth: 0, fontSize: 18, outlineStyle: 'none', - paddingLeft: Platform.OS === 'web' ? 14 : 0, + paddingLeft: + Platform.OS === 'web' ? 14 : Platform.OS === 'android' ? 10 : 0, paddingVertical: 10, }, })) diff --git a/src/components/Timetable/Menu.web.tsx b/src/components/Timetable/Menu.ios.tsx similarity index 64% rename from src/components/Timetable/Menu.web.tsx rename to src/components/Timetable/Menu.ios.tsx index d17ef587..e5e5f1ea 100644 --- a/src/components/Timetable/Menu.web.tsx +++ b/src/components/Timetable/Menu.ios.tsx @@ -4,9 +4,7 @@ import { useTranslation } from 'react-i18next' import { createStyleSheet, useStyles } from 'react-native-unistyles' import * as DropdownMenu from 'zeego/dropdown-menu' -import DropdownMenuCheckIcon from '../Menu/DropdownMenuCheckIcon' import DropdownMenuContent from '../Menu/DropdownMenuContent' -import DropdownMenuItem from '../Menu/DropdownMenuItem' import DropdownMenuSeparator from '../Menu/DropdownMenuItemSeparator' import DropdownMenuItemTitle from '../Menu/DropdownMenuItemTitle' import DropdownMenuTrigger from '../Menu/DropdownMenuTrigger' @@ -25,7 +23,7 @@ export function MyMenu() { - { + value={timetableMode === TimetableMode.Timeline1} + onValueChange={() => { setTimetableMode(TimetableMode.Timeline1) }} > {t('menu.oneDay')} - {timetableMode === TimetableMode.Timeline1 && ( - - )} - + + - { + value={timetableMode === TimetableMode.Timeline3} + onValueChange={() => { setTimetableMode(TimetableMode.Timeline3) }} > {t('menu.threeDays')} - {timetableMode === TimetableMode.Timeline3 && ( - - )} - + + - { + value={timetableMode === TimetableMode.Timeline5} + onValueChange={() => { setTimetableMode(TimetableMode.Timeline5) }} > {t('menu.fiveDays')} - {timetableMode === TimetableMode.Timeline5 && ( - - )} - - - + + { + value={timetableMode === TimetableMode.List} + onValueChange={() => { setTimetableMode(TimetableMode.List) }} > {t('menu.list')} - {timetableMode === TimetableMode.List && ( - - )} - + + ) diff --git a/src/components/Timetable/Menu.tsx b/src/components/Timetable/Menu.tsx index 9662821f..5c895aa8 100644 --- a/src/components/Timetable/Menu.tsx +++ b/src/components/Timetable/Menu.tsx @@ -1,4 +1,5 @@ import { TimetableMode, usePreferencesStore } from '@/hooks/usePreferencesStore' +import { Check } from 'lucide-react-native' import React from 'react' import { useTranslation } from 'react-i18next' import { createStyleSheet, useStyles } from 'react-native-unistyles' @@ -8,7 +9,6 @@ import DropdownMenuContent from '../Menu/DropdownMenuContent' import DropdownMenuItem from '../Menu/DropdownMenuItem' import DropdownMenuSeparator from '../Menu/DropdownMenuItemSeparator' import DropdownMenuItemTitle from '../Menu/DropdownMenuItemTitle' -import DropdownMenuSubContent from '../Menu/DropdownMenuSubContent' import DropdownMenuTrigger from '../Menu/DropdownMenuTrigger' import PlatformIcon from '../Universal/Icon' @@ -30,7 +30,7 @@ export function MyMenu() { }} android={{ name: 'calendar_month', - size: 20, + size: 22, }} web={{ name: 'Calendar', @@ -40,68 +40,63 @@ export function MyMenu() { /> - - - {t('menu.timeline')} - - - - { - setTimetableMode(TimetableMode.Timeline1) - }} + { + setTimetableMode(TimetableMode.Timeline1) + }} + > + + {t('menu.oneDay')} + + {timetableMode === TimetableMode.Timeline1 && ( + - - {t('menu.oneDay')} - - {timetableMode === TimetableMode.Timeline1 && ( - - )} - - - { - setTimetableMode(TimetableMode.Timeline3) - }} + + + )} + + + { + setTimetableMode(TimetableMode.Timeline3) + }} + > + + {t('menu.threeDays')} + + {timetableMode === TimetableMode.Timeline3 && ( + - - {t('menu.threeDays')} - - {timetableMode === TimetableMode.Timeline3 && ( - - )} - - - { - setTimetableMode(TimetableMode.Timeline5) - }} + + + )} + + + { + setTimetableMode(TimetableMode.Timeline5) + }} + > + + {t('menu.fiveDays')} + + {timetableMode === TimetableMode.Timeline5 && ( + - - {t('menu.fiveDays')} - - {timetableMode === TimetableMode.Timeline5 && ( - - )} - - - - + + + )} + + { @@ -113,10 +108,11 @@ export function MyMenu() { {timetableMode === TimetableMode.List && ( + androidIconName="check" + style={styles.check} + > + + )} @@ -125,6 +121,9 @@ export function MyMenu() { } const stylesheet = createStyleSheet((theme) => ({ + check: { + color: theme.colors.labelColor, + }, trigger: { color: theme.colors.text, }, diff --git a/src/components/Timetable/TimetableScreen.tsx b/src/components/Timetable/TimetableScreen.tsx index 211f459d..c7d0f282 100644 --- a/src/components/Timetable/TimetableScreen.tsx +++ b/src/components/Timetable/TimetableScreen.tsx @@ -77,7 +77,6 @@ function TimetableScreen(): React.JSX.Element { ) } - console.warn('timetableMode', timetableMode) return ( diff --git a/src/components/Timetable/WeekEventComponent.tsx b/src/components/Timetable/WeekEventComponent.tsx index cd2cdd1b..08a6c198 100644 --- a/src/components/Timetable/WeekEventComponent.tsx +++ b/src/components/Timetable/WeekEventComponent.tsx @@ -92,7 +92,7 @@ const EventComponent = ({ backgroundColor: background, }} > - {isIOS && isExam ? : } + {isIOS && (isExam ? : )}