about summary refs log tree commit diff
path: root/src/view/com/util/LoadLatestBtn.web.tsx
blob: 3889273886448c148e59fb08e70f79a9825c619e (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
import React from 'react'
import {StyleSheet, TouchableOpacity} from 'react-native'
import {Text} from './text/Text'
import {usePalette} from '../../lib/hooks/usePalette'

const HITSLOP = {left: 20, top: 20, right: 20, bottom: 20}

export const LoadLatestBtn = ({onPress}: {onPress: () => void}) => {
  const pal = usePalette('default')
  return (
    <TouchableOpacity
      style={[pal.view, styles.loadLatest]}
      onPress={onPress}
      hitSlop={HITSLOP}>
      <Text type="md-bold" style={pal.text}>
        Load new posts
      </Text>
    </TouchableOpacity>
  )
}

const styles = StyleSheet.create({
  loadLatest: {
    flexDirection: 'row',
    position: 'absolute',
    left: 'calc(50vw - 80px)',
    top: 30,
    shadowColor: '#000',
    shadowOpacity: 0.2,
    shadowOffset: {width: 0, height: 2},
    shadowRadius: 4,
    paddingHorizontal: 24,
    paddingVertical: 10,
    borderRadius: 30,
  },
})