Skip to content

Commit

Permalink
navio.tabs.updateOptions() added
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzitelli committed Feb 24, 2023
1 parent e4e9686 commit c673a50
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/components/sections/NavioSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {Text} from 'react-native-ui-lib';
import {useServices} from '../../services';
import {BButton} from '../button';
import {Section} from '../section';
import {randomNum} from '../../utils/help';
import {Row} from '../row';

type Props = {};

Expand All @@ -16,6 +18,10 @@ export const NavioSection: React.FC<Props> = ({}) => {
const stacksPush = () => navio.stacks.push('ProductPageStack');
const stacksSetRoot = () => navio.stacks.setRoot('MainStack');
const tabsJumpTo = () => navio.tabs.jumpTo('PlaygroundTab');
const tabsUpdateOptionsBadge = () =>
navio.tabs.updateOptions('SettingsTab', {tabBarBadge: randomNum()});
const tabsUpdateOptionsTitle = () =>
navio.tabs.updateOptions('SettingsTab', {title: `Random Title ${randomNum()}`});
const tabsSetRoot = () => navio.tabs.setRoot('AppTabs');
const drawersToggle = () => navio.drawers.toggle();
const drawersJumpTo = () => navio.drawers.jumpTo('Playground');
Expand Down Expand Up @@ -49,6 +55,24 @@ export const NavioSection: React.FC<Props> = ({}) => {
Tabs
</Text>
<BButton marginV-s1 label={t.do('section.navio.button.tabs.jump_to')} onPress={tabsJumpTo} />
<Row>
<BButton
flex
marginV-s1
marginR-s1
size="small"
label={t.do('section.navio.button.tabs.update_badge_options')}
onPress={tabsUpdateOptionsBadge}
/>
<BButton
flex
marginV-s1
marginL-s1
size="small"
label={t.do('section.navio.button.tabs.update_title_options')}
onPress={tabsUpdateOptionsTitle}
/>
</Row>
<BButton
marginV-s1
label={t.do('section.navio.button.tabs.set_root')}
Expand Down
2 changes: 2 additions & 0 deletions src/services/translate/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const en = {
},
tabs: {
jump_to: 'Jump to ⤵',
update_badge_options: 'Update tab badge',
update_title_options: 'Update title',
set_root: 'Set root ↺',
},
drawers: {
Expand Down

0 comments on commit c673a50

Please sign in to comment.