Skip to content

Commit 274e7bf

Browse files
committed
Adding files
1 parent 1196b73 commit 274e7bf

22 files changed

+6566
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.babelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": ["babel-preset-expo"],
3+
"env": {
4+
"development": {
5+
"plugins": ["transform-react-jsx-source"]
6+
}
7+
}
8+
}

.flowconfig

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore templates for 'react-native init'
6+
<PROJECT_ROOT>/node_modules/react-native/local-cli/templates/.*
7+
8+
; Ignore RN jest
9+
<PROJECT_ROOT>/node_modules/react-native/jest/.*
10+
11+
; Ignore RNTester
12+
<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
13+
14+
; Ignore the website subdir
15+
<PROJECT_ROOT>/node_modules/react-native/website/.*
16+
17+
; Ignore the Dangerfile
18+
<PROJECT_ROOT>/node_modules/react-native/danger/dangerfile.js
19+
20+
; Ignore Fbemitter
21+
<PROJECT_ROOT>/node_modules/fbemitter/.*
22+
23+
; Ignore "BUCK" generated dirs
24+
<PROJECT_ROOT>/node_modules/react-native/\.buckd/
25+
26+
; Ignore unexpected extra "@providesModule"
27+
.*/node_modules/.*/node_modules/fbjs/.*
28+
29+
; Ignore polyfills
30+
<PROJECT_ROOT>/node_modules/react-native/Libraries/polyfills/.*
31+
32+
; Ignore various node_modules
33+
<PROJECT_ROOT>/node_modules/react-native-gesture-handler/.*
34+
<PROJECT_ROOT>/node_modules/expo/.*
35+
<PROJECT_ROOT>/node_modules/react-navigation/.*
36+
<PROJECT_ROOT>/node_modules/xdl/.*
37+
<PROJECT_ROOT>/node_modules/reqwest/.*
38+
<PROJECT_ROOT>/node_modules/metro-bundler/.*
39+
40+
[include]
41+
42+
[libs]
43+
node_modules/react-native/Libraries/react-native/react-native-interface.js
44+
node_modules/react-native/flow/
45+
node_modules/expo/flow/
46+
47+
[options]
48+
emoji=true
49+
50+
module.system=haste
51+
52+
module.file_ext=.js
53+
module.file_ext=.jsx
54+
module.file_ext=.json
55+
module.file_ext=.ios.js
56+
57+
munge_underscores=true
58+
59+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
60+
61+
suppress_type=$FlowIssue
62+
suppress_type=$FlowFixMe
63+
suppress_type=$FlowFixMeProps
64+
suppress_type=$FlowFixMeState
65+
suppress_type=$FixMe
66+
67+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
68+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
69+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
70+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
71+
72+
unsafe.enable_getters_and_setters=true
73+
74+
[version]
75+
^0.56.0

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# expo
4+
.expo/
5+
6+
# dependencies
7+
/node_modules
8+
9+
# misc
10+
.env.local
11+
.env.development.local
12+
.env.test.local
13+
.env.production.local
14+
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*

.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import { StackNavigator } from 'react-navigation';
3+
import IconList from './src/components/IconList';
4+
import IconFamilyList from './src/components/IconFamilyList';
5+
6+
console.disableYellowBox = true;
7+
8+
export default StackNavigator({
9+
IconFamilyList: {
10+
screen: IconFamilyList
11+
},
12+
IconList: {
13+
screen: IconList
14+
}
15+
}, {
16+
navigationOptions: {
17+
header: null
18+
}
19+
});
20+

App.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import App from './App';
3+
4+
import renderer from 'react-test-renderer';
5+
6+
it('renders without crashing', () => {
7+
const rendered = renderer.create(<App />).toJSON();
8+
expect(rendered).toBeTruthy();
9+
});

app.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"expo": {
3+
"sdkVersion": "26.0.0"
4+
}
5+
}

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "icons",
3+
"version": "0.1.0",
4+
"private": true,
5+
"devDependencies": {
6+
"jest-expo": "26.0.0",
7+
"react-native-scripts": "1.13.1",
8+
"react-test-renderer": "16.3.0-alpha.1"
9+
},
10+
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
11+
"scripts": {
12+
"start": "react-native-scripts start",
13+
"eject": "react-native-scripts eject",
14+
"android": "react-native-scripts android",
15+
"ios": "react-native-scripts ios",
16+
"test": "jest"
17+
},
18+
"jest": {
19+
"preset": "jest-expo"
20+
},
21+
"dependencies": {
22+
"expo": "^26.0.0",
23+
"native-base": "^2.4.1",
24+
"react": "16.3.0-alpha.1",
25+
"react-native": "0.54.0",
26+
"react-navigation": "^1.5.11"
27+
}
28+
}

src/components/IconFamilyList.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import React, { Component } from 'react';
2+
import { Container, Header, Content, Left, Body, Right, Button, Title, List, ListItem, Text } from 'native-base';
3+
import IconList from './IconList';
4+
5+
export default class IconFamilyList extends Component {
6+
render() {
7+
return (
8+
<Container>
9+
<Header>
10+
<Body><Title>Icon Families</Title></Body>
11+
</Header>
12+
<Content>
13+
<List>
14+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "Entypo" })}>
15+
<Text>Entypo</Text>
16+
</ListItem>
17+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "EvilIcons" })}>
18+
<Text>EvilIcons</Text>
19+
</ListItem>
20+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "Feather" })}>
21+
<Text>Feather</Text>
22+
</ListItem>
23+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "FontAwesome" })}>
24+
<Text>FontAwesome</Text>
25+
</ListItem>
26+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "Foundation" })}>
27+
<Text>Foundation</Text>
28+
</ListItem>
29+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "Ionicons" })}>
30+
<Text>Ionicons</Text>
31+
</ListItem>
32+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "MaterialIcons" })}>
33+
<Text>MaterialIcons</Text>
34+
</ListItem>
35+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "MaterialCommunityIcons" })}>
36+
<Text>MaterialCommunityIcons</Text>
37+
</ListItem>
38+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "Octicons" })}>
39+
<Text>Octicons</Text>
40+
</ListItem>
41+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "SimpleLineIcons" })}>
42+
<Text>SimpleLineIcons</Text>
43+
</ListItem>
44+
<ListItem onPress={() => this.props.navigation.navigate('IconList', { iconFamily: "Zocial" })}>
45+
<Text>Zocial</Text>
46+
</ListItem>
47+
</List>
48+
</Content>
49+
</Container>
50+
);
51+
}
52+
}

src/components/IconList.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import React, { Component } from 'react';
2+
import { StyleSheet, FlatList } from 'react-native'
3+
import { Container, Header, Content, View, Icon, Left, Button, Body, Right, Title, Text } from 'native-base';
4+
import entypo from '../icon-list/Entypo';
5+
import evilIcons from '../icon-list/EvilIcons';
6+
import feather from '../icon-list/Feather';
7+
import fontAwesome from '../icon-list/FontAwesome';
8+
import foundation from '../icon-list/Foundation';
9+
import ionicons from '../icon-list/Ionicons';
10+
import materialCommunityIcons from '../icon-list/MaterialCommunityIcons';
11+
import materialIcons from '../icon-list/MaterialIcons';
12+
import octicons from '../icon-list/Octicons';
13+
import simpleLineIcons from '../icon-list/SimpleLineIcons';
14+
import zocial from '../icon-list/Zocial';
15+
16+
export default class IconList extends Component {
17+
18+
state = {
19+
iconFamily: undefined
20+
}
21+
22+
componentDidMount() {
23+
const { params } = this.props.navigation.state;
24+
let iconFamily = params.iconFamily;
25+
this.setState({ iconFamily })
26+
}
27+
28+
getIconList(iconFamily) {
29+
switch (iconFamily) {
30+
case "Entypo": return entypo;
31+
case "EvilIcons": return evilIcons;
32+
case "Feather": return feather;
33+
case "FontAwesome": return fontAwesome;
34+
case "Foundation": return foundation;
35+
case "Ionicons": return ionicons;
36+
case "MaterialCommunityIcons": return materialCommunityIcons;
37+
case "MaterialIcons": return materialIcons;
38+
case "Octicons": return octicons;
39+
case "SimpleLineIcons": return simpleLineIcons;
40+
case "Zocial": return zocial;
41+
default: return ionicons;
42+
}
43+
}
44+
45+
render() {
46+
const { params } = this.props.navigation.state;
47+
let iconFamily = params.iconFamily;
48+
let iconList = this.getIconList(iconFamily)
49+
return (
50+
<Container>
51+
<Header><Left>
52+
<Button transparent onPress={() => this.props.navigation.goBack()}>
53+
<Icon name='arrow-back' />
54+
</Button>
55+
</Left>
56+
<Body>
57+
<Title>{this.state.iconFamily}</Title>
58+
</Body>
59+
<Right />
60+
</Header>
61+
<Content>
62+
<FlatList
63+
data={iconList}
64+
keyExtractor={(item, index) => String(index)}
65+
renderItem={({ item }) => <View style={styles.item}>
66+
<Text style={styles.text}>{item}</Text>
67+
<Icon name={item} type={iconFamily} />
68+
</View>}
69+
/>
70+
</Content>
71+
</Container>
72+
);
73+
}
74+
}
75+
76+
const styles = StyleSheet.create({
77+
item: {
78+
flexDirection: 'row',
79+
padding: 5,
80+
borderColor: 'grey',
81+
borderBottomWidth: 1,
82+
borderTopWidth: 1,
83+
alignItems: 'center'
84+
},
85+
text: { marginRight: 15 }
86+
})

0 commit comments

Comments
 (0)