This repository has been archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BaseView component and fix all linting errors
Signed-off-by: Karim Stekelenburg <karim@animo.id>
- Loading branch information
1 parent
92f51ed
commit e7da55f
Showing
26 changed files
with
495 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { AppRegistry } from 'react-native'; | ||
import App from './src/App'; | ||
import { name as appName } from './app.json'; | ||
import { AppRegistry } from 'react-native' | ||
import App from './src/App' | ||
import { name as appName } from './app.json' | ||
|
||
AppRegistry.registerComponent(appName, () => App); | ||
AppRegistry.registerComponent(appName, () => App) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ module.exports = { | |
}, | ||
}), | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,48 @@ | ||
import React, { ComponentType, useEffect, useState } from 'react'; | ||
import * as eva from '@eva-design/eva'; | ||
import { ApplicationProvider, Layout, Text } from '@ui-kitten/components'; | ||
import { AppNavigator } from './components/AppNavigator'; | ||
import { Provider } from 'react-redux'; | ||
import { store } from './redux/store'; | ||
import { initAgent } from './agentInit'; | ||
import { setConnections } from './redux/slices/connectionSlice'; | ||
import 'react-native-get-random-values'; | ||
import { LoaderView } from './views'; | ||
import React, { useEffect, useState } from 'react' | ||
import * as eva from '@eva-design/eva' | ||
import { ApplicationProvider } from '@ui-kitten/components' | ||
import { AppNavigator } from './components/AppNavigator' | ||
import { Provider } from 'react-redux' | ||
import { store } from './redux/store' | ||
import 'react-native-get-random-values' | ||
import { LoaderView } from './views' | ||
|
||
const App = (): Element => { | ||
const [agentInitialized, setAgentInitalized] = useState(false); | ||
const [agentInitialized, setAgentInitalized] = useState(false) | ||
|
||
useEffect(() => { | ||
async function initializeAgent(): Promise<void> { | ||
const agent = await initAgent({ | ||
mediatorUrl: 'https://33c31ff85667.ngrok.io', | ||
}); | ||
// const agent = await initAgent({ | ||
// mediatorUrl: 'https://33c31ff85667.ngrok.io', | ||
// }); | ||
|
||
await agent.init(); | ||
store.dispatch(setConnections(await agent.connections.getAll())); | ||
setAgentInitalized(true); | ||
// await agent.init(); | ||
// agent.connections.receiveInvitation() | ||
// store.dispatch(setConnections(await agent.connections.getAll())); | ||
|
||
// DEBUG STUFF | ||
|
||
setTimeout(() => { | ||
setAgentInitalized(true) | ||
}, 5000) | ||
|
||
// setAgentInitalized(true); | ||
} | ||
initializeAgent(); | ||
}, []); | ||
initializeAgent() | ||
}, []) | ||
|
||
return ( | ||
<> | ||
<ApplicationProvider {...eva} theme={eva.dark}> | ||
{!agentInitialized && <LoaderView />} | ||
{/* <LoaderView /> */} | ||
{agentInitialized && ( | ||
<Provider store={store}> | ||
<AppNavigator /> | ||
</Provider> | ||
)} | ||
</ApplicationProvider> | ||
</> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
import React from 'react'; | ||
import { NavigationContainer } from '@react-navigation/native'; | ||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; | ||
import { BottomNavigation, BottomNavigationTab, Layout, Text } from '@ui-kitten/components'; | ||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs' | ||
import { NavigationContainer } from '@react-navigation/native' | ||
import { BottomNavigation, BottomNavigationTab } from '@ui-kitten/components' | ||
import React from 'react' | ||
import { ConnectionsView, CredentialsView, ScannerView } from '../views' | ||
|
||
import { ConnectionsView, CredentialsView, ScannerView } from '../views'; | ||
const { Navigator, Screen } = createBottomTabNavigator() | ||
|
||
const { Navigator, Screen } = createBottomTabNavigator(); | ||
|
||
const BottomTabBar = ({ navigation, state }) => ( | ||
<BottomNavigation selectedIndex={state.index} onSelect={index => navigation.navigate(state.routeNames[index])}> | ||
const BottomTabBar = ({ navigation, state }): React.ReactElement => ( | ||
<BottomNavigation | ||
selectedIndex={state.index} | ||
onSelect={(index): void => navigation.navigate(state.routeNames[index])} | ||
> | ||
<BottomNavigationTab title="Connections" /> | ||
<BottomNavigationTab title="Credentials" /> | ||
<BottomNavigationTab title="Scanner" /> | ||
</BottomNavigation> | ||
); | ||
) | ||
|
||
const TabNavigator = () => ( | ||
<Navigator tabBar={props => <BottomTabBar {...props} />}> | ||
const TabNavigator: React.FC = (): React.ReactElement => ( | ||
<Navigator tabBar={(props): React.ReactElement => <BottomTabBar {...props} />}> | ||
<Screen name="Connections " component={ConnectionsView} /> | ||
<Screen name="Credentials" component={CredentialsView} /> | ||
<Screen name="Scanner" component={ScannerView} /> | ||
</Navigator> | ||
); | ||
) | ||
|
||
export const AppNavigator = () => ( | ||
export const AppNavigator: React.FC = (): React.ReactElement => ( | ||
<NavigationContainer> | ||
<TabNavigator /> | ||
</NavigationContainer> | ||
); | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import React, { ReactElement } from 'react'; | ||
import { StyleSheet } from 'react-native'; | ||
import { Divider, List, ListItem } from '@ui-kitten/components'; | ||
import { ConnectionRecord } from 'aries-framework-javascript'; | ||
import React, { ReactElement } from 'react' | ||
import { StyleSheet } from 'react-native' | ||
import { Divider, List, ListItem } from '@ui-kitten/components' | ||
import { ConnectionRecord } from 'aries-framework-javascript' | ||
|
||
type ConnectionListProps = Array<ConnectionRecord>; | ||
type ConnectionListProps = Array<ConnectionRecord> | ||
|
||
const ConnectionList = (props: ConnectionListProps): Element => { | ||
const renderItem = ({ item, index }): ReactElement => ( | ||
<ListItem title={`${item.title} ${index + 1}`} description={`${item.description} ${index + 1}`} /> | ||
); | ||
) | ||
|
||
return <List style={styles.container} data={props} ItemSeparatorComponent={Divider} renderItem={renderItem} />; | ||
}; | ||
return <List style={styles.container} data={props} ItemSeparatorComponent={Divider} renderItem={renderItem} /> | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
maxHeight: 200, | ||
}, | ||
}); | ||
}) | ||
|
||
export { ConnectionList }; | ||
export { ConnectionList } |
Oops, something went wrong.