From a329dd023935f54c1235e6ebfe453f02848291e5 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Sun, 12 Nov 2017 18:58:04 +0100 Subject: [PATCH] EventList: Style fixes --- __tests__/index.js | 1 + src/App.js | 1 - src/modules/events/EventList.js | 30 ++++++++++++++++++++++++------ src/theme.js | 6 +++--- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/__tests__/index.js b/__tests__/index.js index 9da8020..02e3775 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -1,6 +1,7 @@ import 'react-native'; import React from 'react'; import App from '../src/App'; +import 'isomorphic-fetch'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; diff --git a/src/App.js b/src/App.js index acf245a..f8ce82b 100644 --- a/src/App.js +++ b/src/App.js @@ -10,7 +10,6 @@ import {ApolloClient} from 'apollo-client'; import {HttpLink} from 'apollo-link-http'; import {InMemoryCache} from 'apollo-cache-inmemory'; import {ApolloProvider} from "react-apollo"; -import 'isomorphic-fetch'; import Dusken from "./Dusken"; import duskenApp from "./reducers"; diff --git a/src/modules/events/EventList.js b/src/modules/events/EventList.js index 4d89d2b..8c448cc 100644 --- a/src/modules/events/EventList.js +++ b/src/modules/events/EventList.js @@ -21,9 +21,9 @@ export default class EventList extends Component { ); _renderSectionHeader = ({section}) => { - return ( + return ( - {section.title} + {section.title} ); }; @@ -72,7 +72,8 @@ export default class EventList extends Component { onEndReachedThreshould={10} initialNumToRender={10} ListFooterComponent={this._renderFooter} - style={[styles.list, {paddingRight: 0}]} + style={[styles.card, styles.list]} + ListHeaderComponent={() => { return }} />); } } @@ -80,6 +81,7 @@ export default class EventList extends Component { const styles = StyleSheet.create({ listItem: { + backgroundColor: 'white', marginLeft: 0 }, listItemTitle: { @@ -89,13 +91,29 @@ const styles = StyleSheet.create({ fontSize: 14, color: '#666' }, - listItemSectionTitle: { - fontSize: 14, + sectionHeader: { + backgroundColor: 'white', + marginLeft: 0, + marginBottom: -8, + paddingBottom: 0, + borderBottomWidth: 0, + }, + sectionTitle: { + fontSize: 16, fontWeight: 'bold', }, loadingText: { textAlign: 'center', paddingBottom: 8 }, - list: theme.card, + card: theme.card, + list: { + padding: 0, + marginTop: 0, + marginBottom: 0, + backgroundColor: 'transparent', + }, + listHeader: { + paddingTop: 8, + } }); \ No newline at end of file diff --git a/src/theme.js b/src/theme.js index fdde701..729db2a 100644 --- a/src/theme.js +++ b/src/theme.js @@ -1,8 +1,8 @@ import { Platform } from "react-native"; +const colors = {}; + const card = { - borderColor: '#e1e8ee', - borderWidth: 1, ...Platform.select({ ios: { shadowColor: 'rgba(0,0,0, .2)', @@ -18,4 +18,4 @@ const card = { margin: 8, backgroundColor: '#fff', }; -export default {card}; \ No newline at end of file +export default {card, colors}; \ No newline at end of file