File tree Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,5 @@ import React from 'react';
2
2
import Welcome from './components/Welcome'
3
3
4
4
5
- const App = ( ) => < div className = "App" >
6
- < Welcome />
7
- < Welcome name = "Mauricio" />
8
- </ div > ;
5
+ const App = ( ) => < div className = "App" > < Welcome /> </ div > ;
9
6
export default App ;
Original file line number Diff line number Diff line change 1
- import React from "react" ;
1
+ import React , { Fragment } from "react" ;
2
2
import styled from "styled-components" ;
3
3
4
- const Title = styled . h1 `
5
- font-size: 30px;
6
- text-align: center;
7
- color: ${ props => ( props . primary ? "#e95678" : "#25b0bc" ) } ; //(C)
4
+ const Button = styled . button `
5
+ font-size: 14px;
6
+ font-weight: 400;
7
+ background-color: #4a430b;
8
+ border: none;
9
+ cursor: pointer;
10
+ color: #ffffff;
11
+ padding: 10px 20px;
12
+ border-radius: 4px;
8
13
` ;
9
14
10
- const Welcome = ( { name = "Stranger" } ) => {
11
- const isStranger = name === "Stranger" ; //(A)
15
+ const Link = styled ( Button ) `
16
+ color: #4a430b;
17
+ background-color: transparent;
18
+ ` ;
19
+
20
+ const Welcome = ( ) => {
12
21
return (
13
- < Title primary = { isStranger } >
14
- { /* (B) */ } Hello { name }
15
- </ Title >
22
+ < Fragment >
23
+ < Button > Click me!!</ Button >
24
+ < Link as = "a" > Give me click too!!</ Link >
25
+ </ Fragment >
16
26
) ;
17
27
} ;
18
28
You can’t perform that action at this time.
0 commit comments