mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
adding docs subtree
This commit is contained in:
1
docs/step1-04/final/index.html
Normal file
1
docs/step1-04/final/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<!doctype html><html><body><div id="app"></div><script src="../../step1-04/final/step1-04/final.js"></script><script src="../../markdownReadme/markdownReadme.js"></script></body></html>
|
||||
14
docs/step1-04/final/src/App.tsx
Normal file
14
docs/step1-04/final/src/App.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import { Counter } from './components/Counter';
|
||||
|
||||
export class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<h2>My App</h2>
|
||||
<Counter text="Chickens" />
|
||||
<Counter text="Ducks" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
15
docs/step1-04/final/src/components/Button.css
Normal file
15
docs/step1-04/final/src/components/Button.css
Normal file
@@ -0,0 +1,15 @@
|
||||
.Button {
|
||||
display: block;
|
||||
background: #0078d4;
|
||||
color: white;
|
||||
padding: 5px 10px;
|
||||
outline: none;
|
||||
border: none;
|
||||
}
|
||||
.Button:hover {
|
||||
background: #005a9e;
|
||||
}
|
||||
|
||||
.Button:active {
|
||||
background: #004578;
|
||||
}
|
||||
10
docs/step1-04/final/src/components/Button.tsx
Normal file
10
docs/step1-04/final/src/components/Button.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import './Button.css';
|
||||
|
||||
export const Button = props => {
|
||||
return (
|
||||
<button className="Button" onClick={props.onClick}>
|
||||
{props.children}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
25
docs/step1-04/final/src/components/Counter.tsx
Normal file
25
docs/step1-04/final/src/components/Counter.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
import { Button } from './Button';
|
||||
|
||||
export class Counter extends React.Component<any, any> {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
counter: 0
|
||||
};
|
||||
}
|
||||
render() {
|
||||
const { counter } = this.state;
|
||||
const { text } = this.props;
|
||||
return (
|
||||
<div>
|
||||
{text}: {counter}
|
||||
<Button onClick={this._onButtonCLick}>Click</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
_onButtonCLick = () => {
|
||||
this.setState({ counter: this.state.counter + 1 });
|
||||
};
|
||||
}
|
||||
4
docs/step1-04/final/src/index.tsx
Normal file
4
docs/step1-04/final/src/index.tsx
Normal file
@@ -0,0 +1,4 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { App } from './App';
|
||||
ReactDOM.render(<App />, document.getElementById('app'));
|
||||
32
docs/step1-04/final/step1-04/final.js
Normal file
32
docs/step1-04/final/step1-04/final.js
Normal file
File diff suppressed because one or more lines are too long
1
docs/step1-04/final/step1-04/final.js.map
Normal file
1
docs/step1-04/final/step1-04/final.js.map
Normal file
File diff suppressed because one or more lines are too long
15
docs/step1-04/index.html
Normal file
15
docs/step1-04/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="../assets/shared.css" />
|
||||
<link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/9.6.1/css/fabric.min.css" />
|
||||
</head>
|
||||
|
||||
<body class="ms-Fabric">
|
||||
<div class="Container">
|
||||
<ul class="Tiles">
|
||||
<li class="Tile"><a href="./demo/index.html" class="Tile-link">Demo Start</a></li>
|
||||
<li class="Tile"><a href="./final/index.html" class="Tile-link">Final</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user