1
+ import { Briefcase } from 'lucide-react'
2
+ import { useMediaQuery } from '@/hooks/useMediaQuery'
1
3
import Image from 'next/image'
2
4
3
5
export type ExperienceTileProps = {
@@ -8,31 +10,46 @@ export type ExperienceTileProps = {
8
10
responsibilities : string [ ]
9
11
}
10
12
13
+
14
+
11
15
export function ExperienceTile ( { companyLogo, companyName, position, period, responsibilities } : ExperienceTileProps ) {
16
+ const isDesktop = useMediaQuery ( '(min-width: 768px)' )
12
17
return (
13
- < div className = "bg-sushi-200 dark:bg-sushi-900 p-6 rounded-lg shadow-md" >
14
- < div className = "flex flex-col sm:flex-row items-center sm:items-start mb-4" >
15
- < div className = "mb-4 sm:mb-0 sm:mr-4 flex-shrink-0" >
16
- < img
17
- src = { companyLogo }
18
- alt = { `${ companyName } logo` }
19
- width = { 150 }
20
- height = { 75 }
21
- className = "rounded-lg"
22
- />
23
- </ div >
24
- < div className = "sm:text-left" >
25
- < h3 className = "text-xl font-semibold mb-2" > { position } </ h3 >
26
- < p className = "text-gray-600 dark:text-gray-400" > { companyName } | { period } </ p >
18
+ < div className = "mb-8 flex items-center" >
19
+ < div className = "relative flex-grow md:pl-28" >
20
+ { isDesktop ? (
21
+ < div className = "bg-white absolute left-[5px] top-3 p-1 rounded-full" >
22
+ { /* // center the bullet : `top-1/2 transform -translate-y-1/2` */ }
23
+ < img
24
+ src = { companyLogo }
25
+ alt = { `${ companyName } logo` }
26
+ width = { 150 }
27
+ height = { 75 }
28
+ className = "rounded-md"
29
+ />
30
+ </ div >
31
+ ) : (
32
+ < div className = "absolute left-[-10px] top-5" >
33
+ < Briefcase className = "bg-neutral-100 dark:bg-neutral-950 rounded-md w-6 h-6" />
34
+ </ div >
35
+ ) }
36
+ < div className = "pl-8 md:pl-16 py-3" >
37
+ < div className = "flex flex-col md:items-center sm:flex-row mb-4" >
38
+ < div >
39
+ < h2 className = "text-xl font-bold" > { position } </ h2 >
40
+ < h3 className = "text-lg font-semibold" > { companyName } </ h3 >
41
+ < h3 className = "text-gray-600 italic dark:text-gray-400" > { period } </ h3 >
42
+ </ div >
43
+ </ div >
44
+ < div className = "mt-4" >
45
+ < ul className = "list-inside text-gray-700 dark:text-gray-300 space-y-1" >
46
+ { responsibilities . map ( ( responsibility , index ) => (
47
+ < li key = { index } > - { responsibility } </ li >
48
+ ) ) }
49
+ </ ul >
50
+ </ div >
51
+ </ div >
27
52
</ div >
28
- </ div >
29
- < div className = "mt-4" >
30
- < ul className = "list-disc list-inside text-gray-700 dark:text-gray-300 space-y-1" >
31
- { responsibilities . map ( ( responsibility , index ) => (
32
- < li key = { index } > { responsibility } </ li >
33
- ) ) }
34
- </ ul >
35
- </ div >
36
53
</ div >
37
54
)
38
55
}
0 commit comments