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

Updates #93

Merged
merged 35 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6ce40bb
consento-v2
martinheidegger Oct 13, 2020
84c1c6d
chore: building on pull requests.
martinheidegger Oct 14, 2020
c1b5861
fix: increasing test times to improve sturdity
martinheidegger Oct 14, 2020
79eaf54
Merge commit '78b5e05b04fce330412a5187405013c867dc04f3' into updates
martinheidegger Oct 14, 2020
1869906
Adding 1s delay to make sure that no tasks may interrupt
martinheidegger Oct 14, 2020
677ffd3
fix: now the empty view don't cuts off image and doesn't require to u…
martinheidegger Oct 14, 2020
3f126ab
fix: forms don't updated when fields are marked: loaded
martinheidegger Oct 14, 2020
4f9bcec
fix: fixing reset
martinheidegger Oct 15, 2020
c63f90b
fix: rendering screens only when focused/visible.
martinheidegger Oct 15, 2020
f6adc46
refactor: removing unnecessary redirection
martinheidegger Oct 15, 2020
599da33
fix: react-navigation to work with reset.
martinheidegger Oct 20, 2020
f408148
fix: secure image to support images rotated with exif data (as is use…
martinheidegger Oct 20, 2020
d9117ce
fix: now the text/image editor and camera to show the images properly
martinheidegger Oct 20, 2020
8bd2e0d
fix: type fixes and cleanup
martinheidegger Oct 20, 2020
c7cdabe
fix: reactivity in mobx grid by setting a key and with every new arra…
martinheidegger Oct 20, 2020
b24bc8d
refactor: Restructured vault cards for less performance spent at runt…
martinheidegger Oct 20, 2020
49d9fc3
fix: back handler of vault and relation
martinheidegger Oct 20, 2020
d7f2973
fix: re-adding background color of previous version
martinheidegger Oct 20, 2020
94434c6
fix: Name in editor now allows to use the own name.
martinheidegger Oct 20, 2020
654b562
fix: layout of too-long file names doesn’t break layout anymore
martinheidegger Oct 20, 2020
963ba22
fix: changing the screenshot logic to allow to find the use of the sc…
martinheidegger Oct 20, 2020
7b1704d
chore: dependency update
martinheidegger Oct 20, 2020
675b0c1
fix: revoking of lockees didn’t work due to false null check
martinheidegger Oct 21, 2020
4514b53
refactor: better typing
martinheidegger Oct 21, 2020
b0800fd
fix: screenshots of filelist
martinheidegger Oct 21, 2020
27a8f74
chore: updating consento/notification-server dependency
martinheidegger Oct 22, 2020
e11aead
feat: Better debug log
martinheidegger Oct 22, 2020
68b7b12
chore: adding new screenshots and adding more documentation to it.
martinheidegger Oct 22, 2020
e40cf15
chore: running npx expo-optimize
martinheidegger Oct 22, 2020
520d35b
build: fixing git build system that required changes after screenshot…
martinheidegger Oct 23, 2020
deb9e5a
chore: updated dependencies
martinheidegger Oct 23, 2020
dc09544
chore: disabling ios builds for pr's
martinheidegger Oct 23, 2020
a1140de
chore: cleanup log statement
martinheidegger Oct 27, 2020
1c35c45
fix: Only opening vault when screen is finished, Closes #102
martinheidegger Oct 27, 2020
d32184a
chore: fixing versionCode warning
martinheidegger Oct 27, 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
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ db
.expo
node_modules
screenshot/index.js
coverage
103 changes: 66 additions & 37 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React, { useState, useEffect } from 'react'
import React, { useState } from 'react'
import 'react-native-gesture-handler' // Imported to fix gesture error in tab navigation
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { Text } from 'react-native'
import { Loading } from './src/screens/Loading'
import { loadFonts } from './src/styles/Font'
import { exists } from './src/util/exists'
import { setGlobalConfig } from 'mobx-keystone'
import { generateId } from './src/util/generateId'
import { createScreenshots, ScreenshotContext } from './src/util/screenshots'
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context'
import { Text, View, StyleSheet } from 'react-native'
import { AppLoading } from 'expo'
import { loadFonts } from './src/styles/design/Font'
import { NavigationContainer, navigationRef } from './src/util/navigate'
import * as ScreenOrientation from 'expo-screen-orientation'

setGlobalConfig({
modelIdGenerator: generateId
})
import { createScreenshots, ScreenshotContext } from './src/util/screenshots'
import useConsento from './src/useConsento'
import { Screens } from './src/screens/Screens'
import { ConsentoContext } from './src/model/Consento'
import { exists } from './src/styles/util/lang'
import { DarkBar } from './src/screens/components/DarkBar'

export const Screenshot = (address: string): (() => JSX.Element) => {
const screenshots = createScreenshots(address)
Expand All @@ -21,32 +22,60 @@ export const Screenshot = (address: string): (() => JSX.Element) => {
</ScreenshotContext.Provider>
}

async function loadApp (): Promise<void> {
await Promise.all([
ScreenOrientation.unlockAsync(),
loadFonts()
])
}

function ErrorScreen ({ error }: { error: Error }): JSX.Element {
const insets = useSafeAreaInsets()
return <View>
<DarkBar height={insets.top} />
<Text>{`Error while loading App:\n${String(error)}`}</Text>
{/* TODO: improve screen to send error & info to github repo */}
</View>
}

const styles = StyleSheet.create({
root: {
width: '100%',
height: '100%'
}
})

/**
* This definition runs before the app. It load the actual App and fonts.
* In case the app has an error on import, the error will be displayed.
*/
export default function App (): JSX.Element {
const [error, setError] = useState<Error>()
const [loaded, setLoaded] = useState<{ ConsentoApp(): JSX.Element }>()
useEffect(() => {
Promise.all([
import('./src/ConsentoApp'),
loadFonts()
])
.then(([{ ConsentoApp }]) => {
if (!exists(ConsentoApp)) {
setLoaded({ ConsentoApp: (): JSX.Element => <Text>'No Screen returned by ./src/ConsentoApp.tsx'</Text> })
}
setLoaded({ ConsentoApp })
})
.catch(setError)
}, [])
if (error !== undefined) {
return <Text>{`Error while initing:\n${String(this.state.error)}`}</Text>
const [loaded, setLoaded] = useState<boolean>(false)
const [loadError, setLoadError] = useState<Error>()
const { consento, error: consentoError, ready } = useConsento()
if (loadError === undefined && !loaded) {
console.log('loading fonts etc.')
return <AppLoading
startAsync={loadApp}
onFinish={() => setLoaded(true)}
onError={setLoadError}
/>
}
if (loaded !== undefined) {
try {
return <SafeAreaProvider><loaded.ConsentoApp /></SafeAreaProvider>
// eslint-disable-next-line no-unreachable
} catch (err) {
return <Text>{`Error: ${String(err)}`}</Text>
}
const error = loadError ?? consentoError ?? consento.loadConfigError
if (!ready && !exists(error)) {
return <AppLoading />
}
return <SafeAreaProvider><Loading /></SafeAreaProvider>
return <SafeAreaProvider>
<ConsentoContext.Provider value={consento}>
<NavigationContainer ref={navigationRef}>
<View style={styles.root}>
{
exists(error)
? <ErrorScreen error={error} />
: <Screens />
}
</View>
</NavigationContainer>
</ConsentoContext.Provider>
</SafeAreaProvider>
}
7 changes: 4 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"slug": "consento",
"owner": "consento",
"privacy": "public",
"sdkVersion": "36.0.0",
"version": "1.0.2",
"scheme": "consento",
"entryPoint": "./index.js",
Expand All @@ -20,7 +19,8 @@
"githubUrl": "https://github.com/consento-org/mobile",
"androidStatusBar": {
"barStyle": "light-content",
"backgroundColor": "#484848"
"backgroundColor": "#484848",
"translucent": true
},
"splash": {
"backgroundColor": "#FCFCFC",
Expand All @@ -30,7 +30,8 @@
"package": "org.consento.mobile",
"permissions": [
"CAMERA"
]
],
"useNextNotificationsApi": true
},
"ios": {
"bundleIdentifier": "org.consento.mobile",
Expand Down
Binary file modified assets/avatar/face/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/avatar/face/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/avatar/unknown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/avatar/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon/eu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon/ngi-ledger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/illustration/friends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/illustration/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/illustration/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/illustration/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/illustration/vaults.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/illustration/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified design/design.sketch
Binary file not shown.
14 changes: 3 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import 'expo/build/Expo.fx'
import registerRootComponent from 'expo/build/launch/registerRootComponent'
import { activateKeepAwake } from 'expo-keep-awake'
const getRandomValues = require('get-random-values-polypony')
getRandomValues.polyfill()

import App from './App'

// eslint-disable-next-line no-undef
if (__DEV__) {
activateKeepAwake()
}

registerRootComponent(App)
require('./polyfilled')
6 changes: 5 additions & 1 deletion metro.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

module.exports = {
resolver: {
blacklistRE: /screenshot\/recorded\//
blacklistRE: /screenshot\/recorded\//,
extraNodeModules: {
'sodium-universal': 'sodium-javascript'
}
}
}
Loading