Skip to content

Commit 1ff1713

Browse files
committed
working
1 parent dc3b4a7 commit 1ff1713

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+953
-126
lines changed

.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"presets": ["babel-preset-expo"],
2+
"presets": ["babel-preset-expo","es2015", "stage-1", "react"],
33
"env": {
44
"development": {
5-
"plugins": ["transform-react-jsx-source"]
5+
"plugins": ["transform-react-jsx-source","transform-class-properties"]
66
}
77
}
88
}

App.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
import React from 'react';
2-
import { StyleSheet, Text, View } from 'react-native';
3-
import Hello from "./src/common/components/App";
2+
import { Provider } from 'react-redux';
3+
import Store from './src/Store';
4+
import RouterComponent from './src/common/App';
45

56
export default class App extends React.Component {
67
render() {
78
return (
8-
<View style={styles.container}>
9-
<Hello />
10-
</View>
11-
);
9+
<Provider store={Store}>
10+
<RouterComponent />
11+
</Provider>
12+
)
1213
}
1314
}
1415

15-
const styles = StyleSheet.create({
16-
container: {
17-
flex: 1,
18-
backgroundColor: '#fff',
19-
alignItems: 'center',
20-
justifyContent: 'center',
21-
},
22-
});

index.web.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<meta name="description" content="">
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
88
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
9+
<link href="https://fonts.googleapis.com/css?family=Baloo|Roboto:300,400,500" rel="stylesheet">
910
</head>
1011
<body>
1112
<!--[if lt IE 8]>

package.json

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
"version": "0.1.0",
44
"private": true,
55
"devDependencies": {
6-
"react-native-scripts": "0.0.28",
7-
"jest-expo": "^0.4.0",
8-
"react-test-renderer": "16.0.0-alpha.6",
6+
"babel-plugin-transform-class-properties": "^6.24.1",
7+
"grunt-cli": "^0.1.13",
98
"grunt-concurrent": "^2.2.1",
109
"grunt-contrib-clean": "^1.0.0",
1110
"grunt-contrib-connect": "^1.0.0",
@@ -14,7 +13,11 @@
1413
"grunt-exec": "^0.4.6",
1514
"grunt-open": "^0.2.3",
1615
"grunt-webpack": "^1.0.11",
17-
"grunt-cli": "^0.1.13"
16+
"jest-expo": "^0.4.0",
17+
"material-ui": "^0.17.4",
18+
"react-hot-loader": "^1.3.1",
19+
"react-native-scripts": "0.0.28",
20+
"react-test-renderer": "16.0.0-alpha.6"
1821
},
1922
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
2023
"scripts": {
@@ -23,32 +26,39 @@
2326
"android": "react-native-scripts android",
2427
"ios": "react-native-scripts ios",
2528
"test": "node node_modules/jest/bin/jest.js --watch",
26-
"build": "grunt build -p",
29+
"build": "grunt build -p",
2730
"serve-electron": "grunt serve-electron"
2831
},
2932
"jest": {
3033
"preset": "jest-expo"
3134
},
3235
"dependencies": {
33-
"expo": "^16.0.0",
34-
"react": "16.0.0-alpha.6",
35-
"react-native": "^0.43.4",
3636
"babel-core": "^6.10.4",
3737
"babel-loader": "^6.2.4",
3838
"babel-preset-es2015": "^6.9.0",
3939
"babel-preset-react": "^6.5.0",
40+
"babel-preset-stage-1": "^6.24.1",
4041
"css-loader": "^0.23.1",
4142
"electron-prebuilt": "^0.37.2",
43+
"expo": "^16.0.0",
4244
"grunt": "^0.4.5",
4345
"load-grunt-tasks": "^3.5.2",
4446
"node-sass": "^3.8.0",
47+
"react": "16.0.0-alpha.6",
4548
"react-dom": "^15.1.0",
49+
"react-native": "^0.43.4",
4650
"react-native-cli": "^2.0.1",
51+
"react-native-loading-spinner-overlay": "^0.4.4",
52+
"react-native-router-flux": "^3.38.0",
4753
"react-router": "^2.0.1",
54+
"react-tap-event-plugin": "^2.0.1",
55+
"redux": "^3.6.0",
56+
"redux-observable": "^0.14.1",
57+
"rxjs": "^5.3.0",
4858
"sass-loader": "^3.2.2",
4959
"style-loader": "^0.13.2",
5060
"url-loader": "^0.5.8",
5161
"webpack": "^1.13.1",
5262
"webpack-dev-server": "^1.14.1"
5363
}
54-
}
64+
}

src/Components/Button.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
import { Text , TouchableOpacity } from 'react-native';
3+
4+
const Button = ({onPress, children}) => {
5+
return (
6+
<TouchableOpacity onPress={onPress} style={styles.buttonStyle}>
7+
<Text style={styles.textStyle}>
8+
{children}
9+
</Text>
10+
</TouchableOpacity >
11+
);
12+
}
13+
14+
const styles = {
15+
buttonStyle: {
16+
alignSelf: 'center',
17+
backgroundColor:'#fff',
18+
borderRadius: 5,
19+
borderWidth: 1,
20+
borderColor: '#007aff',
21+
justifyContent: 'center',
22+
marginLeft: 5,
23+
marginRight: 5
24+
},
25+
textStyle:{
26+
alignSelf: 'center',
27+
color: '#007aff',
28+
fontSize: 16,
29+
fontWeight: '600',
30+
paddingTop: 10,
31+
justifyContent: 'center',
32+
paddingBottom: 10
33+
}
34+
};
35+
export {Button};

src/Components/Card.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
import { View } from 'react-native';
3+
4+
5+
const Card = (props) => {
6+
// console.log(props.children);
7+
return (
8+
<View style={styles.containerStyle} >
9+
{props.children}
10+
</View>
11+
);
12+
};
13+
14+
15+
const styles = {
16+
containerStyle: {
17+
borderWidth: 1,
18+
borderRadius: 2,
19+
marginBottom:20,
20+
borderColor: '#ddd',
21+
borderBottomWidth: 0,
22+
shadowColor: '#000',
23+
shadowOffset: { width: 0, height: 2 },
24+
shadowOpacity: 0.2,
25+
marginLeft: 0,
26+
marginTop: 10
27+
}
28+
};
29+
30+
export {Card};

src/Components/CardSection.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import { View } from 'react-native';
3+
4+
const CardSection = (props) => {
5+
console.log(props);
6+
return (
7+
<View style={style.containerStyle} >
8+
{props.children}
9+
</View>
10+
);
11+
};
12+
13+
14+
const style = {
15+
containerStyle: {
16+
borderBottomWidth: 1,
17+
backgroundColor: '#fff',
18+
justifyContent: 'flex-start',
19+
flexDirection: 'row',
20+
borderColor: '#ddd',
21+
position: 'relative',
22+
}
23+
};
24+
25+
export {CardSection};

src/Components/Header.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import {
3+
Text,
4+
View
5+
} from 'react-native';
6+
import {
7+
Constants
8+
} from 'expo';
9+
10+
const Header = (props) => {
11+
const { textStyle, viewStyle } = styles;
12+
return (
13+
<View style={viewStyle}>
14+
<Text style={textStyle}>{props.textShown}</Text>
15+
</View>
16+
);
17+
};
18+
19+
const styles = {
20+
textStyle: {
21+
fontSize: 20,
22+
},
23+
viewStyle: {
24+
backgroundColor: '#f8f8f8',
25+
justifyContent: 'center',
26+
height: 60,
27+
paddingTop: Constants.statusBarHeight,
28+
alignItems: 'center',
29+
shadowColor: '#000',
30+
shadowOffset: { width: 0, height: 2 },
31+
shadowOpacity: 0.2,
32+
}
33+
};
34+
35+
export {Header};
36+

src/Components/Home.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React, { Component } from 'react';
2+
import { View, Text, StyleSheet } from 'react-native';
3+
import {Card, CardSection,Spinners,NewsList} from '../Components/';
4+
5+
const Home = (props) => {
6+
console.log(props.data)
7+
return (
8+
<Card>
9+
{props.data.isProcessing?<CardSection><Spinners /></CardSection>:<NewsList data={props.data.news}/>}
10+
11+
</Card>
12+
)
13+
}
14+
15+
16+
17+
export { Home };

src/Components/Loader.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from 'react';
2+
import Spinner from 'react-native-loading-spinner-overlay';
3+
import { Button } from "./";
4+
import { View, Text } from 'react-native';
5+
6+
const Spinners = (props) => {
7+
console.log("Loader", props)
8+
return (
9+
<View style={{ flex: 1 }}>
10+
<Spinner visible={true} size="small" cancelable={true}>
11+
<View style={style.textContainer}>
12+
<Text style={style.textContent}> Please Wait </Text>
13+
<Button onPress={()=> props.cancel}> Cancell </Button>
14+
</View>
15+
</Spinner>
16+
</View>
17+
)
18+
}
19+
20+
const style = {
21+
textContainer: {
22+
flex: 1,
23+
top: 0,
24+
bottom: 0,
25+
left: 0,
26+
right: 0,
27+
justifyContent: 'center',
28+
alignItems: 'center',
29+
position: 'absolute',
30+
},
31+
textContent: {
32+
top: 10,
33+
height: 50,
34+
fontSize: 20,
35+
fontWeight: 'bold'
36+
}
37+
38+
}
39+
40+
export { Spinners }

0 commit comments

Comments
 (0)