Skip to content

Commit

Permalink
Airtable schema updates for hiding stores and 'stocks other vendors' …
Browse files Browse the repository at this point in the history
…message (#165)

* Update schema

* Hide stores marked as Do not display

* Add message for stores that stock other products

* Remove clerk training store ID

* Update status bar color contrast

* Update SNAP Match to SNAP Back

* Open privacy policy in web browser

* Update EBT to SNAP/EBT

* Revert SNAP Back to SNAP Match

* Column type updates
  • Loading branch information
wangannie authored Jun 28, 2020
1 parent aa09221 commit 6ed3dcb
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 169 deletions.
5 changes: 3 additions & 2 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { FontAwesome5 } from '@expo/vector-icons';
import { AppLoading } from 'expo';
import { Asset } from 'expo-asset';
import * as Font from 'expo-font';
import { StatusBar } from 'expo-status-bar';
import React, { useState } from 'react';
import { Platform, StatusBar, StyleSheet, View } from 'react-native';
import { Platform, StyleSheet, View } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import * as Sentry from 'sentry-expo';
import Colors from './constants/Colors';
Expand Down Expand Up @@ -32,7 +33,7 @@ export default function App(props) {
return (
<SafeAreaProvider>
<View style={styles.container}>
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
{Platform.OS === 'ios' && <StatusBar style="dark" />}
<AppNavigator />
</View>
</SafeAreaProvider>
Expand Down
69 changes: 41 additions & 28 deletions components/product/StoreProducts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import Colors from '../../constants/Colors';
import Window from '../../constants/Layout';
import { SpaceBetweenRowContainer } from '../../styled/shared';
import {
ColumnContainer,
RowContainer,
SpaceBetweenRowContainer,
} from '../../styled/shared';
import { StoreDetailText } from '../../styled/store';
import { Body, ButtonContainer, Subtitle, Title } from '../BaseComponents';
import StoreCard from '../store/StoreCard';
Expand All @@ -17,31 +21,37 @@ function StoreProducts({ navigation, store, products, showDefaultStore }) {
<View>
<StoreCard store={store} key={store.id} seeDistance={!showDefaultStore} />
<View>
<SpaceBetweenRowContainer margin={16}>
<View style={{ flexDirection: 'row' }}>
<Title>Products</Title>
{products.length > 0 && (
<StoreDetailText
color={Colors.secondaryText}
style={{ marginTop: 7 }}>
recently delivered
</StoreDetailText>
)}
</View>

<ButtonContainer
onPress={() =>
navigation.navigate('Products', {
products,
navigation,
store,
})
}>
{products.length > 0 && (
<Subtitle>{`See all ${products.length}`}</Subtitle>
)}
</ButtonContainer>
</SpaceBetweenRowContainer>
<ColumnContainer>
<SpaceBetweenRowContainer margin={16}>
<RowContainer>
<Title>Products</Title>
{products.length > 0 && (
<StoreDetailText
color={Colors.secondaryText}
style={{ marginTop: 7 }}>
recently delivered
</StoreDetailText>
)}
</RowContainer>
<ButtonContainer
onPress={() =>
navigation.navigate('Products', {
products,
navigation,
store,
})
}>
{products.length > 0 && (
<Subtitle>{`See all ${products.length}`}</Subtitle>
)}
</ButtonContainer>
</SpaceBetweenRowContainer>
{store.stocksOtherVendors && (
<Body style={{ marginHorizontal: 16, marginTop: -16 }}>
This store regularly stocks additional produce from other vendors.
</Body>
)}
</ColumnContainer>
<FlatList
horizontal
showsHorizontalScrollIndicator={false}
Expand All @@ -68,8 +78,11 @@ function StoreProducts({ navigation, store, products, showDefaultStore }) {
color={Colors.primaryGray}
style={{ marginBottom: 12 }}
/>
<Body color={Colors.secondaryText}>
No deliveries in the last 7 days...check back later!
<Body
style={{ textAlign: 'center' }}
color={Colors.secondaryText}>
No Healthy Corners deliveries in the last 7 days. Check back
later!
</Body>
</View>
}
Expand Down
4 changes: 2 additions & 2 deletions components/store/AcceptedPrograms.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ProgramTag from './ProgramTag';
* */

const programToDesc = {
EBT: 'Accepts SNAP/EBT',
'SNAP/EBT': 'Accepts SNAP/EBT',
WIC: 'WIC approved',
'SNAP Match':
'Spend $5 with SNAP and include fresh produce in purchase to get $5 free on fresh produce',
Expand Down Expand Up @@ -60,7 +60,7 @@ export default function AcceptedPrograms({
return (
<ColumnContainer
style={{ justifyContent: 'space-between', paddingRight: '20%' }}>
{snapOrEbtAccepted && <Program programName="EBT" />}
{snapOrEbtAccepted && <Program programName="SNAP/EBT" />}
{wic && <Program programName="WIC" />}
{couponProgramPartner && <Program programName="SNAP Match" />}
{rewardsAccepted && <Program programName="Healthy Rewards" />}
Expand Down
4 changes: 2 additions & 2 deletions components/store/ProgramTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function ProgramTag({ program, tag = false, selected = false, selectedFunc }) {
// they enter the wrong string of words
if (
(program.toLowerCase() === 'wic' && program !== 'WIC') ||
(program.toLowerCase() === 'ebt' && program !== 'EBT')
(program.toLowerCase() === 'snap/ebt' && program !== 'SNAP/EBT')
) {
programLabel = program.toUpperCase();
}
Expand All @@ -54,7 +54,7 @@ function ProgramTag({ program, tag = false, selected = false, selectedFunc }) {
}

const labelToIcon = {
EBT: 'credit-card',
'SNAP/EBT': 'credit-card',
WIC: 'heart',
'SNAP Match': 'carrot',
'Healthy Rewards': 'star',
Expand Down
2 changes: 1 addition & 1 deletion components/store/StoreCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function StoreCard({ store, storeList, seeDistance }) {
flexWrap: 'wrap',
marginTop: 6,
}}>
{snapOrEbtAccepted && <ProgramTag program="EBT" />}
{snapOrEbtAccepted && <ProgramTag program="SNAP/EBT" />}
{wic && <ProgramTag program="WIC" />}
{couponProgramPartner && <ProgramTag program="SNAP Match" />}
{rewardsAccepted && <ProgramTag program="Healthy Rewards" />}
Expand Down
3 changes: 0 additions & 3 deletions constants/RecordIds.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { env } from '../environment';
const RecordIds = {
testCustomerId: null,
guestCustomerId: null,
clerkTrainingStoreId: null,
defaultStoreId: null,
};

Expand All @@ -13,14 +12,12 @@ const RecordIds = {
if (env === 'dev') {
RecordIds.testCustomerId = 'recimV9zs2StWB2Mj';
RecordIds.guestCustomerId = 'recLKK7cZHboMPEB8';
RecordIds.clerkTrainingStoreId = 'reck65q6wsvyQvnLf';
RecordIds.defaultStoreId = 'recKmetaavnMWXVrk';

// IDs from PROD base
} else if (env === 'prod') {
RecordIds.testCustomerId = 'recomWMtzSUQCcIvr';
RecordIds.guestCustomerId = 'recxEGfvExP4Dv8nr';
RecordIds.clerkTrainingStoreId = 'recq6630DixVw63un';
RecordIds.defaultStoreId = 'recQmf64hlp9CyBas';
}

Expand Down
3 changes: 3 additions & 0 deletions lib/airtable/airtable.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ function deleteRecord(table, id) {
}

export {
base,
fromAirtableFormat,
toAirtableFormat,
createRecord,
getAllRecords,
getRecordById,
Expand Down
Loading

0 comments on commit 6ed3dcb

Please sign in to comment.