diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a7fc17..33ab105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [2.0.7](https://github.com/geekdada/yasd/compare/v2.0.6...v2.0.7) (2024-09-21) + + + ## [2.0.6](https://github.com/geekdada/yasd/compare/v2.0.5...v2.0.6) (2024-09-08) diff --git a/package.json b/package.json index 42d4b5a..02ac25a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yasd", - "version": "2.0.6", + "version": "2.0.7", "private": true, "type": "module", "license": "MIT", @@ -151,7 +151,9 @@ "twin.macro": "^3.4.0", "typescript": "^5.1.6", "use-is-in-viewport": "^1.0.9", + "usehooks-ts": "^3.1.0", "uuid": "^9.0.0", + "vaul": "^0.9.4", "zod": "^3.21.4", "zx": "~7.2.3" }, diff --git a/src/components/ActionsModal.tsx b/src/components/ActionsModal.tsx index 60b6680..a105799 100644 --- a/src/components/ActionsModal.tsx +++ b/src/components/ActionsModal.tsx @@ -1,5 +1,6 @@ import React from 'react' import { useTranslation } from 'react-i18next' +import { useMediaQuery } from 'usehooks-ts' import { Button } from '@/components/ui/button' import { @@ -8,6 +9,15 @@ import { DialogHeader, DialogTitle, } from '@/components/ui/dialog' +import { + Drawer, + DrawerClose, + DrawerContent, + DrawerFooter, + DrawerHeader, + DrawerTitle, +} from '@/components/ui/drawer' +import { BottomSafeArea } from '@/components/VerticalSafeArea' export type Action = { id: number | string @@ -26,23 +36,49 @@ const ActionsModal = ({ ...props }: ActionsModalProps): JSX.Element => { const { t } = useTranslation() + const isDesktop = useMediaQuery('(min-width: 768px)') - return ( - - - - {title} - + if (isDesktop) { + return ( + + + + {title} + + +
+ {actions.map((action) => ( + + ))} +
+
+
+ ) + } -
+ return ( + + + + {title} + + {actions.map((action) => ( ))} -
-
-
+ + + + + + + ) } diff --git a/src/components/BackButton/index.tsx b/src/components/BackButton/index.tsx index d6fb9af..e177e21 100644 --- a/src/components/BackButton/index.tsx +++ b/src/components/BackButton/index.tsx @@ -8,7 +8,7 @@ const BackButton = ({ title }: { title?: string }) => { const navigate = useNavigate() return ( -
+
+ diff --git a/yarn.lock b/yarn.lock index 2ecb47a..d8026cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13959,6 +13959,13 @@ use-sync-external-store@^1.0.0, use-sync-external-store@^1.2.0: resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz#c3b6390f3a30eba13200d2302dcdf1e7b57b2ef9" integrity sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw== +usehooks-ts@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/usehooks-ts/-/usehooks-ts-3.1.0.tgz#156119f36efc85f1b1952616c02580f140950eca" + integrity sha512-bBIa7yUyPhE1BCc0GmR96VU/15l/9gP1Ch5mYdLcFBaFGQsdmXkvjV0TtOqW1yUd6VjIwDunm+flSciCQXujiw== + dependencies: + lodash.debounce "^4.0.8" + util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -14030,6 +14037,13 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== +vaul@^0.9.4: + version "0.9.4" + resolved "https://registry.yarnpkg.com/vaul/-/vaul-0.9.4.tgz#2e1d8f90481a9f25169226f9cd6f764ad30ca65e" + integrity sha512-pcyIy1nEk6798ReNQpbVH/T/dYnoJ3bwyq7jmSp134s+bSvpWoSWQthm3/jfsQRvHNYIEK4ZKbkHUJ3YfLfw1w== + dependencies: + "@radix-ui/react-dialog" "^1.1.1" + void-elements@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09"