Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo #196

Closed
wants to merge 238 commits into from
Closed

demo #196

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
398e661
feat: show current app version in settings
lucienbl Mar 23, 2020
100f97d
fix: pass bold through component prop
lucienbl Mar 23, 2020
91862c4
fix: use expo constants to fetch current app version
lucienbl Mar 23, 2020
4cb8730
Merge pull request #92 from lucienbl/feat/settings-app-version
PierreBresson Mar 23, 2020
bebe377
fix color + add contrib readme
PierreBresson Mar 23, 2020
c016f14
feat: add a publish action
theolampert Mar 24, 2020
723953c
fix french translation
PierreBresson Mar 24, 2020
0bbfa76
Merge pull request #94 from NotMyFaultEarth/expo-publish
PierreBresson Mar 24, 2020
de9770c
Merge branch 'master' of https://github.com/NotMyFaultEarth/nmf-app
PierreBresson Mar 24, 2020
6882344
Create FUNDING.yml
Mar 26, 2020
f02ed24
Update FUNDING.yml
Mar 26, 2020
e28e666
feat: add generate app.json script and readme
theolampert Mar 24, 2020
aac1a03
chore: run generate app.json script on publish
theolampert Mar 24, 2020
78b6418
fix: proper version in app.example.json
theolampert Mar 26, 2020
9f878b0
fix: add missing file to ci generation script
theolampert Mar 27, 2020
312c3ab
downgrade versions
theolampert Mar 27, 2020
c795efe
refactor: add graceful fallback for missing DSN
theolampert Mar 27, 2020
d0de7eb
chore: define sentry keys
theolampert Mar 27, 2020
efe9507
chore: change action to run on tag
theolampert Mar 27, 2020
6b7cde8
add support us screen + update headers + new text.link component
PierreBresson Mar 29, 2020
9949a32
Merge branch 'master' of https://github.com/NotMyFaultEarth/nmf-app
PierreBresson Mar 29, 2020
1db8103
wip
PierreBresson Mar 30, 2020
ff96bcb
wip
PierreBresson Mar 30, 2020
225b6d1
display days without meat working
PierreBresson Mar 30, 2020
18a3041
change text
PierreBresson Mar 30, 2020
8542a4d
add translation
PierreBresson Mar 31, 2020
772fe43
add tests
PierreBresson Mar 31, 2020
735a3c8
change message duration
PierreBresson Mar 31, 2020
100d7b4
MonthlyBudgetScreen style update
PierreBresson Mar 31, 2020
46262ca
Merge pull request #98 from NotMyFaultEarth/feature/display-days-with…
PierreBresson Mar 31, 2020
cd1ae15
fix: hardcode statusbar style until dark-mode
theolampert Mar 31, 2020
2b697b2
improve copy
PierreBresson Mar 31, 2020
a972076
fix issue #88
PierreBresson Apr 1, 2020
e8fb753
add TextInput
PierreBresson Apr 1, 2020
ee699d8
name emission + ui changes + swedish
PierreBresson Apr 2, 2020
d3c3355
fix close modal not working coming soon screen
PierreBresson Apr 2, 2020
6201ca7
Merge pull request #100 from NotMyFaultEarth/feat/add-optional-name-t…
PierreBresson Apr 3, 2020
d186a92
chore: converted *.ts translation files to json
lucienbl Apr 3, 2020
606cabc
Merge pull request #106 from lucienbl/master
PierreBresson Apr 3, 2020
41d89bc
add section header to emission screen
PierreBresson Apr 4, 2020
e856dc8
update ui section list
PierreBresson Apr 4, 2020
023c5b1
update expo
PierreBresson Apr 4, 2020
330b071
change color section header + add motorbike
PierreBresson Apr 5, 2020
29c969f
add section header to emission screen
PierreBresson Apr 4, 2020
bdaf174
update ui section list
PierreBresson Apr 4, 2020
4855bd6
update expo
PierreBresson Apr 4, 2020
3cb6c5b
change color section header + add motorbike
PierreBresson Apr 5, 2020
224892a
chore: convertes missing ts translations to json
lucienbl Apr 5, 2020
d014857
Merge pull request #107 from lucienbl/master
PierreBresson Apr 5, 2020
bbbe6d3
fix german error
PierreBresson Apr 5, 2020
6c6f22d
add swedish language
PierreBresson Apr 6, 2020
a57d477
update progress chart
PierreBresson Apr 6, 2020
a953a53
fix ts complains
PierreBresson Apr 8, 2020
97b31ab
display correct date depending on language
PierreBresson Apr 9, 2020
575580c
remove shadows on android fo emissions screen
PierreBresson Apr 9, 2020
47a003b
Merge branch 'master' into fix/date-translation-#108
PierreBresson Apr 9, 2020
7bc985e
Merge pull request #110 from NotMyFaultEarth/fix/date-translation-#108
PierreBresson Apr 9, 2020
f9761e6
add swedish translations
PierreBresson Apr 9, 2020
7b82610
v0.1.0
PierreBresson Apr 10, 2020
3e55774
add new icons in emissions screen
PierreBresson Apr 13, 2020
4a96c2f
fix social icon display
PierreBresson Apr 13, 2020
03173df
add possibility to change date of an emission
PierreBresson Apr 13, 2020
89b518d
add circle behind icons in emissions screen
PierreBresson Apr 13, 2020
5be1eec
fix #115
PierreBresson Apr 13, 2020
3ad3b40
add default values
PierreBresson Apr 13, 2020
d168e65
Merge branch 'master' into feat/change-date-emission-#112
PierreBresson Apr 13, 2020
882c1ce
Merge pull request #116 from NotMyFaultEarth/feat/change-date-emissio…
PierreBresson Apr 14, 2020
8a8f7e3
Merge pull request #114 from NotMyFaultEarth/feat/update-icons-in-emi…
PierreBresson Apr 14, 2020
1a02842
update header
PierreBresson Apr 14, 2020
6a19ffd
merge tabs in emissions screen
PierreBresson Apr 14, 2020
917c4c2
remove shadows on android
PierreBresson Apr 14, 2020
900d152
reduce arrow emission list item
PierreBresson Apr 14, 2020
d80c6db
add new github link
PierreBresson Apr 15, 2020
6050e52
Merge pull request #120 from NMF-earth/feat/merge-emissions-tabs-into…
PierreBresson Apr 15, 2020
311c53e
prevent emission date to be in the future + design
PierreBresson Apr 16, 2020
4345dfb
fix timezone issue and update icons
PierreBresson Apr 16, 2020
7dd2b8b
fix tests
PierreBresson Apr 16, 2020
57ec957
fix tests
PierreBresson Apr 16, 2020
68cba1f
fix tests
PierreBresson Apr 17, 2020
cb9567e
fix crash
PierreBresson Apr 21, 2020
2508d43
Merge pull request #126 from NMF-earth/bug-section-header-text-render…
PierreBresson Apr 21, 2020
83f6f49
v0.2.1
PierreBresson Apr 21, 2020
b7e093d
add swedish translation
PierreBresson Apr 21, 2020
1c9f020
remove old translations
PierreBresson Apr 21, 2020
441da34
fix sentry crash 1622984938
PierreBresson Apr 22, 2020
71ad0a1
inc build nb
PierreBresson Apr 22, 2020
9a30c81
fix section header
PierreBresson Apr 23, 2020
86dcfcf
missing sv translations
PierreBresson Apr 23, 2020
5cd2f14
add swedish language
PierreBresson May 1, 2020
61c66ee
fix display kg co2 #127
PierreBresson May 1, 2020
7be1960
fish, chocolate and coffee added
PierreBresson May 1, 2020
422e1b3
Merge pull request #129 from NMF-earth/feat/new-emissions-chocolate-c…
PierreBresson May 1, 2020
1e68066
add missing stories
PierreBresson May 1, 2020
7841765
add streaming emissions
PierreBresson May 1, 2020
4ae8109
improve display
PierreBresson May 1, 2020
1e62d46
inc build
PierreBresson May 1, 2020
7c9de61
change streaming emission modelling
PierreBresson May 4, 2020
3fd46d7
Merge pull request #130 from NMF-earth/feat/Add-Streaming-as-a-new-em…
PierreBresson May 4, 2020
24c818e
improve display
PierreBresson May 4, 2020
823ca6f
wip
PierreBresson May 12, 2020
3e3eb56
all screens updated
Jun 8, 2020
2f6ccbd
all screens updated
Jun 8, 2020
c969809
fix android nav
Jun 8, 2020
32b8b56
Merge pull request #134 from NMF-earth/feat/update-react-navigation-#89
PierreBresson Jun 8, 2020
94840cb
Fix: replaced oceanBlue to blue50
akkikumar72 Jun 12, 2020
6e3de73
cleaning
Jun 13, 2020
2bdb712
add portuguese and spanish translation files
Jun 13, 2020
13fd33d
Merge pull request #136 from NMF-earth/feat/portuguese-spanish-transl…
PierreBresson Jun 13, 2020
033be53
add my location screen
Jun 13, 2020
b7f7e18
add user location feature
Jun 14, 2020
b8505ca
[fix/50_animated_splash_screen] [Issue-50] Added animation splash at …
devanshujain95 Jun 14, 2020
51c3d4a
Merge pull request #139 from NMF-earth/feat/add-user-location-#132
PierreBresson Jun 14, 2020
6f815ba
Merge pull request #140 from devanshujain95/fix/50_animated_splash_sc…
PierreBresson Jun 15, 2020
f03f0fa
fix translation
Jun 15, 2020
3d945f5
Fix: Replaced linkGreen and darkLink
akkikumar72 Jun 15, 2020
b0c745f
fix: Replaced red50, grey40 and 2 new colors
akkikumar72 Jun 15, 2020
faa4590
Fix: replaced oceanBlue to blue50
akkikumar72 Jun 12, 2020
8dac630
Fix: Replaced linkGreen and darkLink
akkikumar72 Jun 15, 2020
6c93b42
fix: Replaced red50, grey40 and 2 new colors
akkikumar72 Jun 15, 2020
3a698fd
Merge branch 'fix-new-color-scheme' of github.com:akkikumar72/nmf-app…
akkikumar72 Jun 15, 2020
3700006
Fix: Fixed after merging master
akkikumar72 Jun 15, 2020
c273b6e
Fix: Fixed after merging master
akkikumar72 Jun 15, 2020
dcfa665
Merge branch 'fix-new-color-scheme' of github.com:akkikumar72/nmf-app…
akkikumar72 Jun 15, 2020
4db8a33
Failed test fix
akkikumar72 Jun 15, 2020
745aefa
Merge pull request #141 from akkikumar72/fix-new-color-scheme
PierreBresson Jun 15, 2020
72b95a3
update colors
Jun 15, 2020
8728af8
update green color
Jun 15, 2020
1ba8dc2
[fix/56] Images in sustainable guide. Rendering markdown files by con…
devanshujain95 Jun 18, 2020
8f44eec
[fix/56] Added coment.
devanshujain95 Jun 18, 2020
d4ae580
Merge pull request #142 from devanshujain95/fix/56_images_sustainable…
PierreBresson Jun 22, 2020
0aebbe8
cleaning
Jun 22, 2020
84ed96f
wip electricity
Jun 23, 2020
2b1d819
add contributors
PierreBresson Jun 23, 2020
ebd0a69
Update FUNDING.yml
PierreBresson Jun 25, 2020
96fff04
fix add emission electricity view
Jun 25, 2020
ca6f5a0
Update README.md
PierreBresson Jun 30, 2020
7317694
Update README.md
PierreBresson Jun 30, 2020
af4b642
electricity emissions added
Jul 1, 2020
84b1767
add location in emission Enum for streaming emissions
Jul 1, 2020
38211d4
Merge pull request #147 from NMF-earth/feat/add-electricity-emission-…
PierreBresson Jul 2, 2020
900dc6d
inc build number and version
Jul 2, 2020
f081edc
hide act tab
Jul 2, 2020
d313163
wip electricity
Jun 23, 2020
d5d8798
fix add emission electricity view
Jun 25, 2020
345b273
electricity emissions added
Jul 1, 2020
05b288f
add location in emission Enum for streaming emissions
Jul 1, 2020
81ebb9a
Adding knob addon
akkikumar72 Jul 2, 2020
1149aee
Knobs working finally
akkikumar72 Jul 2, 2020
538e52c
Merging with master
akkikumar72 Jul 6, 2020
83b6311
Merge pull request #149 from akkikumar72/improve-storybook-add-knobs
PierreBresson Jul 9, 2020
2a60e2c
Upgraded to SDK 38 and fixed typos in LICENSE
saivittalb Jul 10, 2020
76e80cd
Updated according to guidelines
saivittalb Jul 11, 2020
c4afa52
Fixed pre-commit husky error
saivittalb Jul 25, 2020
b16580c
Merge pull request #150 from saivittalb/master
PierreBresson Jul 26, 2020
253eab6
change splashscreen + updates
Jul 26, 2020
970338e
fix transitions on Android
Jul 27, 2020
a9a6652
fix naming
Jul 27, 2020
eb1966a
Merge pull request #152 from NMF-earth/fix/slow-navigation-on-Android…
PierreBresson Jul 27, 2020
b6d187e
inc build number
Jul 27, 2020
5d73fd5
german translation
Jul 27, 2020
6f09817
Update README.md
PierreBresson Jul 28, 2020
1789d30
Support dark mode on iOS #151
Jul 28, 2020
9f547ee
Merge branch 'master' of https://github.com/NMF-earth/nmf-app
Jul 28, 2020
ffe5bf7
fix: dark-mode support for IOS datepicker
fxola Aug 11, 2020
675ced7
Merge pull request #153 from fxola/fix/dark-mode-ios-datepicker
PierreBresson Aug 11, 2020
4fdd89d
wip
Aug 16, 2020
b8027f0
add location to add electricity emission
Aug 21, 2020
6037d70
add german translations
Aug 21, 2020
8851f91
Merge branch 'master' into feat/act-screen-#143
Aug 21, 2020
761bd21
wip
Aug 21, 2020
30838bb
Adding new methology page
akkikumar72 Aug 28, 2020
82d4786
Working methodology page
akkikumar72 Aug 28, 2020
75694d8
Adding minor test
akkikumar72 Aug 28, 2020
6b77fe8
Replacing depricated slider
akkikumar72 Aug 28, 2020
61317e1
Updating snapshots
akkikumar72 Aug 28, 2020
f6e5a3d
Merge pull request #155 from akkikumar72/feat/add-methodology-page-154
PierreBresson Aug 31, 2020
debd80f
new design for the guide
Sep 11, 2020
2f12a00
change font size
Sep 11, 2020
ea88093
Merge pull request #159 from NMF-earth/feat/act-screen-#143
PierreBresson Sep 18, 2020
f595870
update slider
PierreBresson Sep 18, 2020
734f97d
hide animation on dev
PierreBresson Sep 18, 2020
334c640
Update README.md
PierreBresson Sep 30, 2020
0ccdfb2
Add NoEmission component in storybook
gurvanhenry Oct 1, 2020
cc1e0a1
Remove unused fonts
eliely Oct 1, 2020
c8876d3
Minor first changes on eslint config
gurvanhenry Oct 1, 2020
722fdf2
Add prettier in the lint config
gurvanhenry Oct 1, 2020
a5f36b6
Add script command "lint:fix" to let eslint auto fix issue
gurvanhenry Oct 1, 2020
98b8fb1
Apply lint:fix on all files
gurvanhenry Oct 1, 2020
40f8687
Update README
gurvanhenry Oct 1, 2020
33aca47
Parralelized test
Mrgove10 Oct 2, 2020
11d512a
add splash screen ref
PierreBresson Oct 3, 2020
8f9365e
Merge branch 'master' of https://github.com/NMF-earth/nmf-app
PierreBresson Oct 3, 2020
469e3f1
Merge pull request #166 from gurvanhenry/storybook-add-noemission
PierreBresson Oct 3, 2020
2a4f91d
Merge pull request #171 from Mrgove10/master
PierreBresson Oct 3, 2020
0caf9f3
Add .vscode settings to fix all lint on save
gurvanhenry Oct 3, 2020
f3dc070
Remove all the ^ from package.json
gurvanhenry Oct 3, 2020
e617e10
Merge pull request #1 from NMF-earth/master
gurvanhenry Oct 3, 2020
fc6a3db
Merge branch 'master' into eslint-prettier
gurvanhenry Oct 3, 2020
272db34
Apply lint:fix
gurvanhenry Oct 3, 2020
6763409
remove unused fonts references
eliely Oct 3, 2020
13a0266
Merge pull request #169 from eliely/remove_unused_fonts
PierreBresson Oct 4, 2020
163a339
Merge branch 'master' into eslint-prettier
PierreBresson Oct 4, 2020
3d493b1
Merge pull request #170 from gurvanhenry/eslint-prettier
PierreBresson Oct 4, 2020
57c44a7
Add babel module resolver
laura-callahan Oct 5, 2020
fc28948
Merge pull request #173 from laurameck/moduleResolver
PierreBresson Oct 6, 2020
15b10b7
clean package.json
PierreBresson Oct 6, 2020
67b4c60
Add ordered imports rulle
stijnbernards Oct 6, 2020
60165fd
Run eslint
stijnbernards Oct 6, 2020
93f18eb
Upgrade expo
cornedor Oct 6, 2020
9d3f846
Upgrade expo
cornedor Oct 6, 2020
6013209
Disable import/namespace as it is conflicting with react-native
stijnbernards Oct 6, 2020
e77992b
Fixed issues in add emission screen
cornedor Oct 6, 2020
bc3ee6a
Expo 39 removed sdkVersion from app.json
cornedor Oct 7, 2020
24c4779
Also load tsconfig for eslint
stijnbernards Oct 7, 2020
483b85f
Remove carets
stijnbernards Oct 7, 2020
eb28987
Lock version numbers in package.json
cornedor Oct 7, 2020
7e0611d
Correctly rename renderer
stijnbernards Oct 7, 2020
b06dff5
Fix Constants import
stijnbernards Oct 7, 2020
7b73709
Correctly import NativeConstants
stijnbernards Oct 7, 2020
6b31c9c
Correctly import Constants
stijnbernards Oct 7, 2020
668feab
Fix manifest
stijnbernards Oct 7, 2020
94d5815
Merge pull request #182 from cornedor/upgrade-expo
PierreBresson Oct 7, 2020
efbaf21
Merge remote-tracking branch 'repo/master' into patch-1
stijnbernards Oct 7, 2020
1fd07e6
Refactor constants import
evayde Oct 7, 2020
b4f1abe
Merge pull request #181 from stijnbernards/patch-1
PierreBresson Oct 7, 2020
947d33b
fix crash on startup
PierreBresson Oct 7, 2020
b4beb12
improve wording
PierreBresson Oct 7, 2020
4d2c274
Add changes to tsconfig.json
evayde Oct 7, 2020
1c3e75c
Merge remote-tracking branch 'upstream/master' into master
evayde Oct 8, 2020
4fefacd
Merge pull request #186 from evayde/master
PierreBresson Oct 9, 2020
ddcafde
fix german translation import issue
PierreBresson Oct 9, 2020
9896fad
Merge branch 'master' of https://github.com/NMF-earth/nmf-app
PierreBresson Oct 9, 2020
0d6e28a
inc build nb
PierreBresson Oct 9, 2020
cc52ff6
wrap AddEmissions navigation in a function to fix currying error
adamfitzgibbon Oct 10, 2020
764bea1
revert snapshot dates
adamfitzgibbon Oct 10, 2020
1020147
🐛 fixed hooks warning on the AddEmission screen
paulussujono Oct 10, 2020
1ddd31b
Merge pull request #193 from adamfitzgibbon/135-FixWarnings
PierreBresson Oct 10, 2020
a4e97e1
Merge pull request #194 from paulussujono/fix-hooks-warning-add-emiss…
PierreBresson Oct 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 33 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ module.exports = {
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jest/recommended"
"plugin:react-hooks/recommended",
"plugin:jest/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"globals": {
"Atomics": "readonly",
Expand All @@ -20,18 +26,39 @@ module.exports = {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"ecmaVersion": 2020,
"sourceType": "module"
},
settings: {
react: {
version: "detect"
},
"import/resolver": {
"typescript": {} // this loads <rootdir>/tsconfig.json to eslint
},
},
"plugins": [
"react",
"@typescript-eslint",
"jest"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": [0],
"quotes": [2, "double"],
"react/display-name": [0],
"react/prop-types": [0]
"@typescript-eslint/explicit-function-return-type": [0],
"quotes": [2, "double"],
"react/display-name": [0],
"react/prop-types": [0],
"import/namespace": 0,
"import/no-named-as-default-member": 0,
"import/order": [
"error",
{
groups: [
["external", "builtin"],
"internal",
["parent", "sibling", "index"],
],
"newlines-between": "always-and-inside-groups",
},
],
}
};
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: nmf_earth
open_collective: nmf_earth
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: NMF-earth/nmf-app
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Expo Publish
on:
push:
tags:
- 'v*'
jobs:
publish:
name: Install and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: expo/expo-github-action@v5
with:
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
- run: yarn install
- run: node scripts/generate-ci-config.js
env:
SENTRY_DSN: ${{ secrets.DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- run: expo publish
38 changes: 38 additions & 0 deletions .github/workflows/testv2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI
on: [push]
jobs:
setup:
runs-on: ubuntu-latest
outputs:
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
test-chunk-ids: ${{ steps['set-test-chunk-ids'].outputs['test-chunk-ids'] }}
steps:
- uses: actions/checkout@v2
- uses: borales/[email protected]
with:
cmd: install
- id: set-test-chunks
name: Set Chunks
run: echo "::set-output name=test-chunks::$(npx jest --listTests --json | jq -cM '[_nwise(length / 4 | floor)]')"
- id: set-test-chunk-ids
name: Set Chunk IDs
run: echo "::set-output name=test-chunk-ids::$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')"
env:
CHUNKS: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
test:
runs-on: ubuntu-latest
name: test (chunk ${{ matrix.chunk }})
needs:
- setup
strategy:
matrix:
chunk: ${{ fromJson(needs.setup.outputs['test-chunk-ids']) }}
steps:
- uses: actions/checkout@v2
- uses: borales/[email protected]
with:
cmd: install
- name: jest
run: echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text' | xargs npx jest
env:
CHUNKS: ${{ needs.setup.outputs['test-chunks'] }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ gen-external-apklibs
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/
.idea/**/workspace.xml
.idea/**/tasks.xml

Expand Down Expand Up @@ -320,4 +321,4 @@ app.json

# Expo
.expo
__generated__
__generated__
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
semi: true,
trailingComma: "es5",
singleQuote: false,
printWidth: 80,
tabWidth: 2,
endOfLine: "auto"
};
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
162 changes: 73 additions & 89 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
import React from "react";
import { AppLoading } from "expo";
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { StatusBar } from "expo-status-bar";
import * as Font from "expo-font";
import { FormattedProvider } from "react-native-globalize";
import { locale } from "expo-localization";
import { locale as localeExpo } from "expo-localization";
import { includes } from "ramda";
import { Platform, StatusBar, StyleSheet, View } from "react-native";
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
import Constants from "expo-constants";
import * as Sentry from "sentry-expo";
import { Provider } from "react-redux";
import AppNavigator from "./app/navigation/AppNavigator";
import AppNavigator from "./app/navigation/Navigator/AppNavigator";
import store from "./app/redux/store";
import SplashScreen from "./app/screens/Splash";
import { enableScreens } from "react-native-screens";
import { LocalizationContext } from "./app/utils";

const supportedLanguages = ["en", "fr", "de"];

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff"
}
});
const supportedLanguages = ["en", "fr", "de", "sv"];

const secret =
require("./secret.ts").default || require("./secret.example.ts").default;
Expand All @@ -28,7 +25,7 @@ const secret =
Sentry.init({
dsn: secret.dsn,
enableInExpoDevelopment: false,
debug: true
debug: true,
});

/* TODO: set Constants.manifest.revisionId with expo */
Expand All @@ -38,87 +35,74 @@ interface Props {
skipLoadingScreen: boolean;
}
interface State {
locale: string;
language: string;
setLanguage: (language: string) => void;
setLocale: (locale: string) => void;
isLoadingComplete: boolean;
}

export default class App extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
isLoadingComplete: false
};
}
componentDidCatch(error: Error) {
/* TODO: add more params for better error reporting */
Sentry.captureException(error);
}

render() {
let localization = locale.length > 2 ? locale.substring(0, 2) : locale;
const App = () => {
enableScreens();

if (!includes(localization, supportedLanguages)) {
localization = "en";
}
let lang = localeExpo.substring(0, 2);

if (!this.state.isLoadingComplete && !this.props.skipLoadingScreen) {
return (
<AppLoading
startAsync={loadResourcesAsync}
onError={handleLoadingError}
onFinish={() =>
handleFinishLoading(() => {
this.setState({ isLoadingComplete: true });
})
}
/>
);
} else {
return (
<View style={styles.container}>
{Platform.OS === "ios" && <StatusBar barStyle="default" />}
<Provider store={store}>
<FormattedProvider locale={localization}>
<AppNavigator />
</FormattedProvider>
</Provider>
</View>
);
}
if (!includes(lang, supportedLanguages)) {
lang = "en";
}
}

async function loadResourcesAsync() {
await Promise.all([
Font.loadAsync({
...Ionicons.font,
...MaterialCommunityIcons.font,
"Inter-Black": require("./assets/fonts/Inter-Black.ttf"),
"Inter-Bold": require("./assets/fonts/Inter-Bold.ttf"),
"Inter-BoldItalic": require("./assets/fonts/Inter-BoldItalic.ttf"),
"Inter-ExtraBold": require("./assets/fonts/Inter-ExtraBold.ttf"),
"Inter-ExtraBoldItalic": require("./assets/fonts/Inter-ExtraBoldItalic.ttf"),
"Inter-ExtraLight-BETA": require("./assets/fonts/Inter-ExtraLight-BETA.ttf"),
"Inter-ExtraLightItalic-BETA": require("./assets/fonts/Inter-ExtraLightItalic-BETA.ttf"),
"Inter-Italic": require("./assets/fonts/Inter-Italic.ttf"),
"Inter-Light-BETA": require("./assets/fonts/Inter-Light-BETA.ttf"),
"Inter-LightItalic-BETA": require("./assets/fonts/Inter-LightItalic-BETA.ttf"),
"Inter-Medium": require("./assets/fonts/Inter-Medium.ttf"),
"Inter-MediumItalic": require("./assets/fonts/Inter-MediumItalic.ttf"),
"Inter-Regular": require("./assets/fonts/Inter-Regular.ttf"),
"Inter-SemiBold": require("./assets/fonts/Inter-SemiBold.ttf"),
"Inter-SemiBoldItalic": require("./assets/fonts/Inter-SemiBoldItalic.ttf"),
"Inter-Thin-BETA": require("./assets/fonts/Inter-Thin-BETA.ttf"),
"Inter-ThinItalic-BETA": require("./assets/fonts/Inter-ThinItalic-BETA.ttf")
})
]);
}
const [ready, setReady] = useState(false);
const [splashAnimation, setSplashAnimation] = useState(__DEV__); // to track splashScreen animation
const [language, setLanguage] = useState(lang);
const [locale, setLocale] = useState(localeExpo);

function handleLoadingError(error) {
// In this case, you might want to report the error to your error reporting
// service, for example Sentry
console.warn(error);
}
useEffect(() => {
Promise.all([
Font.loadAsync({
...Ionicons.font,
...MaterialCommunityIcons.font,
"Inter-Black": require("./assets/fonts/Inter-Black.ttf"),
"Inter-Bold": require("./assets/fonts/Inter-Bold.ttf"),
"Inter-Light-BETA": require("./assets/fonts/Inter-Light-BETA.ttf"),
"Inter-Medium": require("./assets/fonts/Inter-Medium.ttf"),
}),
])
.then(() => {
setReady(true);
})
.catch((error) => Sentry.captureException(error));
}, []);

function handleFinishLoading(setLoadingComplete) {
setLoadingComplete(true);
}
// callback to get splashScreen animation completion
const screenAnimationComplete = (animation) => {
setSplashAnimation(animation);
};

return (
<SafeAreaProvider>
<StatusBar />
{ready && splashAnimation ? (
<Provider store={store}>
<FormattedProvider locale={language || "en"}>
<LocalizationContext.Provider
value={{
locale: locale || "en-US",
setLocale: setLocale,
language: language || "en",
setLanguage: setLanguage,
}}
>
<AppNavigator />
</LocalizationContext.Provider>
</FormattedProvider>
</Provider>
) : __DEV__ ? (
<View />
) : (
<SplashScreen screenAnimationComplete={screenAnimationComplete} />
)}
</SafeAreaProvider>
);
};

export default App;
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
Copyright (C) 2019 Pierre Bresson

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

<program> Copyright (C) <year> <name of author>
NMF.Earth Copyright (C) 2019 Pierre Bresson
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
Loading