Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions react-native/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,23 @@ import { Provider } from 'mobx-react';
import initializeStores from './stores/storeInitializer';
import RoutingContainer from './components/routing/routingConfig';




const stores = initializeStores();
console.disableYellowBox = true;
interface Props {

}
interface Props {}
interface State {
appState:any
appState: any;
}

export default class App extends React.Component<Props,State> {
export default class App extends React.Component<Props, State> {
constructor(props) {
super(props);
}


render() {

return (
<Provider {...stores}>
<RoutingContainer/>
<RoutingContainer />
</Provider>
);
}
}









72 changes: 36 additions & 36 deletions react-native/src/components/loader/loader.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
import React from 'react';
import React from 'react';
import { StyleSheet, View, Modal, ActivityIndicator } from 'react-native';

interface Props {
loading: boolean
loading: boolean;
}
const Loader = (props: Props) => {
const { loading } = props;
return (
<Modal
transparent={true}
animationType={'none'}
visible={loading}
onRequestClose={() => {
console.log('close modal');
}}
>
<View style={styles.modalBackground}>
<View style={styles.activityIndicatorWrapper}>
<ActivityIndicator animating={loading} size="large" color="white" />
</View>
</View>
</Modal>
)
}
const { loading } = props;
return (
<Modal
transparent={true}
animationType={'none'}
visible={loading}
onRequestClose={() => {
console.log('close modal');
}}
>
<View style={styles.modalBackground}>
<View style={styles.activityIndicatorWrapper}>
<ActivityIndicator animating={true} size="large" color="white" />
</View>
</View>
</Modal>
);
};

const styles = StyleSheet.create({
modalBackground: {
flex: 1,
alignItems: 'center',
flexDirection: 'column',
justifyContent: 'space-around',
backgroundColor: 'rgba(191, 191, 191, 0.5)',
},
activityIndicatorWrapper: {
backgroundColor: '#000000',
height: 100,
width: 100,
borderRadius: 10,
display: 'flex',
alignItems: 'center',
justifyContent: 'space-around',
},
modalBackground: {
flex: 1,
alignItems: 'center',
flexDirection: 'column',
justifyContent: 'space-around',
backgroundColor: 'rgba(191, 191, 191, 0.5)',
},
activityIndicatorWrapper: {
backgroundColor: '#000000',
height: 100,
width: 100,
borderRadius: 10,
display: 'flex',
alignItems: 'center',
justifyContent: 'space-around',
},
});

export default Loader;
16 changes: 10 additions & 6 deletions react-native/src/components/routing/routingConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import Setting from '../../scenes/Setting/setting';
import { httpServiceFunc } from '../../services/httpService';
import { Root, Button, Icon } from 'native-base';
import { CreateOrEditTenant } from '../../scenes/Tenants/createOrEditTenant';
import { CreateOrEditRole } from '../../scenes/Roles/createOrEditRole';
import CreateOrEdituser from '../../scenes/Users/createOrEditUser';

const AuthStack2 = createStackNavigator(
{
Dashboard: {
screen: Dasboard,
},
User: {
Users: {
screen: Users,
},
Tenants: {
Expand All @@ -34,9 +36,15 @@ const AuthStack2 = createStackNavigator(
CreateOrEditTenant: {
screen: CreateOrEditTenant,
},
CreateOrEditRoles: {
screen: CreateOrEditRole,
},
CreateOrEditUser: {
screen: CreateOrEdituser,
},
},
{
initialRouteName: 'User',
initialRouteName: 'Roles',
defaultNavigationOptions: ({ navigation }) => ({
headerLeft: (
<Button onPress={() => navigation.toggleDrawer()} style={{ backgroundColor: 'white' }}>
Expand Down Expand Up @@ -67,11 +75,7 @@ const AuthStack = createDrawerNavigator(
},
{
initialRouteName: 'Dashboard',
contentOptions: {
activeTintColor: 'red',
},
edgeWidth: 50,
drawerBackgroundColor: 'rgba(255,255,255,0)',
contentComponent: props => <SideBar {...props} />,
},
);
Expand Down
147 changes: 67 additions & 80 deletions react-native/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,87 +1,74 @@
import React from 'react'
import { Image, TouchableHighlight } from 'react-native'
import { Container, Text, List, ListItem, View, Icon } from 'native-base'
import { DrawerContentComponentProps } from 'react-navigation-drawer'
import { NavigationRoute } from 'react-navigation'
import React from 'react';
import { Image, TouchableHighlight } from 'react-native';
import { Container, Text, View, Icon } from 'native-base';
import { DrawerContentComponentProps, DrawerNavigatorItems } from 'react-navigation-drawer';
import { NavigationRoute } from 'react-navigation';

interface Props extends DrawerContentComponentProps {}
interface State {}

export default class SideBar extends React.Component<Props, State> {
_keyExtractor = (item: NavigationRoute) => item.routeName
_keyExtractor = (item: NavigationRoute) => item.routeName;

render() {
return (
<Container style={{ borderTopRightRadius: 18, borderBottomRightRadius: 18 }}>
<View
style={{
flex: 4,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgb(184,184,184)',
borderTopRightRadius: 0,
}}
>
<TouchableHighlight onPress={() => {}} underlayColor={'rgba(255,255,255,0)'}>
<Image
source={{
uri: 'https://avatars1.githubusercontent.com/u/37835086?s=400&v=4',
}}
style={{
height: 60,
width: 60,
resizeMode: 'stretch',
borderRadius: 18,
}}
/>
</TouchableHighlight>
<TouchableHighlight onPress={() => {}} underlayColor={'rgba(255,255,255,0)'}>
<Text>@Yasir.Aktunc</Text>
</TouchableHighlight>
</View>
<View
style={{
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
flex: 9,
backgroundColor: 'white',
marginTop: -30,
}}
>
<List
dataArray={this.props.items}
keyExtractor={this._keyExtractor}
renderRow={(data: NavigationRoute) => {
return (
<ListItem
button
onPress={() => this.props.navigation!.navigate(data.routeName)}
>
<Text>{data.key}</Text>
</ListItem>
)
}}
/>
</View>
<View
style={{
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center',
marginLeft: 10,
}}
>
<Icon
name="power-off"
type="FontAwesome"
onPress={() => {
this.props.navigation!.navigate('App')
}}
/>
<Text style={{ marginLeft: 10 }}>Log Out</Text>
</View>
</Container>
)
}
render() {
return (
<Container style={{ borderTopRightRadius: 18, borderBottomRightRadius: 18 }}>
<View
style={{
flex: 4,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgb(184,184,184)',
borderTopRightRadius: 0,
}}
>
<TouchableHighlight onPress={() => {}} underlayColor={'rgba(255,255,255,0)'}>
<Image
source={{
uri: 'https://avatars1.githubusercontent.com/u/37835086?s=400&v=4',
}}
style={{
height: 60,
width: 60,
resizeMode: 'stretch',
borderRadius: 18,
}}
/>
</TouchableHighlight>
<TouchableHighlight onPress={() => {}} underlayColor={'rgba(255,255,255,0)'}>
<Text>@Yasir.Aktunc</Text>
</TouchableHighlight>
</View>
<View
style={{
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
flex: 9,
backgroundColor: 'white',
marginTop: -30,
}}
>
<DrawerNavigatorItems {...this.props} />
</View>
<View
style={{
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center',
marginLeft: 10,
}}
>
<Icon
name="power-off"
type="FontAwesome"
onPress={() => {
this.props.navigation!.navigate('App');
}}
/>
<Text style={{ marginLeft: 10 }}>Log Out</Text>
</View>
</Container>
);
}
}
Loading