import { storiesOf } from "@storybook/react-native" import { Box, Flex } from "palette" import React from "react" import { Platform, Text as RNText, TextStyle, View } from "react-native" import { withTheme } from "storybook/decorators" import { DataList, List } from "storybook/helpers" import { LinkText, Text, TextProps } from "." const variants: Array = ["xs", "sm", "md", "lg", "xl", "xxl"] storiesOf("Theme/Text", module) .addDecorator(withTheme) .add("Variants", () => ( ( {variant} ~~ This is a text. )} /> )) .add("Variants in boxes", () => ( ( {variant} ~~ This is a text. )} /> )) .add("Basic props", () => ( regular ~~ This is a text. LinkText. caps ~~ This is a text. italics ~~ This is a text. caps italics ~~ This is a text. weight: medium ~~ This is a text. )) .add("Misc", () => ( Testing the other props )) // this is useful for making sure our custom fonts are rendering at the same height for ios and android .add("Font centering (raw)", () => { const style: TextStyle = { borderWidth: 1, borderColor: "black", fontSize: 16, lineHeight: 16 } const systemFontStyle: TextStyle = Platform.OS === "android" ? { textAlignVertical: "bottom" } : {} // this we add in our Text in palette-eigen const unicaFontStyle: TextStyle = Platform.OS === "android" ? { textAlignVertical: "center" } : {} // this we add in our Text in palette-eigen return ( System font regular TEXT. ALL CAPS text. Unica custom font regular TEXT. ALL CAPS text. ) }) // this is useful for making sure our custom fonts are rendering at the same height for ios and android .add("Font centering (palette)", () => { const style: TextStyle = { borderWidth: 1, borderColor: "black", fontSize: 16, lineHeight: 16 } return ( System font regular TEXT. ALL CAPS text. ) })