From 182254d4fa2d1a16ff469dff838864d0462be3e8 Mon Sep 17 00:00:00 2001 From: samliu Date: Sat, 24 Feb 2024 11:03:59 -0500 Subject: [PATCH] Fixed ShelfModal errors --- .../Components/CarouselTabs/CarouselTabs.tsx | 22 +++++++++-- mobile/Components/ShelfModal/ShelfModal.tsx | 37 ++++++++++--------- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/mobile/Components/CarouselTabs/CarouselTabs.tsx b/mobile/Components/CarouselTabs/CarouselTabs.tsx index e71feb23..a1658666 100644 --- a/mobile/Components/CarouselTabs/CarouselTabs.tsx +++ b/mobile/Components/CarouselTabs/CarouselTabs.tsx @@ -14,7 +14,11 @@ import Colors from "../../Constants/Colors"; const Tab = createMaterialTopTabNavigator(); +let shelf = "Currently Reading"; +export { shelf }; + function MyTabBar({ state, descriptors, navigation, position }) { + return ( { shelf = "Currently Reading"; } + }} + /> + { shelf = "Want To Read" } + }} + /> + { shelf = "Read" } + }} + /> + { shelf = "Did Not Finish" } + }} /> - - - ); } diff --git a/mobile/Components/ShelfModal/ShelfModal.tsx b/mobile/Components/ShelfModal/ShelfModal.tsx index ba15865a..25e06a05 100644 --- a/mobile/Components/ShelfModal/ShelfModal.tsx +++ b/mobile/Components/ShelfModal/ShelfModal.tsx @@ -6,6 +6,7 @@ import BookSearchBar from "../BookSearchBar"; import { Divider } from "@rneui/base"; import { NavigationContext } from "../../Contexts"; +import { shelf } from "../CarouselTabs"; const ShelfModal = ({ isShelfModalVisible, @@ -29,26 +30,26 @@ const ShelfModal = ({ ]; return ( - { setShelfModalVisible(false); setSearch(""); Keyboard.dismiss }} - swipeDirection={["down"]} - style={{ - marginBottom: 0, - marginRight: 0, - marginLeft: 0, - }} - propagateSwipe={true} - onBackdropPress={() => { setShelfModalVisible(false); setSearch("")}} - onSwipeCancel={Keyboard.dismiss} - > + // { setShelfModalVisible(false); setSearch(""); Keyboard.dismiss }} + // swipeDirection={["down"]} + // style={{ + // marginBottom: 0, + // marginRight: 0, + // marginLeft: 0, + // }} + // propagateSwipe={true} + // onBackdropPress={() => { setShelfModalVisible(false); setSearch("")}} + // onSwipeCancel={Keyboard.dismiss} + // > - {currentShelf} + Keyboard.dismiss}> + {shelf} + - + // ); }; export default ShelfModal;