Skip to content

Commit

Permalink
Fixed ShelfModal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sliu-1 committed Feb 24, 2024
1 parent 8a16457 commit 182254d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 20 deletions.
22 changes: 19 additions & 3 deletions mobile/Components/CarouselTabs/CarouselTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<View>
<ScrollView
Expand Down Expand Up @@ -110,10 +114,22 @@ function CarouselTabs({ navigation }) {
<Tab.Screen
name="Currently Reading"
component={CurrentlyReadingCarousel}
listeners={{
tabPress: e => { shelf = "Currently Reading"; }
}}
/>
<Tab.Screen name="Want To Read" component={WantToReadCarousel} listeners={{
tabPress: e => { shelf = "Want To Read" }
}}
/>
<Tab.Screen name="Read" component={ReadCarousel} listeners={{
tabPress: e => { shelf = "Read" }
}}
/>
<Tab.Screen name="Did Not Finish" component={DNFCarousel} listeners={{
tabPress: e => { shelf = "Did Not Finish" }
}}
/>
<Tab.Screen name="Want To Read" component={WantToReadCarousel} />
<Tab.Screen name="Read" component={ReadCarousel} />
<Tab.Screen name="Did Not Finish" component={DNFCarousel} />
</Tab.Navigator>
);
}
Expand Down
37 changes: 20 additions & 17 deletions mobile/Components/ShelfModal/ShelfModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import BookSearchBar from "../BookSearchBar";
import { Divider } from "@rneui/base";

import { NavigationContext } from "../../Contexts";
import { shelf } from "../CarouselTabs";

const ShelfModal = ({
isShelfModalVisible,
Expand All @@ -29,26 +30,26 @@ const ShelfModal = ({
];

return (
<Modal
isVisible={isShelfModalVisible}
onSwipeComplete={() => { setShelfModalVisible(false); setSearch(""); Keyboard.dismiss }}
swipeDirection={["down"]}
style={{
marginBottom: 0,
marginRight: 0,
marginLeft: 0,
}}
propagateSwipe={true}
onBackdropPress={() => { setShelfModalVisible(false); setSearch("")}}
onSwipeCancel={Keyboard.dismiss}
>
// <Modal
// isVisible={isShelfModalVisible}
// onSwipeComplete={() => { setShelfModalVisible(false); setSearch(""); Keyboard.dismiss }}
// swipeDirection={["down"]}
// style={{
// marginBottom: 0,
// marginRight: 0,
// marginLeft: 0,
// }}
// propagateSwipe={true}
// onBackdropPress={() => { setShelfModalVisible(false); setSearch("")}}
// onSwipeCancel={Keyboard.dismiss}
// >

<View style={{
justifyContent: "center",
alignItems: "center",
backgroundColor: "white",
width: "100%",
height: "95%",
height: "100%",
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
}}
Expand All @@ -67,10 +68,12 @@ const ShelfModal = ({
<View
style={{
position: "absolute",
top: 35,
top: 30,
left: 20,
}}>
<Text style={{fontWeight: 'bold', fontSize: 24}}>{currentShelf}</Text>
<TouchableWithoutFeedback onPress={() => Keyboard.dismiss}>
<Text style={{fontWeight: 'bold', fontSize: 30}}>{shelf}</Text>
</TouchableWithoutFeedback>
</View>
<View
style={{
Expand Down Expand Up @@ -126,7 +129,7 @@ const ShelfModal = ({
/>
</View>
</View>
</Modal>
//</Modal>
);
};
export default ShelfModal;

0 comments on commit 182254d

Please sign in to comment.