A
getLeftButtons = () => { const leftButtonsVisible = experiments.isDisableVersionsScreen || this.uiStore.navBarAdditionalButtonsVisible const leftButtons: NavBarButton[] = [ { iconName: 'backStroke', onPress: this.props.onBack, testID: tabPageTestID.buttons.backButton, }, ] if (this.mainStore.initialParams.playlistTabs) { const canGoBack = this.mainStore.playlistIndex !== 0 const canGoForward = this.mainStore.playlistIndex !== this.mainStore.initialParams.playlistTabs.length - 1 leftButtons.push( { iconName: 'listPlayStroke', onPress: this.actions.openCurrentPlaylistModal, }, { iconName: 'chevroneLeftOutlined', onPress: this.actions.onPlaylistBack, disabled: !canGoBack, }, { iconName: 'chevroneRightOutlined', onPress: this.actions.onPlaylistForward, disabled: !canGoForward, }, ) } else if ( this.mainStore.uiStore.withVersionsButton && !experiments.isDisableVersionsScreen ) { leftButtons.push({ iconName: 'listStroke', onPress: this.actions.openVersionsModal, }) } if (leftButtonsVisible) { return [...leftButtons, ...this.calculateLeftVisibleButtons()] } return leftButtons } private calculateLeftVisibleButtons() { const { mainStore } = this const themeName = mainStore.uiStore.themeName const leftButtons: NavBarButton[] = [] if (mainStore.isOfficial) { if (this.xtz.isBackingTrackLoading) { leftButtons.push( <BackingTrackCircularProgress progress={this.xtz.progressLoadingBTMode * 100} />, ) } else { let iconName = 'backingtrack' if (this.xtz.isBackingTrackEnabled) { iconName = themeName === THEME_DARK ? 'backingtrackDownloadedColoredDark' : 'backingtrackDownloadedColoredLight' } leftButtons.push({ iconName, onPress: () => { this.actions.onBackingtrackPress('navbar') }, animated: !experiments.isDisableVersionsScreen, }) } } if (experiments.isDisableVersionsScreen) { leftButtons.push( <TextButton state="secondary" size="sm" text="Versions" onPress={this.actions.openVersionsModal} leftIcon="listStroke" />, ) return leftButtons } if (mainStore.hasOfficial) { leftButtons.push({ iconName: 'starCircleFilled', onPress: () => this.actions.openTab({ from: INTERACTIVE_BAR_KEY }), animated: true, }) } else if (mainStore.hasPro) { leftButtons.push({ iconName: 'playCircleFilled', onPress: () => this.actions.openTab({ from: OFFICIAL_BAR_KEY }), animated: true, }) } return leftButtons }
Leave a Comment