about summary refs log tree commit diff
path: root/src/view/com/util/PostSandboxWarning.tsx
blob: b2375c7039d8f3a2d1dbebba5ca1a00c2ec2eb86 (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
import React from 'react'
import {StyleSheet, View} from 'react-native'
import {Text} from './text/Text'
import {usePalette} from 'lib/hooks/usePalette'
import {useSession} from '#/state/session'

export function PostSandboxWarning() {
  const {isSandbox} = useSession()
  const pal = usePalette('default')
  if (isSandbox) {
    return (
      <View style={styles.container}>
        <Text
          type="title-2xl"
          style={[pal.text, styles.text]}
          accessible={false}>
          SANDBOX
        </Text>
      </View>
    )
  }
  return null
}

const styles = StyleSheet.create({
  container: {
    position: 'absolute',
    top: 6,
    right: 10,
  },
  text: {
    fontWeight: 'bold',
    opacity: 0.07,
  },
})