Skip to content

Commit

Permalink
tsukota: Add headerTitle example
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Jun 12, 2023
1 parent 43360d1 commit cea7eef
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/tsukota/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
NativeStackNavigationProp,
createNativeStackNavigator,
} from "@react-navigation/native-stack";
import { useTranslation } from "./lib/i18n";

const Stack = createNativeStackNavigator();

Expand Down Expand Up @@ -44,11 +45,20 @@ function AccountNew(): JSX.Element {
}

function App() {
const { t } = useTranslation();
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="AccountNew" component={AccountNew} />
<Stack.Screen
component={Home}
name="Home"
options={{ headerTitle: t("title.account.index") ?? "" }}
/>
<Stack.Screen
component={AccountNew}
name="AccountNew"
options={{ headerTitle: t("title.account.new") ?? "" }}
/>
</Stack.Navigator>
</NavigationContainer>
);
Expand Down

0 comments on commit cea7eef

Please sign in to comment.