Skip to content

Instantly share code, notes, and snippets.

View haruelrovix's full-sized avatar
👨‍💻
Working from anywhere

Havit Rovik haruelrovix

👨‍💻
Working from anywhere
View GitHub Profile
@haruelrovix
haruelrovix / App.js
Created December 9, 2018 01:27
RNE x RNW: Import Home component
import React, { Component } from 'react';
import Home from './Components/Home';
class App extends Component {
render() {
return (
<Home />
);
}
}
@haruelrovix
haruelrovix / Home.js
Last active December 10, 2018 01:52
RNE x RNW: Add styling to Home component
import React, { PureComponent } from 'react';
import { View } from 'react-native';
import { Input, Button } from 'react-native-elements';
import styles from './Shared.style';
class Home extends PureComponent {
render() {
const { input, button } = styles;
@haruelrovix
haruelrovix / Shared.style.js
Last active December 10, 2018 01:53
RNE x RNW: Style for Home
export default {
input: {
containerStyle: {
marginBottom: 10
},
inputStyle: {
height: 46
}
},
button: {
@haruelrovix
haruelrovix / Home.js
Last active December 10, 2018 02:00
RNW x RNE: Add Home component
import React, { PureComponent } from 'react';
import { View } from 'react-native';
import { Input, Button } from 'react-native-elements';
class Home extends PureComponent {
render() {
return (
<View>
<Input
label='Owner'
@haruelrovix
haruelrovix / index.js
Created December 10, 2018 02:20
RNW x RNE: RNVI works like a charm with RNW!
import React from 'react';
import ReactDOM from 'react-dom';
// Generate required css
import iconFont from 'react-native-vector-icons/Fonts/FontAwesome.ttf';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
@haruelrovix
haruelrovix / webpack.config.dev.js
Last active December 10, 2018 02:22
RNW x RNE: url-loader
{
test: /\.ttf$/,
loader: 'url-loader',
include: path.join(paths.appNodeModules, 'react-native-vector-icons'),
},
@haruelrovix
haruelrovix / CommitList.js
Created December 11, 2018 22:10
RNE x RNW: Placeholder for second screen
import React from 'react';
import { Text, View } from 'react-native';
import styles from '../Shared.style';
const CommitList = () => (
<View style={styles.container}>
<Text>Placeholder for second screen</Text>
</View>
);
@haruelrovix
haruelrovix / Routing.web.js
Created December 11, 2018 22:27
RNE x RNW: Routing for web
export {
BrowserRouter as Router,
Link,
Route,
Switch,
withRouter
} from 'react-router-dom';
@haruelrovix
haruelrovix / App.js
Created December 11, 2018 22:41
RNE x RNW: Add second component and Routing
import React, { Component } from 'react';
import Home from './Components/Home';
import CommitList from './Components/Commit/CommitList';
import { Route, Router, Switch } from './Utils/Routing';
class App extends Component {
render() {
return (
<Router>
<Switch>
@haruelrovix
haruelrovix / Home.js
Created December 11, 2018 22:52
RNE x RNW: Add withRouter to Home
import React, { PureComponent } from 'react';
import { View } from 'react-native';
import { Input, Button } from 'react-native-elements';
import styles from './Shared.style';
import { withRouter } from '../Utils/Routing';
class Home extends PureComponent {
onPressButton = () => {
// Go to Commit screen