import * as React from 'react'; import { ConfigScreenStyles } from '../configScreenStyles'; import Icon from '../../../Icon'; import BetaChip from '../../../BetaChip'; import { TouchableRipple, Text } from 'react-native-paper'; import { View } from 'react-native'; import Setting, { AppType, SettingMetadataSection } from '@joplin/lib/models/Setting'; interface Props { selected: boolean; section: SettingMetadataSection; styles: ConfigScreenStyles; onPress: ()=> void; } const SectionTab: React.FC = ({ styles, onPress, selected, section }) => { const icon = Setting.sectionNameToIcon(section.name, AppType.Mobile); const label = Setting.sectionNameToLabel(section.name); const shortDescription = Setting.sectionMetadataToSummary(section); const styleSheet = styles.styleSheet; const titleStyle = selected ? styleSheet.sidebarSelectedButtonText : styleSheet.sidebarButtonMainText; const isBeta = section.name === 'plugins'; const betaChip = isBeta ? : null; return ( {label} {betaChip} {shortDescription ?? ''} ); }; export default SectionTab;