about summary refs log tree commit diff
path: root/src/screens/Settings/NotificationSettings/components/ItemTextWithSubtitle.tsx
blob: 217fc33b95000a7db27714da8eefc531c7b81e47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {View} from 'react-native'

import {atoms as a, useTheme} from '#/alf'
import * as Skele from '#/components/Skeleton'
import {Text} from '#/components/Typography'
import * as SettingsList from '../../components/SettingsList'

export function ItemTextWithSubtitle({
  titleText,
  subtitleText,
  bold = false,
  showSkeleton = false,
}: {
  titleText: React.ReactNode
  subtitleText: React.ReactNode
  bold?: boolean
  showSkeleton?: boolean
}) {
  const t = useTheme()
  return (
    <View style={[a.flex_1, bold ? a.gap_xs : a.gap_2xs]}>
      <SettingsList.ItemText style={bold && [a.font_bold, a.text_lg]}>
        {titleText}
      </SettingsList.ItemText>
      {showSkeleton ? (
        <Skele.Text style={[a.text_sm, {width: 120}]} />
      ) : (
        <Text style={[a.text_sm, t.atoms.text_contrast_medium, a.leading_snug]}>
          {subtitleText}
        </Text>
      )}
    </View>
  )
}