Skip to content

Commit

Permalink
Basic version of react-native greek-mythology app 🤘
Browse files Browse the repository at this point in the history
  • Loading branch information
vardhanapoorv committed Oct 5, 2019
1 parent 09d2f49 commit dcd2592
Show file tree
Hide file tree
Showing 14 changed files with 10,709 additions and 0 deletions.
4 changes: 4 additions & 0 deletions react-native/greek-mythology/.expo-shared/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true,
"89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true
}
11 changes: 11 additions & 0 deletions react-native/greek-mythology/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules/**/*
.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
web-report/
1 change: 1 addition & 0 deletions react-native/greek-mythology/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
18 changes: 18 additions & 0 deletions react-native/greek-mythology/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Base from './base/Base';

export default function App() {
return (
<View style={styles.container}>
<Base />
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff'
},
});
30 changes: 30 additions & 0 deletions react-native/greek-mythology/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"expo": {
"name": "Greek Mythology",
"slug": "greek-mythology",
"privacy": "public",
"sdkVersion": "35.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
}
}
}
10 changes: 10 additions & 0 deletions react-native/greek-mythology/assets/greek-gods.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"name": "Zeus",
"desc": "Zeus is the sky and thunder god in ancient Greek religion, who rules as king of the gods of Mount Olympus"
},
{
"name": "Ares",
"desc": "Ares is the Greek god of war. He is one of the Twelve Olympians, the son of Zeus and Hera. In Greek literature, he often represents the physical or violent and untamed aspect of war"
}
]
Binary file added react-native/greek-mythology/assets/icon.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 added react-native/greek-mythology/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions react-native/greek-mythology/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
31 changes: 31 additions & 0 deletions react-native/greek-mythology/base/Base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* @Author: Apoorv Vardhan
* @Date: 2019-10-05 14:21:09
* @Last Modified by: Apoorv Vardhan
* @Last Modified time: 2019-10-05 14:59:03
*/
import React from "react";
import { StyleSheet, Text, View } from 'react-native';
import Card from "../card/Card";
import GreekGods from '../assets/greek-gods.json';

function Base() {
return (
<View>
<View style={styles.heading}><Text>Greek Mythology</Text></View>
{GreekGods.map((god, index) => {
return <Card key={index} god={god} />;
})}
</View>
);
}

const styles = StyleSheet.create({
heading: {
alignItems: 'center',
justifyContent: 'center',
paddingTop: 40
}
});

export default Base;
26 changes: 26 additions & 0 deletions react-native/greek-mythology/card/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* @Author: Apoorv Vardhan
* @Date: 2019-10-05 14:21:22
* @Last Modified by: Apoorv Vardhan
* @Last Modified time: 2019-10-05 15:00:31
*/

import React from "react";
import { StyleSheet, Text, View } from 'react-native';

function Card(props) {
return (
<View style={styles.card}>
<Text>{props.god.name}</Text>
<Text>{props.god.desc}</Text>
</View>
);
}

const styles = StyleSheet.create({
card: {
padding: 10
}
})

export default Card;
21 changes: 21 additions & 0 deletions react-native/greek-mythology/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "^35.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-web": "^0.11.7"
},
"devDependencies": {
"babel-preset-expo": "^7.0.0"
},
"private": true
}
Loading

0 comments on commit dcd2592

Please sign in to comment.