File tree Expand file tree Collapse file tree 6 files changed +83
-53
lines changed Expand file tree Collapse file tree 6 files changed +83
-53
lines changed Original file line number Diff line number Diff line change 1
- .App {
1
+ .App {
2
+ margin : 0 1rem ;
2
3
text-align : center;
3
- }
4
-
5
- .App-logo {
6
- height : 40vmin ;
7
- pointer-events : none;
8
- }
9
-
10
- @media (prefers-reduced-motion : no-preference) {
11
- .App-logo {
12
- animation : App-logo-spin infinite 20s linear;
13
- }
14
- }
15
-
16
- .App-header {
17
- background-color : # 282c34 ;
18
- min-height : 100vh ;
19
- display : flex;
20
- flex-direction : column;
21
- align-items : center;
22
- justify-content : center;
23
- font-size : calc (10px + 2vmin );
24
- color : white;
25
- }
26
-
27
- .App-link {
28
- color : # 61dafb ;
29
- }
30
-
31
- @keyframes App-logo-spin {
32
- from {
33
- transform : rotate (0deg );
34
- }
35
- to {
36
- transform : rotate (360deg );
37
- }
38
- }
4
+ }
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
- import logo from './logo.svg' ;
3
1
import './App.css' ;
2
+ import Note from './components/notes/notes' ;
3
+ import { Notes } from './components/notes/data' ;
4
4
5
5
function App ( ) {
6
6
return (
7
7
< div className = "App" >
8
- < header className = "App-header" >
9
- < img src = { logo } className = "App-logo" alt = "logo" />
10
- < p >
11
- Edit < code > src/App.tsx</ code > and save to reload.
12
- </ p >
13
- < a
14
- className = "App-link"
15
- href = "https://reactjs.org"
16
- target = "_blank"
17
- rel = "noopener noreferrer"
18
- >
19
- Learn React
20
- </ a >
21
- </ header >
8
+ < h2 > Notes App</ h2 >
9
+ < div >
10
+ {
11
+ Notes . map (
12
+ note => < Note priority = { note . priority } text = { note . text } > </ Note >
13
+ )
14
+ }
15
+ </ div >
22
16
</ div >
23
17
) ;
24
18
}
Original file line number Diff line number Diff line change
1
+ import { NoteProps } from './notes-type' ;
2
+
3
+ export const Notes :NoteProps [ ] = [
4
+ {
5
+ id :1 ,
6
+ text : "This is note 1" ,
7
+ priority : "high"
8
+ } ,
9
+ {
10
+ id :2 ,
11
+ text : "This is note 2" ,
12
+ priority : "low"
13
+ } ,
14
+ {
15
+ id :3 ,
16
+ text : "This is note 3" ,
17
+ priority : "low"
18
+ } ,
19
+ {
20
+ id :4 ,
21
+ text : "This is note 4" ,
22
+ priority : "medium"
23
+ } ,
24
+ {
25
+ id :5 ,
26
+ text : "This is note 5" ,
27
+ priority : "medium"
28
+ }
29
+ ]
30
+
Original file line number Diff line number Diff line change
1
+ export type NoteProps = {
2
+ id ?: number ,
3
+ text : string ,
4
+ priority ? : 'high' | 'medium' | 'low'
5
+ }
Original file line number Diff line number Diff line change
1
+ .note {
2
+ border : 1px solid grey;
3
+ padding : 2rem ;
4
+ font-size : 1rem ;
5
+ color : # 333 ;
6
+ height : 10rem ;
7
+ border-radius : 0.5rem ;
8
+ background-color : burlywood;
9
+ margin-top : 1rem ;
10
+
11
+ }
12
+ .high {
13
+ background-color : rgb (246 , 100 , 92 );
14
+ color : white;
15
+ }
16
+ .medium {
17
+ background-color : rgb (244 , 158 , 127 );
18
+ }
19
+ .low {
20
+ background-color : rgb (248 , 249 , 175 );
21
+ }
Original file line number Diff line number Diff line change
1
+ import './notes.css'
2
+
3
+ import { NoteProps } from './notes-type' ;
4
+
5
+ function Note ( props : NoteProps ) {
6
+ return (
7
+ < div className = { `note ${ props . priority } ` } >
8
+ { props . text }
9
+ </ div >
10
+ )
11
+ }
12
+
13
+
14
+ export default Note ;
You can’t perform that action at this time.
0 commit comments