This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Consignments] Adds Storyboards and some typography helpers
- Loading branch information
Showing
11 changed files
with
148 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// In TypeScript 2.4 this can turn into an Enum | ||
// https://github.com/Microsoft/TypeScript/pull/15486 | ||
|
||
export default { | ||
"garamond-regular": "AGaramondPro-Regular", | ||
"garamond-italic": "AGaramondPro-Italic", | ||
"avant-garde-regular": "Avant Garde Gothic ITCW01Dm", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/lib/components/consignments/__stories__/consignments.story.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { storiesOf } from "@kadira/react-native-storybook" | ||
import * as React from "react" | ||
import { RootContainer } from "react-relay" | ||
|
||
import Info from "../setup/info" | ||
import Welcome from "../setup/welcome" | ||
|
||
const nav = {} as any | ||
const route = {} as any | ||
|
||
storiesOf("Consignments") | ||
.add("Welcome Page", () => { | ||
return <Welcome navigator={nav} route={route} /> | ||
}) | ||
.add("Info Page", () => { | ||
return <Info navigator={nav} route={route} /> | ||
}) |
24 changes: 24 additions & 0 deletions
24
src/lib/components/consignments/__stories__/typography.story.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { storiesOf } from "@kadira/react-native-storybook" | ||
import * as React from "react" | ||
import { View } from "react-native" | ||
|
||
import Consignment from "../" | ||
import * as T from "../typography" | ||
|
||
const Wrapper = (p) => <View style={{backgroundColor: "black", flex: 1, paddingTop: 20}}>{p.children}</View> | ||
|
||
storiesOf("Consignments - Type") | ||
|
||
.add("Type Reference", () => | ||
<Wrapper> | ||
<T.LargeHeadline>Large Headline</T.LargeHeadline> | ||
<T.SmallHeadline>Small Headline</T.SmallHeadline> | ||
<T.Subtitle>Subtitle</T.Subtitle> | ||
</Wrapper>, | ||
) | ||
|
||
.add("blank", () => | ||
<Wrapper> | ||
<T.Subtitle>Subtitle</T.Subtitle> | ||
</Wrapper>, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import * as React from "react" | ||
import { StyleSheet, Text, TextProperties, TextStyle } from "react-native" | ||
|
||
import colors from "../../../../data/colors" | ||
import fonts from "../../../../data/fonts" | ||
|
||
const LargeHeadline = (props: TextProperties) => { | ||
const children: string = (props as any).children | ||
const style = [styles.largeDefault, props.style || {}, styles.largeRequired] | ||
return <Text key={children} style ={style}>{children}</Text> | ||
} | ||
|
||
const SmallHeadline = (props: TextProperties) => { | ||
const children: string = (props as any).children | ||
const style = [styles.smallDefault, props.style || {}, styles.smallRequired] | ||
return <Text key={children} style ={style}>{children}</Text> | ||
} | ||
|
||
const Subtitle = (props: TextProperties) => { | ||
const children: string = (props as any).children | ||
const style = [styles.subtitleDefault, props.style || {}, styles.subtitleRequired] | ||
return <Text key={children} style ={style}>{children}</Text> | ||
} | ||
|
||
export { | ||
LargeHeadline, | ||
SmallHeadline, | ||
Subtitle | ||
} | ||
|
||
interface Styles { | ||
largeRequired: TextStyle | ||
largeDefault: TextStyle | ||
smallRequired: TextStyle | ||
smallDefault: TextStyle | ||
subtitleRequired: TextStyle | ||
subtitleDefault: TextStyle | ||
} | ||
|
||
const styles = StyleSheet.create<Styles>({ | ||
largeDefault: { | ||
fontSize: 30, | ||
color: "white", | ||
textAlign: "center", | ||
}, | ||
|
||
largeRequired: { | ||
fontFamily: fonts["garamond-regular"], | ||
}, | ||
|
||
smallDefault: { | ||
fontSize: 30, | ||
color: "white", | ||
textAlign: "center", | ||
}, | ||
|
||
smallRequired: { | ||
fontFamily: fonts["garamond-regular"], | ||
}, | ||
|
||
subtitleDefault: { | ||
fontSize: 20, | ||
color: colors["gray-medium"], | ||
paddingLeft: 25, | ||
paddingRight: 25, | ||
}, | ||
|
||
subtitleRequired: { | ||
fontFamily: fonts["garamond-italic"], | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { storiesOf } from "@kadira/react-native-storybook" | ||
import * as React from "react" | ||
import { RootContainer } from "react-relay" | ||
|
||
import Headline from "../headline" | ||
import Serif from "../serif" | ||
|
||
storiesOf("🎨 Typography") | ||
.add("App Headline", () => { | ||
return <Headline>This is a balnk headline</Headline> | ||
}) | ||
.add("App Serif Text", () => { | ||
return <Serif>This is a blank serif</Serif> | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
import "./lib/components/text/__stories__/typography.story" | ||
import "./lib/components/buttons/__stories__/buttons.story" | ||
|
||
import "./lib/containers/__stories__" | ||
import "./lib/components/artist/__stories__" | ||
import "./lib/components/consignments/__stories__/consignments.story" | ||
import "./lib/components/consignments/__stories__/typography.story" |
This file was deleted.
Oops, something went wrong.