Skip to content

Commit

Permalink
Merge pull request #1077 from overthq/fix-linking
Browse files Browse the repository at this point in the history
General changes
  • Loading branch information
koredefashokun authored Jul 31, 2024
2 parents c3e10fa + f865c6c commit bf5b44d
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 98 deletions.
56 changes: 56 additions & 0 deletions apps/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { ExpoConfig, ConfigContext } from '@expo/config';

export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
name: 'Habiti',
slug: 'habiti',
owner: 'overthq',
version: '1.0.0',
scheme: 'habiti',
orientation: 'portrait',
icon: './assets/icon.png',
splash: {
image: './assets/splash.png',
resizeMode: 'contain',
backgroundColor: '#ffffff'
},
updates: {
fallbackToCacheTimeout: 0
},
assetBundlePatterns: ['**/*'],
ios: {
supportsTablet: true,
bundleIdentifier: 'app.habiti.app',
associatedDomains: ['applinks:habiti.app']
},
android: {
package: 'app.habiti.app',
googleServicesFile: process.env.GOOGLE_SERVICES_JSON,
adaptiveIcon: {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: '#FFFFFF'
},
intentFilters: [
{
action: 'VIEW',
autoVerify: true,
data: [
{
scheme: 'https',
host: 'habiti.app',
pathPrefix: '/store'
}
],
category: ['BROWSABLE', 'DEFAULT']
}
]
},
web: {
favicon: './assets/favicon.png'
},
extra: {
eas: {
projectId: 'f09782f6-8048-4ad4-8ff1-3fb7a65fbe48'
}
}
});
55 changes: 0 additions & 55 deletions apps/app/app.json

This file was deleted.

3 changes: 1 addition & 2 deletions apps/app/eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
"submit": {
"production": {
"android": {
"track": "internal",
"releaseStatus": "draft"
"track": "alpha"
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions apps/app/src/components/explore/ExploreMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ const styles = StyleSheet.create({
container: {
borderTopWidth: 0.5,
paddingTop: 12
},
dialog: {
marginHorizontal: 16
}
});

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/home/OrderStatusPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const OrderStatusPill: React.FC<OrderStatusPillProps> = ({ status }) => {
const styles = StyleSheet.create({
container: {
alignSelf: 'flex-start',
paddingVertical: 2,
paddingVertical: 4,
paddingHorizontal: 8,
borderRadius: 4,
justifyContent: 'center',
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/home/RecentOrders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const RecentOrders: React.FC<RecentOrdersProps> = ({ orders }) => {
preset='sectionHeader'
style={{ marginLeft: 16, marginBottom: 8 }}
>
Recent Orders
Recent orders
</Typography>
{!orders || orders?.length === 0 ? (
<ListEmpty
Expand Down
18 changes: 8 additions & 10 deletions apps/app/src/components/product/QuantityControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ interface QuantityControlProps {
}

// TODO:
// Simply, this should work as follows:
// The "Add to cart" button is a commit button.
// The quantity control button is local.
// Once it is out of sync with the reality on the server,
// The commit button (add to cart/update quantity) is enabled.
// The only prop it needs is the server quantity.

// NOTICE: This component currently does NOT work!
// Add disabled state (color) for decrement button when quantity is 1
// Add disabled state for both buttons (and text) when inCart is true

const QuantityControl: React.FC<QuantityControlProps> = ({
inCart,
Expand All @@ -39,13 +33,17 @@ const QuantityControl: React.FC<QuantityControlProps> = ({
<View
style={[styles.controls, { backgroundColor: theme.input.background }]}
>
<Pressable disabled={inCart || decrementDisabled} onPress={decrement}>
<Pressable
hitSlop={16}
disabled={inCart || decrementDisabled}
onPress={decrement}
>
<Icon name='minus' color={theme.text.secondary} />
</Pressable>
<Typography size='large' weight='medium' number>
{quantity}
</Typography>
<Pressable disabled={inCart} onPress={increment}>
<Pressable hitSlop={16} disabled={inCart} onPress={increment}>
<Icon name='plus' color={theme.text.secondary} />
</Pressable>
</View>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/store/CategorySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const styles = StyleSheet.create({
container: {
width: '100%',
marginTop: 8,
paddingVertical: 8
paddingVertical: 12
},
content: {
alignItems: 'center',
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/store/CategorySelectorItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const CategorySelectorItem: React.FC<CategorySelectorItemProps> = ({
active
}) => {
return (
<TextButton onPress={onPress} active={active} weight='medium'>
<TextButton onPress={onPress} active={active} weight='medium' size={17}>
{name}
</TextButton>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/navigation/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Routes: React.FC = () => {
return (
<Provider value={client}>
<StatusBar style={theme.statusBar} />
<NavigationContainer theme={theme.navigation} linking={linking}>
<NavigationContainer theme={theme.navigation} /*linking={linking}*/>
<AppStack.Navigator screenOptions={{ headerShown: false }}>
{accessToken ? (
<>
Expand Down
42 changes: 22 additions & 20 deletions apps/app/src/screens/Cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ const Cart: React.FC = () => {

const cart = data?.cart;

if (fetching || !cart) return <View />;

return (
<ScrollableScreen
style={[styles.container, { paddingBottom: bottom }]}
Expand All @@ -98,31 +96,35 @@ const Cart: React.FC = () => {
/>
}
>
<StoreInfo store={cart.store} />
{cart && (
<>
<StoreInfo store={cart.store} />

<CartSummary products={cart.products} />
<CartSummary products={cart.products} />

{/* <DeliveryInfo /> */}
{/* <DeliveryInfo /> */}

<Spacer y={16} />
<Spacer y={16} />

<SelectCard
cards={cart.user.cards}
selectedCard={selectedCard}
onCardSelect={setSelectedCard}
/>
<SelectCard
cards={cart.user.cards}
selectedCard={selectedCard}
onCardSelect={setSelectedCard}
/>

<Separator style={{ margin: 16 }} />
<Separator style={{ margin: 16 }} />

<CartTotal cart={cart} fees={fees} />
<CartTotal cart={cart} fees={fees} />

<View style={{ paddingTop: 16, paddingHorizontal: 16 }}>
<Button
text='Place Order'
onPress={handleSubmit}
disabled={!selectedCard}
/>
</View>
<View style={{ paddingTop: 16, paddingHorizontal: 16 }}>
<Button
text='Place Order'
onPress={handleSubmit}
disabled={!selectedCard}
/>
</View>
</>
)}
</ScrollableScreen>
);
};
Expand Down
8 changes: 7 additions & 1 deletion apps/dashboard/src/screens/StoreSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ const StoreSelect: React.FC = () => {
return (
<Screen style={styles.container}>
<SafeAreaView>
<Typography size='xxxlarge' weight='bold' style={styles.header}>
<Typography size='xxxlarge' weight='bold'>
Select store
</Typography>

<Spacer y={2} />

<Typography variant='secondary'>
You can choose an existing store you manage, or create a new one.
</Typography>

<Spacer y={16} />

<StoreSelectList />

<Button
onPress={() => navigate('CreateStore')}
style={{ marginBottom: 16 }}
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const styles = StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center',
height: 40,
borderRadius: 4
height: 44,
borderRadius: 6
},
text: {
fontSize: 17
Expand Down

0 comments on commit bf5b44d

Please sign in to comment.