Skip to content

Commit

Permalink
Merge pull request #26 from nanahq/suraj/chore/packages-installation
Browse files Browse the repository at this point in the history
chore(deps): package installations
  • Loading branch information
siradji authored Aug 17, 2023
2 parents a218380 + 6a95aee commit 6ea476a
Show file tree
Hide file tree
Showing 10 changed files with 60,643 additions and 10,060 deletions.
4 changes: 2 additions & 2 deletions mobile-app/components/commons/inputs/TextInputWithLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {StyleProp, Text, TextInput, TextInputProps, View} from 'react-native'
import {StyleProp, Text, TextInput, TextInputProps, View, ViewStyle} from 'react-native'
import {getColor, tailwind} from "@tailwind";
import {forwardRef, useState} from 'react'
import * as Device from 'expo-device'
Expand All @@ -7,7 +7,7 @@ import {BottomSheetTextInput} from "@gorhom/bottom-sheet";

export interface TextInputWithLabelProps extends TextInputProps {
labelStyle?:StyleProp<TextInputProps>
containerStyle?:StyleProp<TextInputProps>
containerStyle?:StyleProp<ViewStyle>
label: string
labelTestId: string
moreInfo?: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import {Dimensions, KeyboardAvoidingView, ScrollView, StyleProp, Text, View, ViewProps} from 'react-native'
import {
Dimensions,
KeyboardAvoidingView,
ScrollView,
ScrollViewProps,
StyleProp,
Text,
View,
ViewProps, ViewStyle
} from 'react-native'
import {tailwind} from '@tailwind'
import {ModalTextInput} from "@components/commons/inputs/TextInputWithLabel";
import {PropsWithChildren, useEffect, useRef, useState} from "react";
Expand Down Expand Up @@ -236,7 +245,7 @@ return true
}


export function SectionWithAddButton (props: PropsWithChildren<{onPress: () => void, sectionName: string, height?: number, style?: StyleProp<ViewProps>}>): JSX.Element {
export function SectionWithAddButton (props: PropsWithChildren<{onPress: () => void, sectionName: string, height?: number, style?: StyleProp<ViewStyle>}>): JSX.Element {
return (
<ScrollView style={[tailwind(' border-0.5 border-brand-black-500 px-3'), {height: props.height ?? '100%' }, props.style]}>
<View style={[tailwind('flex flex-row items-center w-full justify-between p-2 border-b-0.5 border-brand-black-500'), {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {StyleProp, Text, TextProps, View, ViewProps} from 'react-native'
import {StyleProp, Text, TextProps, View, ViewProps, ViewStyle} from 'react-native'
import {tailwind} from '@tailwind'
import {PropsWithChildren} from "react";

Expand All @@ -20,7 +20,7 @@ interface OrderItemRowProps{
}


export function OrderSection (props:PropsWithChildren<{width?: StyleProp<ViewProps>, heading: string, fullWidth?: boolean}>): JSX.Element {
export function OrderSection (props:PropsWithChildren<{width?: StyleProp<ViewStyle>, heading: string, fullWidth?: boolean}>): JSX.Element {
const {heading , children, fullWidth = true} = props
return (
<View style={[tailwind('flex flex-col', {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,8 @@
import {OrdersMock} from "@screens/AppNavigator/OrdersNavigator/components/OrderTabs";
import {FlashList, ListRenderItemInfo} from "@shopify/flash-list";
import {CategoryType} from "@screens/AppNavigator/OrdersNavigator/components/OrderCatergory";
import {DeliveredOrderCard} from "@screens/AppNavigator/OrdersNavigator/components/OrderCard";
import {tailwind} from "@tailwind";
import {useSafeAreaInsets} from "react-native-safe-area-context";
import {View} from "react-native";
import {TextArea} from "@components/commons/inputs/TextInput";
import {NavigationProp} from "@react-navigation/native";
import OrdersTabs from "@screens/AppNavigator/OrdersNavigator/components/OrderTabs";


export function DeliveredOrders (): JSX.Element {
const insets = useSafeAreaInsets()
const renderItem = ({item}: ListRenderItemInfo<{onPress: (navigation: NavigationProp<any>) => void, type: CategoryType, order: any}>) => (
<DeliveredOrderCard {...item} style={tailwind('mb-4')}/>
)

return (
<View style={[tailwind('flex-1 px-4 pt-4 bg-white'), {paddingTop: insets.top + 30}]}>
<TextArea
containerStyle={tailwind('mb-4')}
testID="DeliveredOrders.Search"
onChangeText={() => {}} initialText=""
placeholder='Search Order by order id'
placeHolderStyle=''
style={tailwind('bg-brand-blue-200 rounded-lg')}
/>
<FlashList
data={OrdersMock}
renderItem={renderItem}
keyExtractor={item => item.order.id}
estimatedItemSize={30}
showsVerticalScrollIndicator={false}
/>
</View>
<OrdersTabs />
)
}


Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function GetOrder ({route: {params}, navigation}: GetOrderProps ): JSX.El
<SafeAreaView style={tailwind('bg-white')}>
<ScrollView style={tailwind('px-5 pb-5 h-full bg-white')}>
<GoBackButton onPress={goBack}/>
<OrderSection heading='Order details' testId='GetOrder.OrderDetails'>
<OrderSection heading='Order details'>
<OrderSection.Row title='Item name: ' text={params.order.listing.name} titleStyle={tailwind('font-bold')} textStyle={tailwind(' text-lg font-bold')} containerStyle={tailwind('mb-2')}/>
<View style={tailwind('flex flex-row items-center justify-between w-full mb-2')}>
<OrderSection.Row titleStyle={tailwind('font-bold')} textStyle={tailwind(' text-lg font-bold')} title='Quantity:' text='2' />
Expand All @@ -67,7 +67,7 @@ export function GetOrder ({route: {params}, navigation}: GetOrderProps ): JSX.El
<OrderSection.Row titleStyle={tailwind('font-medium')} textStyle={tailwind(' text-lg font-bold')} title='Special Note:' text='Please do not make it super spicy' />
</OrderSection>
<View style={tailwind('flex flex-row w-full mt-5')}>
<OrderSection heading='Options' testId='GetOrder.Addons' fullWidth={false} width={tailwind('w-1/2')}>
<OrderSection heading='Options' fullWidth={false} width={tailwind('w-1/2')}>
{params.order.options.map(option => (
<OrderSection.Row title='-' key={option} text={option} containerStyle={tailwind('mb-2')}/>
))}
Expand All @@ -81,7 +81,7 @@ export function GetOrder ({route: {params}, navigation}: GetOrderProps ): JSX.El
</View>
<View style={tailwind('flex flex-row w-full items-center justify-center mt-12')}>
{params.order.orderStatus === OrderStatus.PROCESSED && (
<GenericButton
<GenericButton
onPress={updateOrder}
loading={loading}
disabled={loading}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import {ScrollView, Text, View} from "react-native";
import {tailwind} from '@tailwind'
import {IconComponent} from "@components/commons/IconComponent";
import {NumericFormat as NumberFormat} from "react-number-format";
import {Review} from "@store/reviews.reducer";
import {ReviewI} from "@imagyne/eatlater-types";


export function MostReviewedMenus (props: {reviews: Review[] }): JSX.Element {
export function MostReviewedMenus (props: {reviews: ReviewI[] }): JSX.Element {

if (props.reviews.length <= 0) {
return <></>
Expand All @@ -16,7 +16,7 @@ export function MostReviewedMenus (props: {reviews: Review[] }): JSX.Element {
<Text style={tailwind('text-brand-black-500 text-lg font-medium')}>Top rated menus</Text>
<ScrollView horizontal style={tailwind('px-2')} showsHorizontalScrollIndicator={false}>
{props.reviews.map((review, index) => (
<MostReviewedMenusItem name={review.reviewListingName} key={`review_top_menu_${index}`} reviews={review.reviewRating} rating={review.reviewRating} />
<MostReviewedMenusItem name={review.listingId.name} key={`review_top_menu_${index}`} reviews={review.reviewBody} rating={review.reviewStars.toString()} />
))}

</ScrollView>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {PropsWithChildren} from "react";
import {StyleProp, Text, TouchableOpacity, TouchableOpacityProps, View} from 'react-native'
import {StyleProp, Text, TouchableOpacity, View} from 'react-native'
import {tailwind} from '@tailwind'
import { NotComplete } from "./NotCompleted";

Expand All @@ -15,7 +15,7 @@ export function SettingsSection (props: PropsWithChildren<{title: string}>):JSX.
}


function Item (props: {onPress: () => void, disabled?: boolean, isComplete?: boolean, subtitle?: string, title: string, style?: StyleProp<TouchableOpacityProps>, hasBorder?: boolean}): JSX.Element {
function Item (props: {onPress: () => void, disabled?: boolean, isComplete?: boolean, subtitle?: string, title: string, style?: StyleProp<any>, hasBorder?: boolean}): JSX.Element {
const { title, disabled = false, hasBorder = true, style, ...rest} = props
return (
<TouchableOpacity
Expand Down
Loading

0 comments on commit 6ea476a

Please sign in to comment.