The Work component renders a single work experience entry on the portfolio. It displays a company logo, a role title, an optional description of responsibilities, and a date range with location.
Props
| Prop | Type | Required | Description |
|---|
title | string | Yes | Job title or role name, displayed in bold. |
text | string | No | Short description of responsibilities at the role. Some entries omit this field. |
image | string | No | URL of the company logo, typically hosted on Cloudinary. Some entries omit this field. |
timeLine | string | Yes | Date range and location string, e.g. "May - August 2023. Seattle, WA". |
Usage
The following example renders a GoDaddy internship entry:
<Work
title="GoDaddy Software Engineer Intern:"
text="A/B Tested features on GoDaddy's Checkout Page."
image="https://res.cloudinary.com/dlk3ezbal/image/upload/v1702062289/gd_zdghmr.png"
timeLine="May - August 2023. Seattle, WA"
/>
Entries without image or text
Newer entries — such as a stealth startup founder role — may omit both text and image. The component renders gracefully without them:
<Work
title="Stealth Startup — Founder"
timeLine="September 2023 — Present"
/>
When image is omitted, no img element is rendered. When text is omitted, the description paragraph is empty but the layout is otherwise unchanged.
How Work is rendered in Home.js
Home.js maintains a currentWorkExperience state variable. It starts as the first 2 entries of the full array and maps over all items in the state to render one Work per entry:
// Initial state — only first 2 entries visible
const [currentWorkExperience, setCurrentWorkExperience] = useState(
workExperience.slice(0, 2)
);
// Toggle to show all or collapse back to 2
const toggleWorkExperience = () => {
if (currentWorkExperience.length === 2) {
setCurrentWorkExperience(workExperience);
} else {
setCurrentWorkExperience(workExperience.slice(0, 2));
}
};
// Render — maps over the full currentWorkExperience state
{currentWorkExperience.map((work) => (
<Work
title={work.title}
text={work.text}
image={work.image}
timeLine={work.timeLine}
key={work.title}
/>
))}
The slice happens when state is set, not at render time. To always show all entries, initialize state with the full array: useState(workExperience).
CSS classes
The component uses the following CSS class names:
| Class | Element | Purpose |
|---|
internshipCard | Outer wrapper div | Card layout, border, and spacing. |
bold2 | p wrapping title and text | Sets font size for the content block. |
bold | span wrapping title | Makes the role name bold. |
internshipDate | p wrapping timeLine | Right-aligns or styles the date string. |