about summary refs log tree commit diff
path: root/src/view/com/util/LoadMoreRetryBtn.tsx
blob: 07bd733eadb29fc9bcde05da7c505c2227cf39f0 (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
35
36
37
38
39
40
41
42
43
44
import {StyleSheet} from 'react-native'
import {
  FontAwesomeIcon,
  FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'

import {usePalette} from '#/lib/hooks/usePalette'
import {Button} from './forms/Button'
import {Text} from './text/Text'

export function LoadMoreRetryBtn({
  label,
  onPress,
}: {
  label: string
  onPress: () => void
}) {
  const pal = usePalette('default')
  return (
    <Button type="default-light" onPress={onPress} style={styles.loadMoreRetry}>
      <FontAwesomeIcon
        icon="arrow-rotate-left"
        style={pal.textLight as FontAwesomeIconStyle}
        size={18}
      />
      <Text style={[pal.textLight, styles.label]}>{label}</Text>
    </Button>
  )
}

const styles = StyleSheet.create({
  loadMoreRetry: {
    flexDirection: 'row',
    gap: 14,
    alignItems: 'center',
    borderRadius: 0,
    marginTop: 1,
    paddingVertical: 12,
    paddingHorizontal: 20,
  },
  label: {
    flex: 1,
  },
})