Skip to content
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.
/ talktalk-rn Public archive

(Deprecated via hackatalk-mobile) talktalk app built in react-native.

License

Notifications You must be signed in to change notification settings

hyochan/talktalk-rn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transferred to HackaTalk

TalkTalk (Deprecated)

CircleCI codecov PRs Welcome All Contributors Slack Greenkeeper badge

m63gkogvnu

Specification

  • typescript
  • styeld-component
  • react-hook
  • react-navigation
  • localization
  • jest
  • react-native-testing-library

Gain points

1. Sample of `react context api provider`.
2. Able to learn how to structure react native app with `context api` and `jest` and `typescript`.
3. Test type with `typescript` with `npm run build` command.
4. Learn how to localize your project.

INSTALL

1. npm install
2. npm start

Structures

app/
├─ .doobooo // necessary if using dooboo-cli
├─ assets
│  └─ icons // app icons
│  └─ images // app images like background images
├─ node_modules/
├─ src/
│  └─ apis
│  └─ components
│  └─ providers
│  └─ utils
│  └─ index.ts
├─ test/
├─ .buckconfig
├─ .eslintignore
├─ .eslintrc.js
├─ .gitattributes
├─ .gitignore
├─ .watchmanconfig
├─ app.json
├─ babel.config.js
├─ index.js
├─ package.json
├─ README.md
└─ STRINGS.ts

Running the project

Running the project is as simple as running

npm run start

This runs the start script specified in our package.json, and will spawn off a server which reloads the page as we save our files. Typically the server runs at http://localhost:8080, but should be automatically opened for you.

Testing the project

Testing is also just a command away:

npm test

Writing tests with Jest

We've created test examples with jest-ts in src/components/screen/__tests__ and src/components/shared/__tests__. Since react is component oriented, we've designed to focus on writing test in same level of directory with component. You can simply run npm test to test if it succeeds and look more closer opening the source.

Localization

We've defined Localization strings in STRINGS.ts which is in root dir. We used react-native-localization pacakage for this one.

import LocalizedStrings from 'react-native-localization';

const strings = new LocalizedStrings({
  en: {
    LOGIN: 'Login',
  },
  kr: {
    LOGIN: '로그인',
  },
});

export {
  strings,
};

Fixed jest setup by adding following in jestSetup.

import { NativeModules } from 'react-native';

/**
 * monkey patching the locale to avoid the error:
 * Something went wrong initializing the native ReactLocalization module
 * https://gist.github.com/MoOx/08b465c3eac9e36e683929532472d1e0
 */

NativeModules.ReactLocalization = {
  language: 'en_US',
};

React version

16.8

React Native version

0.59

React navigation

3

Contributors

Thanks goes to these wonderful people (emoji key):

Hyo Chan Jang
Hyo Chan Jang

💻 📖 ⚠️
TaeSeong Park
TaeSeong Park

💻 📖 ⚠️
Hyeseong Kim
Hyeseong Kim

💻 📖 ⚠️
YongPilMoon
YongPilMoon

💻 ⚠️
bumjoo.lee
bumjoo.lee

💻 ⚠️
SeongBeomShin
SeongBeomShin

💻 ⚠️
Hwasung Kim
Hwasung Kim

💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!