From fbad882d3c0a0cc9a742acdedb53e675b413ab34 Mon Sep 17 00:00:00 2001 From: dfrho Date: Fri, 3 Aug 2018 16:11:37 -0400 Subject: [PATCH 1/3] fix(pirateship): fixes prods text and shop all cats to dark gray --- .../src/components/PSProductCarousel.tsx | 14 ++++++++++---- packages/pirateship/src/screens/Shop.tsx | 17 +++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/packages/pirateship/src/components/PSProductCarousel.tsx b/packages/pirateship/src/components/PSProductCarousel.tsx index d6ba9fb121..37841f0895 100644 --- a/packages/pirateship/src/components/PSProductCarousel.tsx +++ b/packages/pirateship/src/components/PSProductCarousel.tsx @@ -9,6 +9,9 @@ import { fontSize, palette } from '../styles/variables'; const styles = StyleSheet.create({ container: {}, + brandText: { + color: palette.secondary + }, item: { marginLeft: 15 }, @@ -20,14 +23,16 @@ const styles = StyleSheet.create({ }, productTitle: { fontWeight: 'normal', - fontSize: 13 + fontSize: 13, + color: palette.secondary }, productPriceText: { fontSize: 15 }, productPrice: { justifyContent: 'center', - marginTop: 5 + marginTop: 5, + color: palette.secondary }, priceContainer: { marginBottom: 0 @@ -54,7 +59,7 @@ export interface PSProductCarouselProps { export default class PSProductCarousel extends Component< PSProductCarouselProps -> { + > { render(): JSX.Element { return ( , - Pick {} + Pick, + Pick { } class Shop extends Component { static navigatorStyle: NavigatorStyle = navBarFullBleed; @@ -215,8 +216,8 @@ class Shop extends Component { { private renderPromoProducts = (): React.ReactNode => { if (!(this.props.promoProducts - && this.props.promoProducts.products - && projectEnv.dataSource - && projectEnv.dataSource.promoProducts)) { + && this.props.promoProducts.products + && projectEnv.dataSource + && projectEnv.dataSource.promoProducts)) { return null; } From 833c90c4d4811e74c22e9de8ebf58017fe4ad374 Mon Sep 17 00:00:00 2001 From: dfrho Date: Wed, 8 Aug 2018 16:34:48 -0400 Subject: [PATCH 2/3] fix(pirateship): fixes navigator typing and merge conflict --- .../src/components/PSProductCarousel.tsx | 1 + .../src/components/PSScreenWrapper.tsx | 6 +- packages/pirateship/src/screens/Shop.tsx | 108 +++++++++++------- 3 files changed, 73 insertions(+), 42 deletions(-) diff --git a/packages/pirateship/src/components/PSProductCarousel.tsx b/packages/pirateship/src/components/PSProductCarousel.tsx index 37841f0895..f198349fb8 100644 --- a/packages/pirateship/src/components/PSProductCarousel.tsx +++ b/packages/pirateship/src/components/PSProductCarousel.tsx @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; + import { MultiCarousel, ProductItem, diff --git a/packages/pirateship/src/components/PSScreenWrapper.tsx b/packages/pirateship/src/components/PSScreenWrapper.tsx index 83ada0b6ab..40e3b78020 100644 --- a/packages/pirateship/src/components/PSScreenWrapper.tsx +++ b/packages/pirateship/src/components/PSScreenWrapper.tsx @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; - +import { Navigator } from 'react-native-navigation'; import { Animated, KeyboardAvoidingView, @@ -29,6 +29,7 @@ const styles = StyleSheet.create({ } }); + export interface PSScreenWrapperProps { style?: StyleProp; @@ -36,6 +37,7 @@ export interface PSScreenWrapperProps { overrideGlobalBanner?: PSGlobalBannerSlotItem; needInSafeArea?: boolean; + navigator?: Navigator; // Whether or not the wrapper should scroll it's children. Defaults to true scroll?: boolean; @@ -46,7 +48,7 @@ export interface PSScreenWrapperProps { export default class PSScreenWrapper extends PureComponent< PSScreenWrapperProps -> { + > { state: any = { safeAreaInsets: { top: 0, diff --git a/packages/pirateship/src/screens/Shop.tsx b/packages/pirateship/src/screens/Shop.tsx index 7bcc7f57f4..312b5ba282 100644 --- a/packages/pirateship/src/screens/Shop.tsx +++ b/packages/pirateship/src/screens/Shop.tsx @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { + Image, Keyboard, Linking, Platform, @@ -24,7 +25,7 @@ import PSShopLandingCategories from '../components/PSShopLandingCategories'; import { openSignInModal } from '../lib/shortcuts'; import { handleDeeplink } from '../lib/deeplinkHandler'; import GlobalStyle from '../styles/Global'; -import { border, color, palette } from '../styles/variables'; +import { border, color, fontSize, palette } from '../styles/variables'; import { navBarFullBleed } from '../styles/Navigation'; import { NavigatorStyle, ScreenProps } from '../lib/commonTypes'; import { CombinedStore } from '../reducers'; @@ -49,7 +50,6 @@ const ShopStyle = StyleSheet.create({ backgroundColor: palette.primary }, container: { - backgroundColor: palette.background, flex: 1 }, heroCarousel: {}, @@ -98,16 +98,28 @@ const ShopStyle = StyleSheet.create({ }, topCategoriesContainer: { flexDirection: 'row', - justifyContent: 'space-between' + justifyContent: 'space-between', + alignItems: 'center', + marginHorizontal: 5 + }, + viewAllArrow: { + maxWidth: 15, + maxHeight: 15, + marginHorizontal: 10, + transform: [{ rotate: '180deg' }] }, viewAllButtonTitle: { - fontSize: 16, + fontSize: fontSize.large, color: color.black }, viewAllButton: { flexDirection: 'row-reverse', justifyContent: 'flex-start', alignItems: 'center' + }, + viewAllContainer: { + flexDirection: 'row', + alignItems: 'center' } }); @@ -122,19 +134,21 @@ class Shop extends Component { constructor(props: ShopProps) { super(props); - Linking.getInitialURL() - .then(url => { - if (url) { - handleDeeplink(url, props.navigator); - } - }) - .catch(err => { - console.warn('Deeplinking error', err); - }); + if (Platform.OS !== 'web') { + Linking.getInitialURL() + .then(url => { + if (url) { + handleDeeplink(url, props.navigator); + } + }) + .catch(err => { + console.warn('Deeplinking error', err); + }); - Linking.addEventListener('url', event => { - handleDeeplink(event.url, props.navigator); - }); + Linking.addEventListener('url', event => { + handleDeeplink(event.url, props.navigator); + }); + } // Listen for navigator events this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this)); @@ -178,7 +192,8 @@ class Shop extends Component { if (navAction.screen) { // switch to shop tab if it's not already visible - this.props.navigator.screenIsCurrentlyVisible() + this.props.navigator + .screenIsCurrentlyVisible() .then(visible => { if (!visible) { this.props.navigator.switchToTab(); @@ -193,7 +208,8 @@ class Shop extends Component { handleCategoryItemPress = (item: any) => { // Shopify doesn't have the concept of subcategories so always direct users to product index - const screen = dataSourceConfig.type === 'shopify' ? 'ProductIndex' : 'Category'; + const screen = + dataSourceConfig.type === 'shopify' ? 'ProductIndex' : 'Category'; this.props.navigator.push({ screen, @@ -206,21 +222,25 @@ class Shop extends Component { } render(): JSX.Element { + const { account, navigator, topCategory } = this.props; return ( { {translate.string(translationKeys.screens.shop.shopAllBtn)} - + + + + {translate.string(translationKeys.screens.shop.viewAllBtn)} + + + + + @@ -278,7 +297,9 @@ class Shop extends Component { @@ -329,10 +350,14 @@ class Shop extends Component { } private renderPromoProducts = (): React.ReactNode => { - if (!(this.props.promoProducts - && this.props.promoProducts.products - && projectEnv.dataSource - && projectEnv.dataSource.promoProducts)) { + if ( + !( + this.props.promoProducts && + this.props.promoProducts.products && + projectEnv.dataSource && + projectEnv.dataSource.promoProducts + ) + ) { return null; } @@ -370,4 +395,7 @@ const mapStateToProps = (combinedStore: CombinedStore, ownProps: any) => { }; }; -export default connect(mapStateToProps, mapDispatchToProps)(Shop); +export default connect( + mapStateToProps, + mapDispatchToProps +)(Shop); From 4da1c0273523f58d9584bd7760259dc330aa59ad Mon Sep 17 00:00:00 2001 From: dfrho Date: Mon, 13 Aug 2018 13:26:29 -0400 Subject: [PATCH 3/3] fix(pirateship): removes extraneous navigator type --- packages/pirateship/src/components/PSScreenWrapper.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/pirateship/src/components/PSScreenWrapper.tsx b/packages/pirateship/src/components/PSScreenWrapper.tsx index c5325fd7d2..f31d1575bc 100644 --- a/packages/pirateship/src/components/PSScreenWrapper.tsx +++ b/packages/pirateship/src/components/PSScreenWrapper.tsx @@ -1,5 +1,4 @@ import React, { PureComponent } from 'react'; -import { Navigator } from 'react-native-navigation'; import { Animated, KeyboardAvoidingView, @@ -38,14 +37,14 @@ export interface PSScreenWrapperProps { overrideGlobalBanner?: PSGlobalBannerSlotItem; needInSafeArea?: boolean; - navigator?: Navigator; // Whether or not the wrapper should scroll it's children. Defaults to true scroll?: boolean; scrollViewProps?: ScrollViewProps; keyboardAvoidingViewProps?: KeyboardAvoidingViewProps; - navigator: import ('react-native-navigation').Navigator; + // tslint:disable-next-line:whitespace + navigator: import('react-native-navigation').Navigator; hideWebHeader?: boolean; }