feat: add unselect all

This commit is contained in:
thecodrr
2020-03-03 15:46:53 +05:00
committed by Abdullah Atta
parent 4080f3b5d3
commit 750542fb12

View File

@@ -81,6 +81,7 @@ export default class Navigator {
const NavigationContainer = props => {
const openSideMenu = useStore(store => store.openSideMenu);
const isSelectionMode = useStore(store => store.isSelectionMode);
const exitSelectionMode = useStore(store => store.exitSelectionMode);
return (
<ThemeProvider>
<Flex flexDirection="column" px={2}>
@@ -131,9 +132,20 @@ const NavigationContainer = props => {
)}
</Flex>
)}
<Text variant="title" color="primary">
{props.route.params.subtitle}
</Text>
{(props.route.params.subtitle || isSelectionMode) && (
<Text
variant="title"
color="primary"
onClick={() => exitSelectionMode()}
sx={{
marginBottom: 2,
cursor: isSelectionMode ? "pointer" : "normal"
}}
>
{props.route.params.subtitle}
{isSelectionMode && "\nUnselect All"}
</Text>
)}
</Flex>
{props.route.component && (
<props.route.component navigator={props.navigator} {...props.params} />