Switch to temporary 'fixed tabs' model for default and notifications

This commit is contained in:
Paul Frazee 2022-12-08 14:21:28 -06:00
parent 539bf5d350
commit 53b8f0d040
3 changed files with 91 additions and 17 deletions

View file

@ -37,7 +37,12 @@ export const Menu = ({navIdx, visible}: ScreenParams) => {
// =
const onNavigate = (url: string) => {
store.nav.navigate(url)
if (url === '/notifications') {
store.nav.switchTo(1, true)
} else {
store.nav.switchTo(0, true)
store.nav.navigate(url)
}
}
const onPressCreateScene = () => {
store.shell.openModal(new CreateSceneModel())

View file

@ -121,13 +121,29 @@ export const MobileShell: React.FC = observer(() => {
const screenRenderDesc = constructScreenRenderDesc(store.nav)
const onPressHome = () => {
if (store.nav.tab.current.url === '/') {
scrollElRef.current?.scrollToOffset({offset: 0})
if (store.nav.tab.fixedTabPurpose === 0) {
if (store.nav.tab.current.url === '/') {
scrollElRef.current?.scrollToOffset({offset: 0})
} else {
store.nav.tab.fixedTabReset()
}
} else {
store.nav.tab.resetTo('/')
store.nav.switchTo(0, false)
if (store.nav.tab.index === 0) {
store.nav.tab.fixedTabReset()
}
}
}
const onPressNotifications = () => {
if (store.nav.tab.fixedTabPurpose === 1) {
store.nav.tab.fixedTabReset()
} else {
store.nav.switchTo(1, false)
if (store.nav.tab.index === 0) {
store.nav.tab.fixedTabReset()
}
}
}
const onPressNotifications = () => store.nav.tab.resetTo('/notifications')
const onPressTabs = () => toggleTabsMenu(!isTabsSelectorActive)
const doNewTab = (url: string) => () => store.nav.newTab(url)