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

app dependencies upgraded (in a separated folder) #662

Draft
wants to merge 158 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
7a6a1d7
Stable react native demo version code with updagraded dependencies un…
Oct 10, 2023
e1f8c8b
Substring to only show first name, font size bigger.
Oct 10, 2023
dd53513
Children card expanded navigation for calendar, news and lunch.
Oct 10, 2023
5340f5b
README updated for the skolplattformen-new repo
Oct 10, 2023
73459e6
metro image link fixed
Oct 10, 2023
e69c0f2
readme new file path updated
Oct 10, 2023
e308216
new readme link added to the readme at the root.
Oct 10, 2023
fced5b0
tests in this commit are all passing bar newsitem
coolusername244 Oct 12, 2023
39d5e64
fix(fixed faiing test)
coolusername244 Oct 12, 2023
6c79487
fix(fixed faiing test (settingsStorage tests))
coolusername244 Oct 16, 2023
ef62f0e
refactor(wrapped state update in act function)
coolusername244 Oct 16, 2023
e037f76
refactor(wrapped state update in act function)
coolusername244 Oct 16, 2023
1515434
refactor(wrapped state update in act function)
coolusername244 Oct 16, 2023
17d1b75
refactor(updated tests)
coolusername244 Oct 16, 2023
97d1e12
refactor(updated tests)
coolusername244 Oct 16, 2023
4f78651
refactor(updated tests)
coolusername244 Oct 16, 2023
d6cddcb
refactor(updated tests)
coolusername244 Oct 16, 2023
0e4e5b7
refactor(updated tests)
coolusername244 Oct 16, 2023
7f0f7b4
refactor(updated tests)
coolusername244 Oct 16, 2023
9ec3253
refactor(updated tests)
coolusername244 Oct 16, 2023
9c5fae4
refactor(updated tests)
coolusername244 Oct 16, 2023
76c9ca8
refactor(updated tests)
coolusername244 Oct 16, 2023
f95842e
refactor(updated tests)
coolusername244 Oct 16, 2023
4b002dc
refactor(updated tests)
coolusername244 Oct 16, 2023
239c52b
refactor(updated tests)
coolusername244 Oct 17, 2023
544fc70
refactor(updated tests - !!!TESTS ON LINE 229 & 267 STILL DO NOT WORK…
coolusername244 Oct 17, 2023
cbb62d0
refactor(updated tests)
coolusername244 Oct 17, 2023
2c085e9
refactor(updated tests)
coolusername244 Oct 17, 2023
e2f8ff7
refactor(updated tests)
coolusername244 Oct 17, 2023
b3664f2
feat(added new yml file)
coolusername244 Oct 17, 2023
6a1aab2
fix(node version on yml file updated)
coolusername244 Oct 17, 2023
4caf056
fix(app routes updated yml file updated)
coolusername244 Oct 17, 2023
614ddf6
refactor(skipped failing tests)
coolusername244 Oct 17, 2023
08e37e9
refactor(added node-blob package)
coolusername244 Oct 17, 2023
ed9b6ad
refactor(updated dependencies)
coolusername244 Oct 17, 2023
4893367
refactor(brought back spinner into component)
coolusername244 Oct 17, 2023
173fc60
refactor(skipped failing test)
coolusername244 Oct 17, 2023
ec9d640
refactor(linting)
coolusername244 Oct 17, 2023
4f2dcef
refactor(linting)
coolusername244 Oct 18, 2023
6683a62
feat(added android yaml file)
coolusername244 Oct 18, 2023
12570fe
refactor(changed env var)
coolusername244 Oct 18, 2023
d890c04
refactor(changed env var)
coolusername244 Oct 18, 2023
2835521
refactor(changed env var)
coolusername244 Oct 18, 2023
7c370c9
Update build-android.yml
coolusername244 Oct 18, 2023
ad4fb14
Update build-android.yml
coolusername244 Oct 18, 2023
7f4ac52
Update build-android.yml
coolusername244 Oct 18, 2023
a4ef53c
Update build-android.yml
coolusername244 Oct 18, 2023
da3dabb
Update build-android.yml
coolusername244 Oct 18, 2023
d0917a6
feat(added build ios yaml)
coolusername244 Oct 18, 2023
b8c86d9
refactor(updated ruby)
coolusername244 Oct 18, 2023
417ea57
refactor(downgraded camelcase-keys to get parse tests working)
coolusername244 Oct 18, 2023
9294fec
feat(moved over more tests from original repo)
coolusername244 Oct 18, 2023
3a436dd
chore(installed gem bundler, updated gem )
coolusername244 Oct 19, 2023
940bb7b
chore(added fastlane fastfile and appfile)
coolusername244 Oct 19, 2023
852fb5a
fix(added env route)
coolusername244 Oct 19, 2023
e8568f2
fix(removed env route)
coolusername244 Oct 19, 2023
3252319
test(env)
coolusername244 Oct 19, 2023
bdebdf0
test(env)
coolusername244 Oct 19, 2023
2441927
test(env)
coolusername244 Oct 19, 2023
3fb03bb
test(env)
coolusername244 Oct 19, 2023
9c4e512
test(env)
coolusername244 Oct 19, 2023
e963826
test(env)
coolusername244 Oct 19, 2023
d813f51
test(env)
coolusername244 Oct 19, 2023
de6c788
test(env)
coolusername244 Oct 19, 2023
e9519b3
test(env)
coolusername244 Oct 19, 2023
ebde139
refactor(added dotenv for gemfile)
coolusername244 Oct 20, 2023
0e3fbe8
refactor(added bundler for gemfile)
coolusername244 Oct 20, 2023
71365c2
refactor(updated gemfile.lock)
coolusername244 Oct 20, 2023
3950064
test(env)
coolusername244 Oct 20, 2023
10290f2
test(env)
coolusername244 Oct 20, 2023
4a0ffe8
test(env)
coolusername244 Oct 20, 2023
d66d20c
feat(added fake.test.tsx, passing)
PalmN72 Oct 20, 2023
f573152
fix(new folder, __tests___)
PalmN72 Oct 20, 2023
f68887f
feat(tough-cookie downgrade to pass test 'clears session')
PalmN72 Oct 20, 2023
ee323a4
chore(package clean, test path)
PalmN72 Oct 20, 2023
e2920e8
fix(changed file-ending to pass provider.test)
PalmN72 Oct 20, 2023
2303e34
fix (wrapping setup in setImmediate to pass tests)
PalmN72 Oct 20, 2023
9c56f7f
fix(logout test passing)
PalmN72 Oct 20, 2023
ae3a94e
fix(setImmediate, NewsItem passing)
PalmN72 Oct 20, 2023
c40bf09
refactor(reverted to most recent version of tough-cookie)
coolusername244 Oct 23, 2023
8a45b66
refactor(removed setImmediate as it was giving a false positive on te…
coolusername244 Oct 23, 2023
7429129
refactor(added setImmediate import for test)
coolusername244 Oct 23, 2023
bad26e7
refactor(deleted extra file)
coolusername244 Oct 24, 2023
40b2eaf
refactor(removed commented code and console logs)
coolusername244 Oct 24, 2023
d6fba4b
refactor(removed console debug)
coolusername244 Oct 24, 2023
19881a3
refactor(removed placeholder)
coolusername244 Oct 24, 2023
2173c07
refactor(stable import alias update)
coolusername244 Oct 24, 2023
f389a4a
refactor(removed env check)
coolusername244 Oct 25, 2023
20ede02
refactor(removed set env file)
coolusername244 Oct 25, 2023
6793ca0
refactor(removed set env file)
coolusername244 Oct 25, 2023
11352b1
refactor(added path for keys.json)
coolusername244 Oct 25, 2023
be63e74
refactor(changed appfile key path)
coolusername244 Oct 25, 2023
4f5b6d3
refactor(changed appfile key path)
coolusername244 Oct 25, 2023
e792900
refactor(changed env path)
coolusername244 Oct 25, 2023
ac1dcd2
refactor(test key.json file added)
coolusername244 Oct 25, 2023
d727ec1
refactor(test key.json)
coolusername244 Oct 25, 2023
9cf2c69
refactor(test key.json)
coolusername244 Oct 25, 2023
815eabf
refactor(test key.json)
coolusername244 Oct 25, 2023
8d970ec
refactor(test key.json)
coolusername244 Oct 25, 2023
042e6b3
refactor(test key.json)
coolusername244 Oct 25, 2023
1ad45e4
refactor(test key.json)
coolusername244 Oct 25, 2023
86d3cac
refactor(test key.json)
coolusername244 Oct 25, 2023
74f0300
refactor(test key.json)
coolusername244 Oct 25, 2023
5b0eb65
refactor(test key.json)
coolusername244 Oct 25, 2023
8c23fdf
refactor(test key.json)
coolusername244 Oct 25, 2023
1c8373e
refactor(test key.json)
coolusername244 Oct 25, 2023
468d21c
refactor(test key.json)
coolusername244 Oct 25, 2023
9fbc02f
refactor(editd package name)
coolusername244 Oct 25, 2023
3907ce2
refactor(edited bundle namespace and applicationId)
coolusername244 Oct 25, 2023
0a9ad5a
refactor(edited android manifest)
coolusername244 Oct 25, 2023
9601468
refactor(edited - to _ and removed manifest package to test)
coolusername244 Oct 25, 2023
a1c922e
refactor(added back manifest package to test)
coolusername244 Oct 25, 2023
8e7dfa2
refactor(changed package name)
coolusername244 Oct 26, 2023
68a1334
refactor(amended git ignore)
coolusername244 Oct 26, 2023
9000699
refactor(added bundle install command)
coolusername244 Oct 26, 2023
8008630
refactor(changed app name)
coolusername244 Oct 26, 2023
9fbd631
refactor(updated gems)
coolusername244 Oct 26, 2023
d878ed5
refactor(updated package names)
coolusername244 Oct 26, 2023
17e8b47
refactor(removed package attribute as its deprecated)
coolusername244 Oct 26, 2023
4bd5b42
refactor(added bogus passwords)
coolusername244 Oct 26, 2023
71ef6af
refactor(fixed typo)
coolusername244 Oct 26, 2023
b55fe52
refactor(amended release signing options)
coolusername244 Oct 26, 2023
a0919e2
refactor(amended keystore)
coolusername244 Oct 26, 2023
eebc8fe
refactor(amended gradle)
coolusername244 Oct 26, 2023
f08de2b
refactor(amended gradle)
coolusername244 Oct 26, 2023
f2c0772
refactor(amended stuff)
coolusername244 Oct 26, 2023
4f7656c
refactor(amended stuff)
coolusername244 Oct 26, 2023
b08e5dd
refactor(amend Fastfile, alias)
PalmN72 Oct 26, 2023
1598e45
refactor(amend versioncode)
PalmN72 Oct 26, 2023
242ff06
refactor(amend build.gradle, versioning)
PalmN72 Oct 26, 2023
2616098
refactor(amend Fastfile, skip apk upload)
PalmN72 Oct 26, 2023
c156c95
refactor(reset versioncode, enabled apk upload, discarded draft track…
PalmN72 Oct 26, 2023
7b6f47a
refactor(amended version and key alias)
coolusername244 Oct 27, 2023
6a1c29c
refactor(trying somthing that may not work)
coolusername244 Oct 27, 2023
682ba6c
test(bumping gradle versioncode manually)
PalmN72 Oct 27, 2023
6b69aba
test(hardcoded git-tag)
PalmN72 Oct 27, 2023
1102812
refactor(added config email)
coolusername244 Oct 27, 2023
b0010e6
refactor(tag fix)
coolusername244 Oct 27, 2023
ebaa2dd
refactor(tag fix)
coolusername244 Oct 27, 2023
62a4603
refactor(tag fix)
coolusername244 Oct 30, 2023
192b3f7
refactor(tag fix)
coolusername244 Oct 30, 2023
3fbf804
refactor(removed testing comments)
coolusername244 Oct 30, 2023
101e86b
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
3fdac9d
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
a9fb802
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
3360181
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
49ceba5
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
90cfe49
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
0abbee6
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
5b594e7
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
b192749
refactor(fixing version code issue)
coolusername244 Oct 30, 2023
fa609fa
refactor(updated mipmap images)
coolusername244 Oct 30, 2023
59dd1cd
refactor(removed fastlane plugin)
coolusername244 Oct 30, 2023
5acbfb6
refactor(removed fastlane plugin file)
coolusername244 Oct 30, 2023
dc1e611
refactor(edited manifest data)
coolusername244 Oct 30, 2023
d09b6fa
chore(apk version code increment)
PalmN72 Oct 31, 2023
3abe793
refactor(fixing playstore icon)
coolusername244 Oct 31, 2023
940d361
refactor(fixing playstore icon)
coolusername244 Oct 31, 2023
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
  •  
  •  
  •  
68 changes: 68 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# If setting a specific version, wrap it with single quotes like '12.0'
# to pass it as string because GitHub trimmes trailing .0 from numbers
# due to https://github.com/actions/runner/issues/849

name: build-and-ship-android
on:
push:
branches:
- 'main'
jobs:
build-and-ship-android:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/apps/skolplattformen-app-new/Gemfile
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
# changed this from GITHUB_PERSONAL_ACCESS_TOKEN_PATH to GITHUB_TOKEN
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true
- name: Set up our JDK environment
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.13'
cache: 'npm'
cache-dependency-path: ${{ github.workspace }}/apps/skolplattformen-app-new/package-lock.json
- name: set npm version
run: npm install -g npm@9.6.0 && echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} workspace= ${{ github.workspace }} secrets.MAPS_API_KEY=${{secrets.MAPS_API_KEY}}"
- run: cd apps/skolplattformen-app-new/android && bundle install
- name: install node modules
run: cd apps/skolplattformen-app-new && npm ci
- name: Setup local.properties
run: echo "MAPS_API_KEY=${{ env.MAPS_API_KEY }}" > ${{ github.workspace }}/apps/skolplattformen-app-new/android/local.properties
env:
MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
- name: Setup key.json
run: echo "${KEY_JSON}" > ${{ github.workspace }}/apps/skolplattformen-app-new/android/key.json
env:
KEY_JSON: ${{ secrets.KEY_JSON }}
- run: cd apps/skolplattformen-app-new/android && bundle exec fastlane android beta
env:
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
ALIAS_KEY_PASSWORD: ${{ secrets.ALIAS_KEY_PASSWORD }}
- name: 'Store artifact native_debug_symbols.zip'
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: native_debug_symbols.zip
path: ${{ github.workspace }}/apps/skolplattformen-app-new/android/native_debug_symbols.zip
retention-days: 5
- name: 'Store build mappings for difficult crashlytics traces'
uses: actions/upload-artifact@v3
if: ${{ success() }}
with:
name: mapping.txt
path: ${{ github.workspace }}/apps/skolplattformen-app-new/android/app/build/outputs/mapping/release/mapping.txt
retention-days: 500
51 changes: 51 additions & 0 deletions .github/workflows/build-ios.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# If setting a specific version, wrap it with single quotes like '12.0'
# to pass it as string because GitHub trimmes trailing .0 from numbers
# due to https://github.com/actions/runner/issues/849

name: build-and-ship-ios
on:
push:
branches:
- 'main'
jobs:
build-and-ship-ios:
runs-on: macos-13
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/apps/skolplattformen-app-new/Gemfile
steps:
- uses: actions/checkout@v3
with:
# changed this from GITHUB_PERSONAL_ACCESS_TOKEN_PATH to GITHUB_TOKEN
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.3.1'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
bundler-cache: true
- uses: actions/setup-node@v3
with:
node-version: '18.13'
cache: 'npm'
cache-dependency-path: ${{ github.workspace }}/apps/skolplattformen-app-new/package-lock.json
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/apps/skolplattformen-app-new/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: set npm version
run: npm install -g npm@9.6.0
- name: install node modules
run: cd apps/skolplattformen-app-new && npm ci
- run: cd apps/skolplattformen-app-new/ios && bundle install
- run: cd apps/skolplattformen-app-new/ios && npx pod-install
- run: cd apps/skolplattformen-app-new/ios && bundle exec pod update hermes-engine --no-repo-update
- run: cd apps/skolplattformen-app-new/ios && export && bundle exec fastlane ios beta version:patch
env:
ASCAPI_KEY_CONTENT: ${{ secrets.ASCAPI_KEY_CONTENT }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
ENVFILE: ${{env.ENVFILE}}
39 changes: 39 additions & 0 deletions .github/workflows/pr_check_new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run tests on PR - new

on:
pull_request:
branches:
- main
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.17.0'

- name: Setup timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Europe/Stockholm

- name: set npm version
run: npm install -g npm@10.2.0

- name: install node modules
run: cd apps/skolplattformen-app-new && npm ci

- name: Run tests
run: cd apps/skolplattformen-app-new && npm test
env:
CI: true

- name: Check linting
run: cd apps/skolplattformen-app-new && npm run lint
env:
CI: true
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The respective README files there contain more detailed descriptions.
* [Architecture](#architecture)
* [Apps](#apps)
* [skolplattformen](#skolplattformen)
* [skolplattformen dependency upgrade](#skolplattformen-dependency-upgrade)
* [website](#website)
* [Libs](#embedded-api)
* [api](#api)
Expand Down Expand Up @@ -58,6 +59,9 @@ We're starting small, with more features being added over time.

For more information, check out the [source code](apps/skolplattformen-app).

#### skolplattformen dependency upgrade
A dependency upgrade is currently in the works. To navigate directly to the related readme, click [here](/apps/skolplattformen-app-new/README-NEW.md).

#### website

The code for the website at https://skolplattformen.org/. It's built using Next.js.
Expand Down
2 changes: 2 additions & 0 deletions apps/skolplattformen-app-new/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
7 changes: 7 additions & 0 deletions apps/skolplattformen-app-new/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
root: true,
extends: '@react-native',
rules: {
semi: ['warn', 'never'],
},
}
71 changes: 71 additions & 0 deletions apps/skolplattformen-app-new/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/
!debug.keystore
release/

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage


libraries.json

keys.json
10 changes: 10 additions & 0 deletions apps/skolplattformen-app-new/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false
}
1 change: 1 addition & 0 deletions apps/skolplattformen-app-new/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
111 changes: 111 additions & 0 deletions apps/skolplattformen-app-new/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import * as eva from '@eva-design/eva'
import AsyncStorage from '@react-native-async-storage/async-storage'
import { ApiProvider, Reporter } from './libs/hooks/src'
import { ApplicationProvider, IconRegistry, Text } from '@ui-kitten/components'
import { EvaIconsPack } from '@ui-kitten/eva-icons'
import React from 'react'
import { StatusBar, useColorScheme, View } from 'react-native'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { AppNavigator } from './components/navigation.component'
import { FeatureProvider } from './context/feature/featureContext'
import { LanguageProvider } from './context/language/languageContext'
import { SchoolPlatformProvider } from './context/schoolPlatform/schoolPlatformContext'
import { schoolPlatforms } from './data/schoolPlatforms'
import { default as customMapping } from './design/mapping.json'
import { darkTheme, lightTheme } from './design/themes'
import useSettingsStorage from './hooks/useSettingsStorage'
import { translations } from './utils/translation'
import { GestureHandlerRootView } from 'react-native-gesture-handler'

const reporter: Reporter | undefined = __DEV__
? {
log: (message: string) => console.log(message),
error: (error: Error, label?: string) => console.log(label, error),
}
: undefined

if (__DEV__) {
const DevMenu = require('react-native-dev-menu')
DevMenu.addItem('Clear AsyncStorage from all contents', () =>
AsyncStorage.clear().then(() => logAsyncStorage())
)
DevMenu.addItem('Log AsyncStorage contents', () => logAsyncStorage())
}

const safeJsonParse = (maybeJson: string) => {
if (maybeJson) {
try {
return JSON.parse(maybeJson)
} catch (error) {
return maybeJson
}
}
return 'null'
}

const logAsyncStorage = async () => {
const allKeys = await AsyncStorage.getAllKeys()
const keysAndValues = await AsyncStorage.multiGet(allKeys)
console.log('*** AsyncStorage contents:')
keysAndValues.forEach((keyAndValue) => {
console.log(
keyAndValue[0],
'=>',
keyAndValue[1] ? safeJsonParse(keyAndValue[1]) : 'null'
)
})
console.log('***')
}

export default () => {
const [usingSystemTheme] = useSettingsStorage('usingSystemTheme')
const [currentSchoolPlatform] = useSettingsStorage('currentSchoolPlatform')
const [theme] = useSettingsStorage('theme')
const systemTheme = useColorScheme()
const colorScheme = usingSystemTheme ? systemTheme : theme

const platform = schoolPlatforms.find((pf) => pf.id === currentSchoolPlatform)

if (!platform) {
return (
<View>
<Text>ERROR</Text>
</View>
)
}

return (
<FeatureProvider features={platform.features}>
<SchoolPlatformProvider>
<ApiProvider
api={platform.api}
storage={AsyncStorage}
reporter={reporter}
>
<SafeAreaProvider>
<StatusBar
backgroundColor={colorScheme === 'dark' ? '#2E3137' : '#FFF'}
barStyle={
colorScheme === 'dark' ? 'light-content' : 'dark-content'
}
translucent
/>
<IconRegistry icons={EvaIconsPack} />
<ApplicationProvider
{...eva}
// @ts-expect-error Unknown error
customMapping={customMapping}
theme={colorScheme === 'dark' ? darkTheme : lightTheme}
>
<LanguageProvider cache={true} data={translations}>
<GestureHandlerRootView style={{ flex: 1 }}>
<AppNavigator />
</GestureHandlerRootView>
</LanguageProvider>
</ApplicationProvider>
</SafeAreaProvider>
</ApiProvider>
</SchoolPlatformProvider>
</FeatureProvider>
)
}
9 changes: 9 additions & 0 deletions apps/skolplattformen-app-new/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 3.2.2"

gem 'bundler'
gem 'cocoapods', '~> 1.12'
gem 'fastlane'
gem 'dotenv'
Loading
Loading