Skip to content

Commit 519e25a

Browse files
committed
Merge branch 'main' of https://github.com/falling-fruit/falling-fruit-web into issue-1049
2 parents fb89cc7 + 0645af0 commit 519e25a

35 files changed

Lines changed: 556 additions & 261 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# misc
1515
.DS_Store
1616
.env
17+
.env.*
1718
.eslintcache
1819
.vscode
1920

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.1.3

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<uses-permission android:name="android.permission.INTERNET" />
4545
<uses-permission android:name="android.permission.CAMERA" />
46-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
46+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29"/>
4747
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
4848
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
4949
<!-- Features implied by Permissions -->

docs/setup.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@
4141
- `REACT_APP_GOOGLE_ANALYTICS_TRACKING_ID`: Tracking ID for Google Analytics. Optional.
4242

4343
- Additional (top secret) environment variables in `.env` are needed to sign and release the mobile apps.
44+
4445
- `ANDROID_KEYSTORE_PATH`
4546
- `ANDROID_KEYSTORE_PASSWORD`
4647
- `ANDROID_KEYSTORE_ALIAS`
4748
- `ANDROID_KEYSTORE_ALIAS_PASSWORD`
4849

50+
- Additional `.env.android` and `.env.ios` files are used to set platform-specific environment variables that override those in `.env` when building for that platform.
51+
4952
# Web app
5053

5154
- Start the application.
@@ -74,7 +77,7 @@ yarn
7477

7578
# Mobile apps
7679

77-
We use [Capacitor](https://capacitorjs.com) to package the web app as Android and iOS apps. Make sure you can build the web app first with `yarn build` before proceeding. Although most of the mobile app can be tested by opening the web app in a narrow browser window, this is inadequate for testing device-specific functionality like permissions, curved layouts, and onboard functions (camera, compass, and GPS).
80+
We use [Capacitor](https://capacitorjs.com) to package the web app as Android and iOS apps. Although most of the mobile app can be tested by opening the web app in a narrow browser window, this is inadequate for testing device-specific functionality like permissions, curved layouts, and onboard functions (camera, compass, and GPS).
7881

7982
## Bump app versions
8083

@@ -101,21 +104,16 @@ First install the [requirements](https://capacitorjs.com/docs/v7/getting-started
101104
Sync the app with any changes to [`package.json`](../package.json) and `build` output:
102105

103106
```sh
107+
yarn build:android
104108
npx cap sync android
105109
```
106110

107-
Run the app on an emulator or device:
111+
Run the app on an emulator or device (see below) and debug with Chrome at [chrome://inspect/#devices](chrome://inspect/#devices).
108112

109113
```bash
110-
npx cap run android # prompts to select device
111-
# npx cap run android --list
112-
# npx cap run android --device
113-
# npx cap run android --emulator
114-
# npx cap run android --target=<device>
114+
npx cap run android
115115
```
116116

117-
and debug with Chrome at [chrome://inspect/#devices](chrome://inspect/#devices).
118-
119117
Alternatively, open as a project in Android Studio:
120118

121119
```sh
@@ -133,7 +131,7 @@ Then plug the device into your computer, start the `adb` (Android Debug Bridge)
133131

134132
```sh
135133
sudo adb start-server
136-
npx cap run android
134+
adb devices
137135
```
138136

139137
### Release
@@ -159,7 +157,7 @@ First install the [requirements](https://capacitorjs.com/docs/v7/getting-started
159157

160158
- [MacOS](https://www.apple.com/os/macos/) 14.5+ ([download](https://support.apple.com/en-us/102662))
161159
- [Xcode](https://developer.apple.com/xcode/) 16.0+ ([download](https://xcodereleases.com))
162-
- [Cocoapods](https://guides.cocoapods.org/using/getting-started.html)
160+
- [Cocoapods](https://guides.cocoapods.org/using/getting-started.html) with ruby 3.1.3
163161

164162
And prepare Xcode for first use:
165163

@@ -175,6 +173,7 @@ xcodebuild -runFirstLaunch
175173
Sync the app with any changes to [`package.json`](../package.json) and `build` output:
176174

177175
```sh
176+
yarn build:ios
178177
npx cap sync ios
179178
```
180179

ecosystem.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
//Knip marks this file as unused, but is still needed for future development purposes.
22
module.exports = {
33
name: 'web',
4-
script: 'serve',
4+
script: 'node_modules/.bin/serve',
5+
args: '-p 8082 ./build',
56
watch: false,
67
env: {
78
NODE_ENV: 'production',
8-
PM2_SERVE_PATH: 'build',
9-
PM2_SERVE_PORT: 8082,
10-
PM2_SERVE_SPA: 'true',
11-
PM2_SERVE_HOMEPAGE: '/index.html',
129
},
1310
exec_mode: 'cluster',
1411
instances: 4,

ios/App/App/Info.plist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646
<key>UIViewControllerBasedStatusBarAppearance</key>
4747
<true/>
4848
<key>NSCameraUsageDescription</key>
49-
<string>This app needs access to camera to take photos of fruit locations.</string>
49+
<string>This app requires camera access to take photos.</string>
5050
<key>NSLocationWhenInUseUsageDescription</key>
51-
<string>This app needs access to location to show nearby fruit locations.</string>
51+
<string>This app requires location access to show nearby locations.</string>
5252
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
53-
<string>This app needs access to location to show nearby fruit locations.</string>
53+
<string>This app requires location access to show nearby locations.</string>
5454
<key>NSPhotoLibraryUsageDescription</key>
55-
<string>This app needs access to photo library to save and select photos.</string>
55+
<string>This app requires photo library access to select photos.</string>
5656
<key>NSPhotoLibraryAddUsageDescription</key>
57-
<string>This app needs access to photo library to save photos.</string>
57+
<string>This app requires photo library access to save photos.</string>
5858
</dict>
5959
</plist>

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@
7575
"@babel/plugin-syntax-flow": "^7.14.5",
7676
"@babel/plugin-transform-react-jsx": "^7.14.9",
7777
"@capacitor/assets": "^3.0.5",
78+
"@dotenvx/dotenvx": "^1.66.0",
7879
"@hack4impact-uiuc/eslint-plugin": "^2.0.10",
79-
"@types/node": "*",
80+
"@types/dotenv": "^8.2.3",
81+
"@types/node": "^25.8.0",
8082
"@types/react-router-dom": "^5.3.3",
8183
"@types/react-select": "^4.0.18",
8284
"@types/styled-components": "^5.1.26",
@@ -86,7 +88,8 @@
8688
"husky": "^4.3.8",
8789
"lint-staged": "^10.5.3",
8890
"postcss": "^8.1.0",
89-
"prettier": "^3.4.1"
91+
"prettier": "^3.4.1",
92+
"serve": "^14.2.6"
9093
},
9194
"scripts": {
9295
"start": "craco start",
@@ -96,7 +99,10 @@
9699
"format:check": "yarn format:output --check",
97100
"format:output": "prettier \"./src/**/*.{js,jsx,ts,tsx,css,scss,json,md}\" \"./public/**/*.{js,jsx,ts,tsx,css,scss,json,md}\"",
98101
"build": "craco build",
99-
"build:reload": "BUILD_PATH=./build_temp craco build && rm -rf build && mv ./build_temp build",
102+
"build:android": "npx dotenvx run -f .env.android -f .env -- craco build",
103+
"build:ios": "npx dotenvx run -f .env.ios -f .env -- craco build",
104+
"rebuild": "BUILD_PATH=./build_temp craco build && rm -rf build && mv ./build_temp build",
105+
"serve": "serve build",
100106
"test": "craco test",
101107
"eject": "react-scripts eject",
102108
"genApiSchema": "npx openapi-typescript https://raw.githubusercontent.com/falling-fruit/api/main/docs/openapi.yml --output src/utils/apiSchema.ts",

public/serve.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"rewrites": [
3+
{ "source": "/news", "destination": "/news/index.html" },
4+
{ "source": "/news/:id/", "destination": "/news/:id/index.html" },
5+
{ "source": "!/news/**", "destination": "/index.html" }
6+
]
7+
}

src/components/about/ProjectPage.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ const Project = () => {
235235
{' · '}
236236
<b dir="ltr">Ana Carolina de Lima</b><span dir="ltr">Português</span>
237237
{' · '}
238-
<b dir="ltr">Anya Sytenkova</b> (<b dir="ltr">Аня Сытенкова</b>) –
238+
<b dir="ltr">Anya Sytenkova</b> (<b dir="ltr">Аня Сытенкова</b>) –{' '}
239239
<span dir="ltr">Русский</span>
240240
{' · '}
241-
<b dir="ltr"> Barbora Boulová </b><span dir="ltr">Čeština</span>
241+
<b dir="ltr">Barbora Boulová</b><span dir="ltr">Čeština</span>
242242
{' · '}
243243
<b dir="ltr">Daniela Marini</b><span dir="ltr">Español</span>
244244
{' · '}
@@ -249,6 +249,8 @@ const Project = () => {
249249
{' · '}
250250
<b dir="ltr">Heimen Stoffels</b><span dir="ltr">Nederlands</span>
251251
{' · '}
252+
<b dir="ltr">Itai Boneh</b><span dir="rtl">עברית</span>
253+
{' · '}
252254
<b dir="ltr">Jadalnia Warszawa</b><span dir="ltr">Polski</span>
253255
{' · '}
254256
<b dir="ltr">Karolina Hansen</b><span dir="ltr">Polski</span>
@@ -273,6 +275,9 @@ const Project = () => {
273275
<b dir="ltr">Mylène Jacquemart</b><span dir="ltr">Deutsch</span>,{' '}
274276
<span dir="ltr">Italiano</span>
275277
{' · '}
278+
<b dir="ltr">Omar Naamani</b> (<span dir="rtl">عمر نعماني</span>) –{' '}
279+
<span dir="rtl">عربي</span>
280+
{' · '}
276281
<b dir="ltr">Parmenter Welty</b><span dir="ltr">Español</span>
277282
{' · '}
278283
<b dir="ltr">Raven Lyn</b><span dir="ltr">Português</span>
@@ -288,7 +293,12 @@ const Project = () => {
288293
{' · '}
289294
<b dir="ltr">Timna Raz</b><span dir="rtl">עִברִית</span>
290295
{' · '}
296+
<b dir="ltr">Tong Kitchen-Huan</b> (<b dir="ltr">还彤</b>) –{' '}
297+
<span dir="ltr">简体中文</span>, <span dir="ltr">繁体中文</span>
298+
{' · '}
291299
<b dir="ltr">Tống Thái Vương</b><span dir="ltr">Tiếng Việt</span>
300+
{' · '}
301+
<b dir="ltr">Wojtek Bażant</b><span dir="ltr">Polski</span>
292302
</p>
293303

294304
<h2>{t('pages.about.closing_remarks')}</h2>

src/components/account/AccountPage.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { editProfile, logout } from '../../redux/authSlice'
1010
import { pathWithCurrentView } from '../../utils/appUrl'
1111
import { useAppHistory } from '../../utils/useAppHistory'
1212
import { useIsDesktop } from '../../utils/useBreakpoint'
13-
import { FormButtonWrapper, FormInputWrapper } from '../auth/AuthWrappers'
1413
import { Input, Textarea } from '../form/FormikWrappers'
1514
import AboutSection from '../mobile/AboutSection'
1615
import Button from '../ui/Button'
1716
import Checkbox from '../ui/Checkbox'
17+
import FormButtons from '../ui/FormButtons'
1818
import LabeledRow from '../ui/LabeledRow'
1919
import Column from '../ui/LinkColumn'
2020
import LoadingIndicator from '../ui/LoadingIndicator'
@@ -161,12 +161,12 @@ const AccountPage = () => {
161161
>
162162
{({ dirty, isValid, isSubmitting }) => (
163163
<Form>
164-
<FormInputWrapper>
164+
<div>
165165
<Input type="text" name="name" label={t('glossary.name')} />
166166
<Textarea name="bio" label={t('users.bio')} />
167-
</FormInputWrapper>
167+
</div>
168168

169-
<FormButtonWrapper>
169+
<FormButtons>
170170
<Button secondary type="reset">
171171
{t('form.button.reset')}
172172
</Button>
@@ -178,7 +178,7 @@ const AccountPage = () => {
178178
? t('form.button.submitting')
179179
: t('users.save_changes')}
180180
</Button>
181-
</FormButtonWrapper>
181+
</FormButtons>
182182
</Form>
183183
)}
184184
</Formik>

0 commit comments

Comments
 (0)