@@ -2,13 +2,23 @@ import { useRef } from 'react';
22import { useCursor } from '../Cursor' ;
33import { CardBasic , Icon } from './Card' ;
44import { CardExportProps } from './types' ;
5- import { Wrap } from '@chakra-ui/react' ;
5+ import { Box , Button , HStack , Text , Wrap } from '@chakra-ui/react' ;
6+ import { Chip , Language } from '../Chip' ;
7+ import { Link } from 'react-router-dom' ;
8+ import { PROJECT_NAME_ICON_MAP } from '@assets' ;
69
7- const Card = ( { titleText, chips : chipText , centerText } : CardExportProps ) => {
10+ const Card = ( {
11+ titleText,
12+ chips,
13+ centerText,
14+ icon,
15+ description,
16+ link,
17+ } : CardExportProps ) => {
818 const ref = useRef < HTMLDivElement > ( null ) ;
919 const { setCursorInsets } = useCursor ( ) ;
1020 return (
11- < div
21+ < Box
1222 ref = { ref }
1323 onMouseEnter = { ( ) =>
1424 setCursorInsets ( {
@@ -20,26 +30,56 @@ const Card = ({ titleText, chips: chipText, centerText }: CardExportProps) => {
2030 }
2131 onMouseLeave = { ( ) => setCursorInsets ( undefined ) }
2232 className = "border border-black/[0.2] dark:border-white/[0.2] flex flex-col items-start max-w-sm p-4 relative"
33+ style = { {
34+ backdropFilter : 'blur(10px)' ,
35+ backgroundColor : 'rgba(255, 255, 255, 0.1)' ,
36+ } }
2337 >
24- < CardBasic text = { centerText } />
38+ < CardBasic text = { centerText } icon = { icon && PROJECT_NAME_ICON_MAP [ icon ] } />
2539 < Icon className = "absolute h-6 w-6 -top-3 -left-3 dark:text-white text-black" />
2640 < Icon className = "absolute h-6 w-6 -bottom-3 -left-3 dark:text-white text-black" />
2741 < Icon className = "absolute h-6 w-6 -top-3 -right-3 dark:text-white text-black" />
2842 < Icon className = "absolute h-6 w-6 -bottom-3 -right-3 dark:text-white text-black" />
29- < h2 className = "dark:text-white text-black mt-4 text-md font-light" >
30- { titleText }
31- </ h2 >
32- < Wrap mt = { 2 } >
33- { chipText ?. map ( ( chipText ) => (
34- < p
35- key = { chipText }
36- className = "text-sm border font-light dark:border-white/[0.2] border-black/[0.2] rounded-full text-black dark:text-white px-1 "
37- >
38- { chipText }
39- </ p >
40- ) ) }
43+ < HStack
44+ justifyContent = { 'space-between' }
45+ width = { 'full' }
46+ alignItems = { 'center' }
47+ alignContent = { 'center' }
48+ marginTop = { 2 }
49+ mb = { 2 }
50+ >
51+ < Text
52+ fontSize = "md"
53+ color = "white"
54+ fontWeight = "bold"
55+ textAlign = "left"
56+ lineHeight = { 5 }
57+ as = "a"
58+ href = { link }
59+ >
60+ { titleText }
61+ </ Text >
62+ < Button size = "sm" py = { 0 } px = { 1 } as = { Link } to = { '/projects/' + icon } >
63+ Know More
64+ </ Button >
65+ </ HStack >
66+ < Text
67+ maxW = { '72' }
68+ fontSize = "sm"
69+ color = "white"
70+ textAlign = "justify"
71+ lineHeight = { 5 }
72+ mb = { 2 }
73+ >
74+ { description }
75+ </ Text >
76+ < Wrap mt = { 2 } maxW = { '72' } >
77+ { chips
78+ ?. slice ( 0 , 5 )
79+ ?. map ( ( tag ) => < Chip key = { tag } type = { tag } size = "sm" /> ) }
80+ < Chip type = { Language . more } size = "sm" />
4181 </ Wrap >
42- </ div >
82+ </ Box >
4383 ) ;
4484} ;
4585
0 commit comments