Skip to content

Instantly share code, notes, and snippets.

View Yassir4's full-sized avatar
🎯
Focusing

Hartani Yassir Yassir4

🎯
Focusing
View GitHub Profile
@Yassir4
Yassir4 / App.js
Last active January 5, 2019 12:09
import React from 'react';
import {
StyleSheet,
Text,
View,
ImageBackground,
TouchableOpacity,
TextInput
} from 'react-native';
import Icon from 'react-native-vector-icons/Feather';
@Yassir4
Yassir4 / Task.js
Last active January 6, 2019 09:33
import React from 'react'
import { View, TouchableOpacity, Text, StyleSheet } from 'react-native'
import Icon from 'react-native-vector-icons/Feather';
const Task = (props) => (
<View style={styles.taskWrapper}>
<Icon
name="square"
size={30}
color="#900"
style={{ marginLeft: 15 }}
@Yassir4
Yassir4 / Task.js
Last active January 6, 2019 10:16
import React from 'react'
import { View, TouchableOpacity, Text, StyleSheet } from 'react-native'
import Icon from 'react-native-vector-icons/Feather';
const Task = (props) => (
<View style={styles.taskWrapper}>
<Icon
name={props.checked ? "check" : "square"}
size={30}
color="#900"
style={{ marginLeft: 15 }}
@Yassir4
Yassir4 / screens.js
Last active July 31, 2019 12:22
registering the screens
import {Navigation} from 'react-native-navigation';
import Home from '../screens/Home';
import PushedScreen from '../screens/PushedScreen';
import ModalScreen from '../screens/ModalScreen';
export function registerScreens() {
Navigation.registerComponent('HomeScreen', () => Home);
Navigation.registerComponent('PushedScreen', () => PushedScreen);
Navigation.registerComponent('ModalScreen', () => ModalScreen);
}
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
const pushScreen = props => {
const {componentId} = props;
Navigation.push(componentId, {
component: {
name: 'PushedScreen',
@Yassir4
Yassir4 / index.js
Created July 31, 2019 18:49
PushScreen component
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import styles from './styles';
const PushedScreen = props => {
return (
<View style={styles.container}>
<Text style={styles.headerText}>Pushed Screen</Text>
<TouchableOpacity style={styles.backButton}>
<Text style={styles.backButtonText}>Go Back</Text>
@Yassir4
Yassir4 / styles.js
Created July 31, 2019 18:50
PushedScreen styles
import {StyleSheet} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'skyblue',
},
headerText: {
// PushedScreen/index.js
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
const goBack = ({componentId}) => Navigation.pop(componentId);
const PushedScreen = props => {
return (
<View style={styles.container}>
@Yassir4
Yassir4 / index.js
Last active August 4, 2019 12:29
Home/index.js
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
const pushScreen = props => {
const {componentId} = props;
Navigation.push(componentId, {
component: {
name: 'PushedScreen',
@Yassir4
Yassir4 / index.js
Created August 4, 2019 18:45
ModalScreen/index.js
// ModalScreen/index.js
import React, {Component} from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
class ModalScreen extends Component {
constructor(props) {
super(props);
Navigation.events().bindComponent(this);