How to use the @ui-kitten/components.useTheme function in @ui-kitten/components

To help you get started, we’ve selected a few @ui-kitten/components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github akveo / react-native-ui-kitten / src / playground / src / components / safeAreaLayout.tsx View on Github external
export const SafeAreaLayout = (props: SafeAreaLayoutProps): LayoutElement => {

  const theme: ThemeType = useTheme();

  const safeAreaInsets: EdgeInsets = useSafeArea();
  const { insets, style, ...layoutProps } = props;


  const toStyleProp = (inset: SaveAreaInset): ViewStyle => {
    switch (inset) {
      case SaveAreaInset.BOTTOM:
        return { paddingBottom: safeAreaInsets.bottom };
      case SaveAreaInset.TOP:
        return {
          backgroundColor: theme['background-basic-color-3'],
          paddingTop: safeAreaInsets.top,
        };
    }
  };