1
- import LinkWithArrow from '@/components/ui/LinkWithArrow ' ;
2
- import { useMediaQuery } from '@/hooks/useMediaQuery' ;
3
- // import Image from 'next/image ';
1
+ import { Icon } from '@iconify/react ' ;
2
+
3
+ import { RecordTile } from '@/components/Tiles/RecordTile ' ;
4
4
5
5
export type ExperienceTileProps = {
6
6
companyLogo : string ;
@@ -19,56 +19,30 @@ export function ExperienceTile({
19
19
period,
20
20
responsibilities,
21
21
} : ExperienceTileProps ) {
22
- const isTablet = useMediaQuery ( '(min-width: 768px)' ) ;
23
- const isDesktop = useMediaQuery ( '(min-width: 1280px)' ) ;
24
- return (
25
- < div className = "-mb-2 flex items-center" >
26
- < div className = "group relative flex-grow lg:-ml-[132px] xl:-ml-40 2xl:-ml-52" >
27
- { isTablet && (
28
- < div className = "opacity-0 transition-opacity delay-100 md:group-hover:opacity-100" >
29
- < div className = "absolute top-1/2 aspect-square -translate-y-1/2 transform rounded-lg bg-transparent" >
30
- { /* // center the bullet : `top-1/2 transform -translate-y-1/2` */ }
31
- < img
32
- src = { companyLogo }
33
- alt = { `${ companyName } logo` }
34
- width = { isDesktop ? 80 : 70 }
35
- height = { isDesktop ? 80 : 70 }
36
- className = "rounded-md"
37
- />
38
- </ div >
39
- </ div >
40
- ) }
41
- < div className = "py-3 lg:pl-[132px] xl:pl-40 2xl:pl-52" >
42
- < div className = "flex flex-col justify-between sm:flex-row md:items-start" >
43
- < div >
44
- < h2 className = "text-xl font-bold" > { position } </ h2 >
45
- < LinkWithArrow
46
- href = { companyLink }
47
- target = "_blank"
48
- rel = "noopener noreferrer"
49
- aria-label = { `Link to ${ companyName } ` }
50
- >
51
- < h3 className = "text-lg font-semibold" > { companyName } </ h3 >
52
- </ LinkWithArrow >
53
- { ! isTablet && (
54
- < h3 className = "font-typewriter text-gray-600 dark:text-gray-400" > { period } </ h3 >
55
- ) }
56
- </ div >
57
- { isTablet && (
58
- < h3 className = "font-typewriter text-gray-600 dark:text-gray-400" > { period } </ h3 >
59
- ) }
60
- </ div >
61
- { responsibilities && responsibilities . length > 0 && (
62
- < div className = "mt-3" >
63
- < ul className = "list-inside list-['-_'] space-y-1 text-gray-700 dark:text-gray-300" >
64
- { responsibilities . map ( ( responsibility , index ) => (
65
- < li key = { index } > { responsibility } </ li >
66
- ) ) }
67
- </ ul >
68
- </ div >
69
- ) }
70
- </ div >
71
- </ div >
22
+ const responsibilitiesAsHTML = responsibilities && responsibilities . length > 0 && (
23
+ < div className = "mt-3" >
24
+ < ul className = "list-inside list-none space-y-1 text-gray-700 dark:text-gray-300" >
25
+ { responsibilities . map ( ( responsibility , index ) => (
26
+ < li key = { index } >
27
+ < span className = "mr-1 inline-block align-middle" >
28
+ { < Icon icon = { 'icons8:angle-right' } inline = { true } /> }
29
+ </ span >
30
+ { responsibility }
31
+ </ li >
32
+ ) ) }
33
+ </ ul >
72
34
</ div >
73
35
) ;
36
+
37
+ return (
38
+ < RecordTile
39
+ organizationLogo = { companyLogo }
40
+ organizationName = { companyName }
41
+ organizationLink = { companyLink }
42
+ role = { position }
43
+ duration = { period }
44
+ body = { responsibilitiesAsHTML }
45
+ organizationBeforeRole = { true }
46
+ />
47
+ ) ;
74
48
}
0 commit comments