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
REM Install Chocolatey package manager with cmd.exe | |
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
REM ..or Install Chocolatey package manager with Powershell.exe | |
REM Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
REM Install the Dart SDK | |
choco install dart-sdk | |
REM ..or Install the Dart SDK development version |
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
# Update package repo listings | |
sudo apt-get update | |
# Enable access to repos using the HTTPS protocol | |
sudo apt-get install apt-transport-https | |
# Add Google linux sign in key to allow Dart repo registry | |
sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' | |
# Register Dart repo (release version) |
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 { | |
Route, | |
Link, | |
Redirect, | |
BrowserRouter as Router | |
} from "react-router-dom"; | |
const HomePage = () => { | |
return ( |
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 createHistory from 'history/createBrowserHistory' | |
const RouterContext = React.createContext(); | |
class Router extends Component { | |
constructor(props){ | |
super(props); | |
this.history = createHistory(); |
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'} |
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, {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
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, {Component} from 'react' | |
import styles from './timer.module.css' | |
export default class Timer extends Component { | |
state = { | |
timerValue: 0 | |
}; | |
intervalId = null; |