10. Exercises #

Created Thu Nov 16, 2023 at 2:15 AM

Tip - create a app/src folder #

Exercise 1 - WelcomeScreen #

Lessons

Code

Exercise 2 - ViewImageScreen #

Lessons:

Code

Tip - enums, colors #

Colors and enums, especially business logic ones should be stored in /app/constants/

// product.js
export const ORDER_TYPES = {
  PREPAID: 'prepaid',
  COD: 'cash-on-delivery',
}

export const PRODUCT_MODULES = {
  EXPLORE: 'explore',
  ORDER: 'order',
  PAYMENT: 'payment',
  HELP: 'help',
  TRACK_ORDER: 'track-order'
}
export const COLORS = {
  DARK: '#000000',
  LIGHT: '#fffff',
  PRIMARY: '#ff0000',
  SECONDARY: '#0000ff',
}

This helps us:

  1. Avoid typo bugs, and provides auto-completes
  2. Some light documentation for variations of product
  3. Searching code faster, when a module or variation breaks