-
Notifications
You must be signed in to change notification settings - Fork 0
/
RenderDifferentUI.js
82 lines (68 loc) · 1.48 KB
/
RenderDifferentUI.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Renderiza una interfaz de usuario diferente basada en accesorios
// app.js
import React from 'react';
import ReactDOM from 'react-dom';
import { Greeting } from './Greeting';
class App extends React.Component {
render() {
return (
<div>
<h1>
Hullo and, "Welcome to The Newzz," "On Line!"
</h1>
<Greeting name="Alison" signedIn={true}/>
<article>
Latest: where is my phone?
</article>
</div>
);
}
}
ReactDOM.render(
<App />,
document.getElementById('app')
);
// Greeting.js
import React from 'react';
import ReactDOM from 'react-dom';
export class Greeting extends React.Component {
render() {
if (this.props.signedIn == false) {
return <h1>GO AWAY</h1>;
} else {
return <h1>Hi there, {this.props.name}!</h1>;
}
}
}
// Home.js
import React from 'react';
import ReactDOM from 'react-dom';
import { Welcome } from './Welcome';
class Home extends React.Component {
render() {
return <Welcome name='Ludwig van Beethoven' />;
}
}
ReactDOM.render(
<Home />,
document.getElementById('app')
);
// Welcome.js
import React from 'react';
export class Welcome extends React.Component {
render() {
if (this.props.name == 'Wolfgang Amadeus Mozart') {
return (
<h2>
hello sir it is truly great to meet you here on the web
</h2>
);
} else {
return (
<h2>
WELCOME "2" MY WEB SITE BABYYY!!!!!
</h2>
);
}
}
}