Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hartani Yassir Yassir4

🎯
Focusing
Block or report user

Report or block Yassir4

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Yassir4
Yassir4 / index.js
Created Aug 13, 2019
export navigation functions Navigation/index.js
View index.js
export const pushScreen = props => {
const { componentId } = props;
Navigation.push(componentId, {
component: {
name: 'PushedScreen',
},
});
};
export const openModal = () => {
@Yassir4
Yassir4 / styles.js
Created Aug 4, 2019
ModalScreen/styles.js
View styles.js
// ModalScreen/styles.js
import {StyleSheet} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'skyblue',
},
@Yassir4
Yassir4 / index.js
Created Aug 4, 2019
ModalScreen/index.js
View 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);
@Yassir4
Yassir4 / index.js
Last active Aug 4, 2019
Home/index.js
View 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',
View index.js
// 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 / styles.js
Created Jul 31, 2019
PushedScreen styles
View styles.js
import {StyleSheet} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'skyblue',
},
headerText: {
@Yassir4
Yassir4 / index.js
Created Jul 31, 2019
PushScreen component
View index.js
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>
View 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 / screens.js
Last active Jul 31, 2019
registering the screens
View screens.js
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);
}
View Task.js
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 }}
You can’t perform that action at this time.