DeFiCh/wallet

View on GitHub
mobile-app/app/components/themed/ThemedSectionTitleV2.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { StyleProp, TextProps, ViewStyle } from "react-native";
import { tailwind } from "@tailwind";
import { ThemedProps } from ".";
import { ThemedText } from "./ThemedText";

type SectionTitleProp = TextProps & ThemedProps & IThemedSectionTitle;

interface IThemedSectionTitle {
  text: string;
  customStyle?: StyleProp<ViewStyle>;
}

export function ThemedSectionTitleV2(props: SectionTitleProp): JSX.Element {
  const {
    style = [
      tailwind("px-5 pt-6 pb-2 text-xs font-normal-v2"),
      props.customStyle,
    ],
    light = tailwind("text-mono-light-v2-500"),
    dark = tailwind("text-mono-dark-v2-500"),
    ...otherProps
  } = props;

  return (
    <ThemedText dark={dark} light={light} style={style} {...otherProps}>
      {props.text}
    </ThemedText>
  );
}