-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v5.1.0' into fix/web-inappropriate-loader-to-handle-fil…
…e-type
- Loading branch information
Showing
13 changed files
with
1,076 additions
and
835 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 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,83 @@ | ||
import React from 'react'; | ||
import {Text} from 'react-native-ui-lib'; | ||
import {useServices} from '../../services'; | ||
import {BButton} from '../button'; | ||
import {Section} from '../section'; | ||
|
||
type Props = {}; | ||
|
||
export const NavioSection: React.FC<Props> = ({}) => { | ||
const {t, navio} = useServices(); | ||
|
||
// Methods | ||
const pushScreen = () => navio.push('Example', {type: 'push'}); | ||
const goBack = () => navio.goBack(); | ||
const globalSetRoot = () => navio.setRoot('tabs', 'AppTabs'); | ||
const stacksPush = () => navio.stacks.push('ProductPageStack'); | ||
const stacksSetRoot = () => navio.stacks.setRoot('MainStack'); | ||
const tabsJumpTo = () => navio.tabs.jumpTo('PlaygroundTab'); | ||
const tabsSetRoot = () => navio.tabs.setRoot('AppTabs'); | ||
const drawersToggle = () => navio.drawers.toggle(); | ||
const drawersJumpTo = () => navio.drawers.jumpTo('Playground'); | ||
const drawersSetRoot = () => navio.drawers.setRoot('MainDrawer'); | ||
const modalsShow = () => navio.modals.show('ExampleModal'); | ||
|
||
return ( | ||
<Section title={t.do('section.navio.title')}> | ||
<Text text60R textColor> | ||
Common | ||
</Text> | ||
<BButton marginV-s1 label={t.do('section.navio.button.common.push')} onPress={pushScreen} /> | ||
<BButton marginV-s1 label={t.do('section.navio.button.common.go_back')} onPress={goBack} /> | ||
<BButton | ||
marginV-s1 | ||
label={t.do('section.navio.button.common.set_root')} | ||
onPress={globalSetRoot} | ||
/> | ||
|
||
<Text marginT-s4 text60R textColor> | ||
Stacks | ||
</Text> | ||
<BButton marginV-s1 label={t.do('section.navio.button.stacks.push')} onPress={stacksPush} /> | ||
<BButton | ||
marginV-s1 | ||
label={t.do('section.navio.button.stacks.set_root')} | ||
onPress={stacksSetRoot} | ||
/> | ||
|
||
<Text marginT-s4 text60R textColor> | ||
Tabs | ||
</Text> | ||
<BButton marginV-s1 label={t.do('section.navio.button.tabs.jump_to')} onPress={tabsJumpTo} /> | ||
<BButton | ||
marginV-s1 | ||
label={t.do('section.navio.button.tabs.set_root')} | ||
onPress={tabsSetRoot} | ||
/> | ||
|
||
<Text marginT-s4 text60R textColor> | ||
Drawers | ||
</Text> | ||
<BButton | ||
marginV-s1 | ||
label={t.do('section.navio.button.drawers.toggle')} | ||
onPress={drawersToggle} | ||
/> | ||
<BButton | ||
marginV-s1 | ||
label={t.do('section.navio.button.drawers.jump_to')} | ||
onPress={drawersJumpTo} | ||
/> | ||
<BButton | ||
marginV-s1 | ||
label={t.do('section.navio.button.drawers.set_root')} | ||
onPress={drawersSetRoot} | ||
/> | ||
|
||
<Text marginT-s4 text60R textColor> | ||
Modals | ||
</Text> | ||
<BButton marginV-s1 label={t.do('section.navio.button.modals.show')} onPress={modalsShow} /> | ||
</Section> | ||
); | ||
}; |
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,109 @@ | ||
import {Navio} from 'rn-navio'; | ||
|
||
import {Main} from './screens/main'; | ||
import {Playground} from './screens/playground'; | ||
import {Settings} from './screens/settings'; | ||
import {Example} from './screens/_screen-sample'; | ||
|
||
import {useAppearance} from './utils/hooks'; | ||
import { | ||
screenDefaultOptions, | ||
tabScreenDefaultOptions, | ||
getTabBarIcon, | ||
drawerScreenDefaultOptions, | ||
} from './utils/designSystem'; | ||
import {services} from './services'; | ||
|
||
// NAVIO | ||
export const navio = Navio.build({ | ||
screens: { | ||
Main, | ||
Settings, | ||
Example, | ||
Playground: { | ||
component: Playground, | ||
options: () => ({ | ||
title: 'Playground', | ||
}), | ||
}, | ||
ProductPage: { | ||
component: Example, | ||
options: { | ||
headerShown: false, | ||
}, | ||
}, | ||
}, | ||
stacks: { | ||
MainStack: ['Main', 'Example'], | ||
ExampleStack: { | ||
screens: ['Example'], | ||
navigatorProps: { | ||
screenListeners: { | ||
focus: () => {}, | ||
}, | ||
}, | ||
}, | ||
ProductPageStack: { | ||
screens: ['ProductPage'], | ||
containerOptions: { | ||
headerShown: true, | ||
title: 'Product page', | ||
}, | ||
}, | ||
}, | ||
tabs: { | ||
AppTabs: { | ||
content: { | ||
MainTab: { | ||
stack: 'MainStack', | ||
options: () => ({ | ||
title: 'Main', | ||
tabBarIcon: getTabBarIcon('MainTab'), | ||
}), | ||
}, | ||
PlaygroundTab: { | ||
stack: ['Playground'], | ||
options: () => ({ | ||
title: 'Playground', | ||
tabBarIcon: getTabBarIcon('PlaygroundTab'), | ||
}), | ||
}, | ||
SettingsTab: { | ||
stack: ['Settings'], | ||
options: () => ({ | ||
title: services.t.do('settings.title'), | ||
tabBarIcon: getTabBarIcon('SettingsTab'), | ||
}), | ||
}, | ||
}, | ||
}, | ||
}, | ||
modals: { | ||
ExampleModal: 'ExampleStack', | ||
}, | ||
drawers: { | ||
MainDrawer: { | ||
content: { | ||
Main: 'MainStack', | ||
Example: 'ExampleStack', | ||
Playground: ['Playground'], | ||
}, | ||
}, | ||
}, | ||
root: 'AppTabs', | ||
hooks: [useAppearance], | ||
defaultOptions: { | ||
stacks: { | ||
screen: screenDefaultOptions, | ||
}, | ||
tabs: { | ||
screen: tabScreenDefaultOptions, | ||
}, | ||
drawers: { | ||
screen: drawerScreenDefaultOptions, | ||
}, | ||
}, | ||
}); | ||
|
||
export const getNavio = () => navio; | ||
export const AppRoot = navio.Root; |
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.