diff --git a/src/components/atoms/divided-list.astro b/src/components/atoms/divided-list.astro new file mode 100644 index 0000000..8d82f58 --- /dev/null +++ b/src/components/atoms/divided-list.astro @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/components/atoms/section-card.astro b/src/components/atoms/section-card.astro index f9a41a4..f44e420 100644 --- a/src/components/atoms/section-card.astro +++ b/src/components/atoms/section-card.astro @@ -1,11 +1,23 @@ --- import type { Section } from '@/types/data'; +import Typography from './typography.astro'; + export interface Props { section: Section; + title?: string; } -const { section } = Astro.props; +const { section, title } = Astro.props; --- -
+
+ { + title && ( + + {title} + + ) + } + +
diff --git a/src/components/organisms/project-timeline-item.astro b/src/components/organisms/project-timeline-item.astro index a6a5fcd..2d19e4e 100644 --- a/src/components/organisms/project-timeline-item.astro +++ b/src/components/organisms/project-timeline-item.astro @@ -26,7 +26,7 @@ const { alt, ...sharedImageProps } = { } as const; --- -
+
+
{author} diff --git a/src/components/organisms/work-timeline-item.astro b/src/components/organisms/work-timeline-item.astro index c83b83d..fc02acc 100644 --- a/src/components/organisms/work-timeline-item.astro +++ b/src/components/organisms/work-timeline-item.astro @@ -11,10 +11,9 @@ export interface Props extends astroHTML.JSX.HTMLAttributes { i18n: I18n; } const { job, i18n, ...props } = Astro.props; -const WorkTimelineItem = 'div'; --- - +
- +
diff --git a/src/components/sections/experience-section.astro b/src/components/sections/experience-section.astro index 3b20471..aa7855d 100644 --- a/src/components/sections/experience-section.astro +++ b/src/components/sections/experience-section.astro @@ -1,11 +1,12 @@ --- +import DividedList from '@/atoms/divided-list.astro'; import Divider from '@/atoms/divider.astro'; import SectionCard from '@/atoms/section-card.astro'; -import Typography from '@/atoms/typography.astro'; import WorkTimelineItem from '@/organisms/work-timeline-item.astro'; import type { Section } from '@/types/data'; import type { ExperienceSection, Job } from '@/types/experience-section'; import type { I18n } from '@/types/i18n'; +import removeLast from '@/utils/remove-last'; export interface Props extends ExperienceSection { jobs: Job[]; @@ -21,14 +22,8 @@ const { const section: Section = 'experience'; --- -{title} - { - jobs.map((value, id) => ( - <> - - {id !== jobs.length - 1 && } - - )) - } + + + {removeLast(jobs.flatMap((job) => [, ]))} + diff --git a/src/components/sections/favorites-section.astro b/src/components/sections/favorites-section.astro index 2d8a12f..d718d0d 100644 --- a/src/components/sections/favorites-section.astro +++ b/src/components/sections/favorites-section.astro @@ -66,8 +66,7 @@ const subsections = [booksSubsection, peopleSubsection, videosSubsection, medias const section: Section = 'favorites'; --- - - {title} +
{ subsections.map(({ Component, data, name, columnsLayout, title: subsectionTitle }) => ( diff --git a/src/components/sections/portfolio-section.astro b/src/components/sections/portfolio-section.astro index 07ede21..81e7b9e 100644 --- a/src/components/sections/portfolio-section.astro +++ b/src/components/sections/portfolio-section.astro @@ -1,11 +1,12 @@ --- +import DividedList from '@/atoms/divided-list.astro'; import Divider from '@/atoms/divider.astro'; import SectionCard from '@/atoms/section-card.astro'; -import Typography from '@/atoms/typography.astro'; import ProjectTimelineItem from '@/organisms/project-timeline-item.astro'; import type { Section } from '@/types/data'; import type { I18n } from '@/types/i18n'; import type { PortfolioSection } from '@/types/portfolio-section'; +import removeLast from '@/utils/remove-last'; export interface Props extends PortfolioSection { i18n: I18n; @@ -20,14 +21,8 @@ const { const section: Section = 'portfolio'; --- -{title} - { - projects.map((project, index) => ( - <> - - {index !== projects.length - 1 && } - - )) - } + + + {removeLast(projects.flatMap((project) => [, ]))} + diff --git a/src/components/sections/skills-section.astro b/src/components/sections/skills-section.astro index b5ee281..8f6ca35 100644 --- a/src/components/sections/skills-section.astro +++ b/src/components/sections/skills-section.astro @@ -1,6 +1,5 @@ --- import SectionCard from '@/atoms/section-card.astro'; -import Typography from '@/atoms/typography.astro'; import SkillSubsection from '@/organisms/skill-subsection.astro'; import type { Section } from '@/types/data'; import type { SkillsSection } from '@/types/skills-section'; @@ -15,8 +14,7 @@ const { const section: Section = 'skills'; --- - - {title} +
{skillSets.map((skillSet) => )}
diff --git a/src/components/sections/testimonials-section.astro b/src/components/sections/testimonials-section.astro index 1e1d13d..0529b0a 100644 --- a/src/components/sections/testimonials-section.astro +++ b/src/components/sections/testimonials-section.astro @@ -1,10 +1,11 @@ --- +import DividedList from '@/atoms/divided-list.astro'; import Divider from '@/atoms/divider.astro'; import SectionCard from '@/atoms/section-card.astro'; -import Typography from '@/atoms/typography.astro'; import Testimonial from '@/organisms/testimonial.astro'; import type { Section } from '@/types/data'; import type { TestimonialsSection } from '@/types/testimonials-section'; +import removeLast from '@/utils/remove-last'; export interface Props extends TestimonialsSection {} @@ -16,16 +17,8 @@ const { const section: Section = 'testimonials'; --- - - {title} -
- { - testimonials.map((testimonial, index) => ( - <> - - {index !== testimonials.length - 1 && } - - )) - } -
+ + + {removeLast(testimonials.flatMap((testimonial) => [, ]))} + diff --git a/src/utils/remove-last.ts b/src/utils/remove-last.ts new file mode 100644 index 0000000..da7d670 --- /dev/null +++ b/src/utils/remove-last.ts @@ -0,0 +1,6 @@ +/** + * Get all elements of array except last one. + */ +const removeLast = (arr: T[]): T[] => arr.slice(0, -1); + +export default removeLast;