Review challenge request#1
Conversation
marius4896
left a comment
There was a problem hiding this comment.
You are on the right path :)
| Alert.alert( | ||
| t.myBooking.successReservation.title, | ||
| t.myBooking.successReservation.message, | ||
| ); |
There was a problem hiding this comment.
Not a common practice to add this here. Place it as part of the success action itself
| Alert.alert( | ||
| t.myBooking.errorReservation.title, | ||
| t.myBooking.errorReservation.message, | ||
| ); |
There was a problem hiding this comment.
Not a common practice to add this here. Place it as part of the success action itself
| /> | ||
| <Stack.Screen | ||
| name={'BookingScreen'} | ||
| component={() => <Booking />} |
There was a problem hiding this comment.
If your are not passing extra props to the screen component use it as component={Booking}
| const setCabinVal = () => setState({...state, cabin: !state.cabin}); | ||
| const setCheckedVal = () => setState({...state, checked: !state.checked}); |
There was a problem hiding this comment.
Using set state like this can help with much boilerplate, bui i would consider useState for each pro, and in this example wrap it in a useCallback.
As an alternative use useReducer.
| marginLeft: 15, | ||
| marginRight: 15, | ||
| marginBottom: 15, | ||
| marginTop: 15, |
There was a problem hiding this comment.
Using fixed values can work, and it will work for one screen with it's dimensions, but you will have problem scaling. Please use either percentages or relative values.
| payload: {reservationId: response.data.reservation_id}, | ||
| }); | ||
| }) | ||
| .catch((error) => console.warn(error)); |
There was a problem hiding this comment.
Maybe dispatch(BUY_TICKET_FAIL) rather than logging in the error.
| @@ -0,0 +1,53 @@ | |||
| // @ts-nocheck | |||
| price: string; | ||
| } | ||
|
|
||
| export default class BaggageClassComponent extends React.Component<BaggageItemProps> { |
There was a problem hiding this comment.
Why use class component here ? Please move to functional.
| import {flights} from '../../data'; | ||
|
|
||
| const Connections = () => { | ||
| type Props = { |
There was a problem hiding this comment.
Please use an interface.
| import {Action} from 'redux'; | ||
| import {t} from '@translations'; | ||
|
|
||
| export const BUY_TICKET_REQUEST = 'BUY_TICKET_REQUEST'; |
There was a problem hiding this comment.
You can transform this in an Enum
No description provided.