Skip to content

Commit

Permalink
Hide tabs example added
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzitelli committed Mar 15, 2023
1 parent ae34b1d commit 156865d
Showing 1 changed file with 40 additions and 30 deletions.
70 changes: 40 additions & 30 deletions src/screens/playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export const Playground: React.FC = observer(() => {
const {auth} = useStores();

// Methods
const shopFlashList = () => navio.push('PlaygroundFlashList');
const shopExpoImage = () => navio.push('PlaygroundExpoImage');

const showAuthFlow = () => {
// logging out from previous session
if (auth.state === 'logged-in') {
Expand All @@ -38,37 +41,44 @@ export const Playground: React.FC = observer(() => {
}
};

// pushing stack will hide tabs on Product Page
const showProductPage = () => navio.stacks.push('ProductPageStack');

// Memos
const SectionsData: Record<string, SectionData> = useMemo(() => {
return {
Libraries: {
content: [
{
title: 'Flash List',
subtitle: 'by Shopify',
icon: 'list-outline',
onPress: () => navio.push('PlaygroundFlashList'),
},
{
title: 'Expo Image',
subtitle: 'by Expo',
icon: 'image-outline',
onPress: () => navio.push('PlaygroundExpoImage'),
},
],
},
Navio: {
content: [
{
title: 'Auth flow',
icon: 'lock-closed-outline',
subtitle: auth.stateStr,
onPress: showAuthFlow,
},
],
},
};
}, [auth.state]);
const SectionsData: Record<string, SectionData> = {
Libraries: {
content: [
{
title: 'Flash List',
subtitle: 'by Shopify',
icon: 'list-outline',
onPress: shopFlashList,
},
{
title: 'Expo Image',
subtitle: 'by Expo',
icon: 'image-outline',
onPress: shopExpoImage,
},
],
},
Navio: {
content: [
{
title: 'Auth flow',
icon: 'lock-closed-outline',
subtitle: auth.stateStr,
onPress: showAuthFlow,
},
{
title: 'Hide tabs',
icon: 'eye-off-outline',
subtitle: 'Pushes Product Page w/out tabs',
onPress: showProductPage,
},
],
},
};

// UI Methods
const Sections = useMemo(() => {
Expand Down

0 comments on commit 156865d

Please sign in to comment.