From 6cb09b3e30e0350df10b7226d333dce89ef5155e Mon Sep 17 00:00:00 2001 From: shunsei Date: Fri, 8 Nov 2024 18:52:19 +0900 Subject: [PATCH] Add selected book to cart (#90) --- .../app/components/books/BookSelectedDialog.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/app/components/books/BookSelectedDialog.tsx b/frontend/app/components/books/BookSelectedDialog.tsx index 83988170..3bb5138a 100644 --- a/frontend/app/components/books/BookSelectedDialog.tsx +++ b/frontend/app/components/books/BookSelectedDialog.tsx @@ -2,9 +2,13 @@ import { Button, Center, Dialog, Stack, Text } from '@mantine/core'; import { useSubmit } from '@remix-run/react'; import { useAtom } from 'jotai'; import { selectedBooksAtom } from '~/stores/bookAtom'; +import { cartAtom } from '~/stores/cartAtom'; +import { successNotification } from '~/utils/notification'; const BookSelectedDialog = () => { const [selectedBook, setSelectedBook] = useAtom(selectedBooksAtom); + const [cart, setCart] = useAtom(cartAtom); + const submit = useSubmit(); return ( @@ -21,7 +25,16 @@ const BookSelectedDialog = () => {
選択中の本が{selectedBook.length}冊あります
-