Skip to content

Commit

Permalink
Remove debug button from today screen
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Sep 13, 2023
1 parent 0916af1 commit d5d48ed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
4 changes: 1 addition & 3 deletions android/src/components/TodayScreen.tsx
@@ -1,7 +1,7 @@
import type { BottomTabScreenProps } from "@react-navigation/bottom-tabs";
import React from "react";
import { FlatList, StyleSheet, View } from "react-native";
import { Button, FAB } from "react-native-paper";
import { FAB } from "react-native-paper";
import { ListItem } from "@/components/TodayScreen/components/ListItem";
import { useTodayScreen } from "@/components/TodayScreen/hooks/useTodayScreen";
import type { BottomTabParamList } from "@/types/navigation";
Expand All @@ -10,15 +10,13 @@ type Props = BottomTabScreenProps<BottomTabParamList, "Today">;

export function TodayScreen(_: Props): JSX.Element {
const {
handleButtonOnPress,
handleFABOnPress,
handleListItemOnCheckboxPress,
handleListItemOnItemPress,
items,
} = useTodayScreen();
return (
<View style={styles.container}>
<Button onPress={handleButtonOnPress}>Item</Button>
<FlatList
data={items}
keyExtractor={(item) => item.id.toString()}
Expand Down
6 changes: 0 additions & 6 deletions android/src/components/TodayScreen/hooks/useTodayScreen.ts
Expand Up @@ -113,7 +113,6 @@ function handleScreenState(
}

export function useTodayScreen(): {
handleButtonOnPress: () => void;
handleFABOnPress: () => void;
handleListItemOnCheckboxPress: (item: Item) => () => void;
handleListItemOnItemPress: (item: Item) => () => void;
Expand All @@ -129,10 +128,6 @@ export function useTodayScreen(): {
setScreenState(handleScreenState(store, screenState));
}, [screenState, store]);

const handleButtonOnPress = useCallback(() => {
navigation.dispatch(StackActions.push("Item"));
}, [navigation]);

const handleFABOnPress = useCallback(() => {
if (screenState.type !== "itemWithCheckedsLoaded") return;
const items = screenState.itemWithCheckeds;
Expand Down Expand Up @@ -188,7 +183,6 @@ export function useTodayScreen(): {
);

return {
handleButtonOnPress,
handleFABOnPress,
handleListItemOnCheckboxPress,
handleListItemOnItemPress,
Expand Down

0 comments on commit d5d48ed

Please sign in to comment.