This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {AppRegistry} from 'react-native'; | |
import App from './src/app/App'; | |
import {name as appName} from './app.json'; | |
AppRegistry.registerComponent(appName, () => App); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {StyleSheet} from 'react-native' | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
flexDirection: 'column', | |
}, | |
header: { | |
flex: 1, | |
backgroundColor: '#fcbe2f', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import {Text, View} from 'react-native'; | |
export default class App extends Component{ | |
render() { | |
return ( | |
<View style={{backgroundColor: 'white'}}> | |
<Text>Hello World!</Text> | |
</View> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import {Text, View} from 'react-native'; | |
import appStyles from './AppStyle' | |
export default class App extends Component{ | |
render() { | |
return ( | |
<View style={appStyles.container}> | |
<View style={appStyles.header}> | |
<Text> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import styles from './timer.module.css' | |
export default class Timer extends Component { | |
state = { | |
timerValue: 0 | |
}; | |
intervalId = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import './App.css'; | |
import Timer from './component/timer/timer' | |
import Counter from './component/counter/counter' | |
export default class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<Counter min={0} max={10}/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState, useCallback} from 'react' | |
import styles from '../timer/timer.module.css' | |
let intervalId = null; | |
export default function FunctionalTimer() { | |
let [value, setValue] = useState(0); | |
let [started, setStarted] = useState(false); | |
const toggle = useCallback(() => { | |
if (started) pause(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.mainFrame{ | |
flex: 1; | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
} | |
.rectangle{ | |
border: 5px solid black; | |
width: 400px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
const Third = (props) => { | |
return ( | |
<div> | |
<h3>Third</h3> | |
<p>Number: {props.number}</p> | |
<p>Text: {props.text}</p> | |
</div> | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import withActiveDetail from './withActiveDetail' | |
class ActiveDetail extends Component { | |
render() { | |
return ( | |
<div> | |
<h3>Active Detail</h3> | |
<div style={{backgroundColor: this.props.isOnline? this.props.isOnlineColor: this.props.isOfflineColor}}> | |
{this.props.isOnline? 'Online': 'Offline'} |
OlderNewer