File tree Expand file tree Collapse file tree 4 files changed +36
-10
lines changed Expand file tree Collapse file tree 4 files changed +36
-10
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ export default function CourseCard ( prop : any ) {
4
+
5
+ return (
6
+ < div className = "w-64 h-40 bg-white m-10 p-4 rounded-md" >
7
+ < p >
8
+ { prop . description }
9
+ </ p >
10
+ </ div >
11
+ )
12
+ }
Original file line number Diff line number Diff line change 1
1
'use client' ;
2
2
import React from 'react'
3
+ import CourseCard from './CourseCard' ;
3
4
4
5
export const SearchBar = ( ) => {
5
6
const [ searchTerm , setSearchTerm ] = React . useState ( '' ) ;
@@ -20,14 +21,27 @@ export const SearchBar = () => {
20
21
( item as { name : string } ) . name . toLowerCase ( ) . includes ( searchTerm . toLowerCase ( ) )
21
22
) ;
22
23
24
+ const courseCards = filteredData . map ( item => {
25
+ return (
26
+ < div >
27
+ < CourseCard
28
+ description = { ( item as { name : string } ) . name }
29
+ />
30
+ </ div >
31
+ ) ;
32
+ } )
33
+
23
34
return (
24
- < div className = "text -center py-4 " >
25
- < input className = "bg-white py-0.1 text-center text-0.5xl border border-black rounded-md" type = "text" placeholder = "search a course" value = { searchTerm } onChange = { e => setSearchTerm ( e . target . value ) } / >
26
- < ul className = "flex flex-wrap" >
27
- { filteredData . map ( ( item ) => (
28
- < li className = "w-64 h-40 bg-white m-10 p-4 rounded-md" key = { ( item as { name : string } ) . name } > { ( item as { name : string } ) . name } </ li >
29
- ) ) }
35
+ < div className = "justify -center" >
36
+ < div className = "px-20" >
37
+ < input className = "px-3 w-full bg-white py-0.1 text-0.5xl border border-black rounded-md text-left placeholder-left" type = "text" placeholder = "search for a course..." value = { searchTerm } onChange = { e => setSearchTerm ( e . target . value ) } / >
38
+ </ div >
39
+ < ul className = "flex flex-wrap justify-center" >
40
+ { courseCards }
30
41
</ ul >
31
42
</ div >
32
43
)
33
44
}
45
+
46
+ // create card item
47
+ // create array of card using mapping
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
- import { SearchBar } from "./SearchBar"
2
+ import { SearchBar } from "../components /SearchBar"
3
3
4
4
export default function CourseRatingPage ( ) {
5
5
return (
6
6
< div className = "@apply bg-[#221f1f]" >
7
7
{ /* <NavBar/> */ }
8
- < h1 className = "font-sans text-5xl text-white font-semibold text-center p-5 " > OverLoad</ h1 >
8
+ < h1 className = "pt-20 font-sans text-5xl text-white font-semibold p-5 text-left px-20 " > OverLoad</ h1 >
9
9
< SearchBar />
10
10
{ /* <SortButton/> */ }
11
11
</ div >
Original file line number Diff line number Diff line change 17
17
}
18
18
19
19
body {
20
- color : rgb ( var ( --foreground-rgb )) ;
21
- }
20
+ background- color: # 221f1f ;
21
+ }
You can’t perform that action at this time.
0 commit comments