-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Reuse topappbar from native paper
- Loading branch information
1 parent
88ed496
commit bded347
Showing
9 changed files
with
152 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import type { NavigationProp } from '@react-navigation/native'; | ||
import React, { useState } from 'react'; | ||
import { Alert, View } from 'react-native'; | ||
import { | ||
TopAppBar, | ||
BottomSheet, | ||
Button, | ||
Headline, | ||
Screen, | ||
useTheme, | ||
} from 'smartway-react-native-ui'; | ||
|
||
interface Props { | ||
navigation: NavigationProp<any>; | ||
} | ||
|
||
export const TopAppBarPage = ({ navigation }: Props) => { | ||
const theme = useTheme(); | ||
const [isOpened, setOpened] = useState<boolean>(false); | ||
|
||
const goBack = () => { | ||
navigation.goBack(); | ||
}; | ||
|
||
const showSettings = () => { | ||
Alert.alert('Click'); | ||
}; | ||
|
||
const menu = ( | ||
<View> | ||
<Button mode="outlined" onPress={() => setOpened(true)}> | ||
{'Aujourdhui'} | ||
</Button> | ||
</View> | ||
); | ||
|
||
return ( | ||
<Screen | ||
style={{ | ||
backgroundColor: theme.sw.colors.neutral[50], | ||
paddingLeft: 0, | ||
paddingRight: 0, | ||
}} | ||
> | ||
<TopAppBar | ||
size="small" | ||
title={{ value: <Headline size="h1">Headline H1</Headline> }} | ||
icon={{ name: 'dots-vertical', onPress: showSettings }} | ||
/> | ||
<TopAppBar | ||
size="center-aligned" | ||
onBack={goBack} | ||
title={{ value: menu, onPress: () => setOpened(true) }} | ||
icon={{ name: 'dots-vertical', onPress: showSettings }} | ||
/> | ||
<TopAppBar | ||
size="center-aligned" | ||
onBack={goBack} | ||
title={{ value: menu, onPress: () => setOpened(true) }} | ||
/> | ||
<TopAppBar | ||
size="medium" | ||
onBack={goBack} | ||
title={{ value: 'Headline H2' }} | ||
icon={{ name: 'dots-vertical', onPress: showSettings }} | ||
/> | ||
<BottomSheet | ||
snapPoints={['40%']} | ||
swipeable={true} | ||
title="Title" | ||
titleProps={{ style: { textAlign: 'center', marginBottom: theme.sw.spacing.s } }} | ||
isOpened={isOpened} | ||
onClose={() => setOpened(false)} | ||
> | ||
<Button onPress={() => setOpened(false)}>Option</Button> | ||
</BottomSheet> | ||
</Screen> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.