diff --git a/packages/react-silk-docs/src/components/Anchors.tsx b/packages/react-silk-docs/src/components/Anchors.tsx index 9935b69..4e8926a 100644 --- a/packages/react-silk-docs/src/components/Anchors.tsx +++ b/packages/react-silk-docs/src/components/Anchors.tsx @@ -33,5 +33,8 @@ export default () => ( Input Pins + + Name Card + ) diff --git a/packages/react-silk-docs/src/demo/NameCardDemo.tsx b/packages/react-silk-docs/src/demo/NameCardDemo.tsx new file mode 100644 index 0000000..5bc5095 --- /dev/null +++ b/packages/react-silk-docs/src/demo/NameCardDemo.tsx @@ -0,0 +1,30 @@ +import * as React from 'react' +import { NameCard } from 'react-silk-ui' +import styled from 'styled-components' + +const NameCardWrapper = styled.div` + display: flex; + > div > div { + margin-bottom: 0.5rem; + } +` + +export default () => ( +
+ +
+ + +
+
+
+) diff --git a/packages/react-silk-docs/src/pages/components/namecard.tsx b/packages/react-silk-docs/src/pages/components/namecard.tsx new file mode 100644 index 0000000..36ea30a --- /dev/null +++ b/packages/react-silk-docs/src/pages/components/namecard.tsx @@ -0,0 +1,9 @@ +import * as React from 'react' +import MyMom from '.' +import NameCardDemo from '../../demo/NameCardDemo' + +export default () => ( + + + +) diff --git a/packages/react-silk-ui/src/components/NameCard.tsx b/packages/react-silk-ui/src/components/NameCard.tsx new file mode 100644 index 0000000..1b233dd --- /dev/null +++ b/packages/react-silk-ui/src/components/NameCard.tsx @@ -0,0 +1,64 @@ +import * as React from 'react' +import { View, Image, StyleSheet } from 'react-native' +import { Heading5, Heading6, Text } from './Text' +import Colors from './Colors' +import Spacing from './Spacing' + +const styles = StyleSheet.create({ + container: { + flex: 1, + }, + nameCardWrapper: { + flex: 1, + padding: 10, + backgroundColor: Colors.white, + flexDirection: 'row', + borderWidth: 1, + borderColor: Colors.gray, + }, + contentWrapper: { + flex: 1, + justifyContent: 'center', + }, + image: { + width: 80, + height: 80, + }, + orderReverse: { + flexDirection: 'row-reverse', + }, + title: { + marginBottom: 0, + }, +}) + +export interface Props { + image?: string + title: string + subTitle?: string + rtl?: boolean +} + +export const NameCard = ({ image, title, subTitle, rtl }: Props) => { + const orderStyles = [] + if (!rtl) { + orderStyles.push(styles.orderReverse) + } + return ( + + + + {title} + {subTitle} + + + + + ) +} + +NameCard.defaultProps = { + rtl: false, +} diff --git a/packages/react-silk-ui/src/components/Spacing.ts b/packages/react-silk-ui/src/components/Spacing.ts new file mode 100644 index 0000000..f95dfab --- /dev/null +++ b/packages/react-silk-ui/src/components/Spacing.ts @@ -0,0 +1,10 @@ +import { StyleSheet } from 'react-native' + +export default StyleSheet.create({ + pr10: { + paddingRight: 10, + }, + pl10: { + paddingLeft: 10, + }, +}) diff --git a/packages/react-silk-ui/src/index.ts b/packages/react-silk-ui/src/index.ts index 1efa1bb..6296d2a 100644 --- a/packages/react-silk-ui/src/index.ts +++ b/packages/react-silk-ui/src/index.ts @@ -18,6 +18,7 @@ import { DropdownItem } from './components/Dropdown/Item' import { Carousel } from './components/Carousel' import * as Colors from './components/Colors' import { InputPin } from './components/InputPin' +import { NameCard } from './components/NameCard' export { Text, @@ -39,6 +40,7 @@ export { DropdownItem, Carousel, InputPin, + NameCard, } export default { @@ -61,4 +63,5 @@ export default { DropdownItem, Carousel, InputPin, + NameCard, }