Built Portfolio Page - 9(Experience)

1. Install timeline package

1
npm i react-vertical-timeline-component

2. Add Margin Bottom

Projects.tsx

1
2
3
...
<section id="projects" className='scroll-mt-28 mb-28'>
...

3. Add Experience Components

Add src/components/Experience.tsx:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"use client";

import React from "react";

import {
VerticalTimeline,
VerticalTimelineElement,
} from "react-vertical-timeline-component";
import "react-vertical-timeline-component/style.min.css";
import SectionHeading from "./Section-heading";
import { useSectionInView } from "@/hooks/useSectionInView";
import { experiencesData } from "@/libs/data";

export default function Experience() {
const { ref } = useSectionInView("Experience");
return (
<section id="experience" ref={ref} className="scroll-mt-28 mb-28 sm:mb-40">
<SectionHeading>My experience</SectionHeading>
<VerticalTimeline>
{experiencesData.map((item, index) => (
<React.Fragment key={index}>
<VerticalTimelineElement
contentStyle={{
background: "#f3f4f6",
boxShadow: "none",
border: "1px solid rgba(0, 0, 0, 0.05)",
textAlign: "left",
padding: "1.3rem 2rem",
}}
contentArrowStyle={{
borderRight: "0.4rem solid #9ca3af"
}}
date={item.date}
icon={item.icon}
iconStyle={{
background: "white",
fontSize: "1.5rem",
}}
visible={true}
>
<h3 className="font-semibold capitalize">{item.title}</h3>
<p className="font-normal !mt-0">{item.location}</p>
<p className="!mt-1 !font-normal text-gray-700">
{item.description}
</p>
</VerticalTimelineElement>
</React.Fragment>
))}
</VerticalTimeline>
</section>
);
}

请我喝杯咖啡吧~

支付宝
微信