about summary refs log tree commit diff
path: root/src/components/video/PlayButtonIcon.tsx
blob: 90e93f744b5b85892d216e5eee48bda5c3df8ccd (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
45
46
47
48
import React from 'react'
import {View} from 'react-native'

import {atoms as a, useTheme} from '#/alf'
import {Play_Filled_Corner0_Rounded as PlayIcon} from '#/components/icons/Play'

export function PlayButtonIcon({size = 36}: {size?: number}) {
  const t = useTheme()
  const bg = t.name === 'light' ? t.palette.contrast_25 : t.palette.contrast_975
  const fg = t.name === 'light' ? t.palette.contrast_975 : t.palette.contrast_25

  return (
    <View
      style={[
        a.rounded_full,
        a.overflow_hidden,
        a.align_center,
        a.justify_center,
        t.atoms.shadow_lg,
        {
          width: size + size / 1.5,
          height: size + size / 1.5,
        },
      ]}>
      <View
        style={[
          a.absolute,
          a.inset_0,
          {
            backgroundColor: bg,
            opacity: 0.7,
          },
        ]}
      />
      <PlayIcon
        width={size}
        fill={fg}
        style={[
          a.relative,
          a.z_10,
          {
            left: size / 50,
          },
        ]}
      />
    </View>
  )
}