File tree Expand file tree Collapse file tree 3 files changed +53
-16
lines changed Expand file tree Collapse file tree 3 files changed +53
-16
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import Welcome from './components/Welcome '
2
+ import Component from './components/Component '
3
3
4
-
5
- const App = ( ) => < div className = "App" > < Welcome /> </ div > ;
4
+ const App = ( ) => < div className = "App" > < Component theme = { theme } /> </ div > ;
6
5
export default App ;
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
+ import styled from "styled-components" ;
3
+
4
+ const Wrapper = styled . div `
5
+ padding: 40px;
6
+ text-align: left;
7
+ background: #f7df1e;
8
+ color: #3c3a2d;
9
+ ` ;
10
+
11
+ const Title = styled . h1 `
12
+ font-size: 30px;
13
+ font-weight: 900;
14
+ ` ;
15
+ const Paragraph = styled . p `
16
+ font-size: 15px;
17
+ font-weight: 300;
18
+ ` ;
19
+ const Button = styled . button `
20
+ font-size: 14px;
21
+ font-weight: 400;
22
+ background-color: #4a430b;
23
+ border: none;
24
+ cursor: pointer;
25
+ color: #ffffff;
26
+ padding: 10px 20px;
27
+ border-radius: 4px;
28
+ &:hover {
29
+ background-color: #342f08;
30
+ }
31
+ ` ;
32
+ const Link = styled . a `
33
+ font-size: 14px;
34
+ font-weight: 400;
35
+ background-color: transparent;
36
+ border: none;
37
+ cursor: pointer;
38
+ color: #3c3a2d;
39
+ padding: 10px 20px;
40
+ border-radius: 4px;
41
+ ` ;
2
42
3
43
const Component = props => {
4
44
return (
5
- < div >
6
- < h1 > Example component CSS</ h1 >
7
- < p >
45
+ < Wrapper >
46
+ < Title > Example component CSS</ Title >
47
+ < Paragraph >
8
48
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ducimus,
9
49
temporibus labore voluptatibus aspernatur illo ad id sit nulla, a atque
10
50
doloribus itaque ab? Soluta, exercitationem illum provident quod iure
11
51
numquam?
12
- </ p >
13
- < button > I'm a button</ button >
14
- < a href = "/#" onClick = { e => e . preventDefault ( ) } >
52
+ </ Paragraph >
53
+ < Button > I'm a button</ Button >
54
+ < Link href = "/#" onClick = { e => e . preventDefault ( ) } >
15
55
I'm a link
16
- </ a >
17
- </ div >
56
+ </ Link >
57
+ </ Wrapper >
18
58
) ;
19
59
} ;
20
60
Original file line number Diff line number Diff line change @@ -10,18 +10,16 @@ const Button = styled.button`
10
10
color: #ffffff;
11
11
padding: 10px 20px;
12
12
border-radius: 4px;
13
- ` ;
14
13
15
- const Link = styled ( Button ) `
16
- color: #4a430b ;
17
- background-color: transparent;
14
+ &:hover {
15
+ background- color: #342f08 ;
16
+ }
18
17
` ;
19
18
20
19
const Welcome = ( ) => {
21
20
return (
22
21
< Fragment >
23
22
< Button > Click me!!</ Button >
24
- < Link as = "a" > Give me click too!!</ Link >
25
23
</ Fragment >
26
24
) ;
27
25
} ;
You can’t perform that action at this time.
0 commit comments