-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from iRaySpace/master
refactor: Listing components
- Loading branch information
Showing
13 changed files
with
569 additions
and
447 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,21 @@ | ||
import * as React from "react"; | ||
import { View, StyleSheet } from "react-native"; | ||
|
||
const ListingColumnComponent = props => { | ||
const { view, last } = styles; | ||
const viewStyle = props.last ? StyleSheet.flatten([view, last]) : view; | ||
|
||
return <View style={viewStyle}>{props.children}</View>; | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
view: { | ||
flex: 1, | ||
marginRight: 30, | ||
}, | ||
last: { | ||
marginRight: 0, | ||
}, | ||
}); | ||
|
||
export default ListingColumnComponent; |
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,25 @@ | ||
import * as React from "react"; | ||
import { StyleSheet } from "react-native"; | ||
import { Item } from "native-base"; | ||
|
||
const ListingItemComponent = props => { | ||
const { item, half } = styles; | ||
const itemStyle = props.half ? StyleSheet.flatten([item, half]) : item; | ||
|
||
return ( | ||
<Item regular style={itemStyle}> | ||
{props.children} | ||
</Item> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
item: { | ||
marginBottom: 10, | ||
}, | ||
half: { | ||
width: "50%", | ||
}, | ||
}); | ||
|
||
export default ListingItemComponent; |
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,16 @@ | ||
import * as React from "react"; | ||
import { StyleSheet } from "react-native"; | ||
import { Text } from "native-base"; | ||
|
||
const ListingLabelComponent = props => ( | ||
<Text style={styles.text}>{props.text}</Text> | ||
); | ||
|
||
const styles = StyleSheet.create({ | ||
text: { | ||
fontWeight: "bold", | ||
marginBottom: 10, | ||
}, | ||
}); | ||
|
||
export default ListingLabelComponent; |
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,12 @@ | ||
import * as React from "react"; | ||
import { View, StyleSheet } from "react-native"; | ||
|
||
const ListingRowComponent = props => ( | ||
<View style={styles.view}>{props.children}</View> | ||
); | ||
|
||
const styles = StyleSheet.create({ | ||
view: { flexDirection: "row" }, | ||
}); | ||
|
||
export default ListingRowComponent; |
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,15 @@ | ||
import * as React from "react"; | ||
import { View, StyleSheet } from "react-native"; | ||
|
||
const SectionBreakComponent = props => <View style={styles.view} />; | ||
|
||
const styles = StyleSheet.create({ | ||
view: { | ||
borderTopWidth: 1, | ||
borderTopColor: "#D9D5DC", | ||
paddingTop: 10, | ||
marginTop: 15, | ||
}, | ||
}); | ||
|
||
export default SectionBreakComponent; |
Oops, something went wrong.