From d924408c90e74951990bde98cfee5d83784aa9f0 Mon Sep 17 00:00:00 2001 From: Ferran Date: Wed, 28 Aug 2024 15:37:57 +0200 Subject: [PATCH] style: minor improvements --- src/application/dto/article/articleDTO.ts | 2 +- src/application/dto/author/authorDTO.ts | 2 +- .../dto/breadcrumb/breadcrumbDTO.ts | 2 +- src/application/dto/city/cityDTO.ts | 2 +- src/application/dto/project/projectDTO.ts | 2 +- src/application/dto/tag/tagDTO.ts | 2 +- .../dto/testimonial/testimonialDTO.ts | 2 +- src/application/entities/articles/articles.ts | 2 +- src/application/entities/authors/authors.ts | 2 +- src/application/entities/cities/cities.ts | 2 +- src/application/entities/projects/projects.ts | 2 +- src/application/entities/tags/tags.ts | 2 +- .../entities/testimonials/testimonials.ts | 2 +- src/pages/articles/_article.css | 7 ++++ src/pages/index.astro | 2 +- src/pages/tags/index.astro | 2 +- src/shared/application/dto/baseDTO.ts | 2 +- .../svg-components/leftArrow/LeftArrow.tsx | 5 ++- .../AboutLatestArticles.astro | 2 +- .../components/worldGlobe/WorldGlobe.tsx | 8 ++-- .../articleDetails/ArticleDetails.astro | 4 +- .../featuredArticle/FeaturedArticle.astro | 8 ++-- .../components/contactForm/ContactForm.tsx | 10 ++--- .../contact/components/tabs/Tabs.astro | 4 +- .../components/articleCard/ArticleCard.astro | 4 +- .../articleCardAuthor/ArticleCardAuthor.tsx | 2 +- .../articleCardTagItem/ArticleCardTagItem.tsx | 2 +- .../components/breadcrumbs/Breadcrumbs.astro | 4 +- .../cookieConsent/CookieConsent.tsx | 6 ++- .../components/emailButton/EmailButton.astro | 2 +- .../components/errorLayer/ErrorLayer.astro | 2 +- .../core/components/footer/Footer.astro | 4 +- .../header/atoms/headerLink/HeaderLink.astro | 2 +- .../header/atoms/menuButton/MenuButton.astro | 2 +- .../latestArticles/LatestArticles.astro | 2 +- .../RelatedArticleCard.astro | 4 +- .../core/components/scrollTop/ScrollTop.astro | 2 +- .../modules/core/components/slider/Slider.tsx | 2 +- .../SliderNavigation/SliderNavigation.tsx | 11 +++-- .../SliderNavigation/slider-navigation.css | 6 ++- .../useSliderNavigation.ts | 10 +++-- .../socialNetworks/SocialNetworks.astro | 2 +- .../home/components/myWork/MyWork.astro | 2 +- src/ui/styles/global/global.css | 42 ------------------- src/ui/styles/global/index.css | 1 + src/ui/styles/global/modifiers.css | 34 +++++++++++++++ 46 files changed, 118 insertions(+), 110 deletions(-) create mode 100644 src/ui/styles/global/modifiers.css diff --git a/src/application/dto/article/articleDTO.ts b/src/application/dto/article/articleDTO.ts index db025ddf5..52605c993 100644 --- a/src/application/dto/article/articleDTO.ts +++ b/src/application/dto/article/articleDTO.ts @@ -17,7 +17,7 @@ import { renderOptions } from "./utils/renderOptions"; const PARSER: MarkdownIt = new MarkdownIt(); export const articleDTO: BaseDTO = { - render: (raw) => { + create: (raw) => { return raw.map((rawArticle) => { const description = rawArticle.fields.description ?? diff --git a/src/application/dto/author/authorDTO.ts b/src/application/dto/author/authorDTO.ts index dc8bc8ea8..a51e8c1d4 100644 --- a/src/application/dto/author/authorDTO.ts +++ b/src/application/dto/author/authorDTO.ts @@ -4,7 +4,7 @@ import { createImage } from "@shared/application/dto/utils/createImage"; import { getArticlesByAuthor } from "./utils"; export const authorDTO: BaseDTO> = { - render: async (raw) => { + create: async (raw) => { return Promise.all( raw.map(async (rawAuthor) => { const articlesByAuthor = await getArticlesByAuthor(rawAuthor); diff --git a/src/application/dto/breadcrumb/breadcrumbDTO.ts b/src/application/dto/breadcrumb/breadcrumbDTO.ts index 6815c4126..a1758f4ba 100644 --- a/src/application/dto/breadcrumb/breadcrumbDTO.ts +++ b/src/application/dto/breadcrumb/breadcrumbDTO.ts @@ -5,7 +5,7 @@ import type { BaseDTO } from "@shared/application/dto/baseDTO.ts"; export type BreadcrumbDTO = BreadcrumbDTOItem[]; export const breadcrumbDTO: BaseDTO = { - render: ({ currentPath }): BreadcrumbDTO => { + create: ({ currentPath }): BreadcrumbDTO => { const pathSegments = currentPath.split("/").filter((segment) => segment.trim() !== ""); const breadcrumbs: BreadcrumbDTOItem[] = pathSegments.map((_, index) => { const link = `/${pathSegments.slice(0, index + 1).join("/")}`; diff --git a/src/application/dto/city/cityDTO.ts b/src/application/dto/city/cityDTO.ts index 509e2a91f..7ffe12031 100644 --- a/src/application/dto/city/cityDTO.ts +++ b/src/application/dto/city/cityDTO.ts @@ -5,7 +5,7 @@ import type { ContenfulLocation } from "@shared/application/types"; import { createDate } from "./utils/createDate"; export const cityDTO: BaseDTO = { - render: (raw) => { + create: (raw) => { return raw.map((rawCity) => { const coordinates = { latitude: (rawCity.fields.coordinates as unknown as ContenfulLocation["fields"]["coordinates"]).lat, diff --git a/src/application/dto/project/projectDTO.ts b/src/application/dto/project/projectDTO.ts index 2b83d7f9e..8c6e56e99 100644 --- a/src/application/dto/project/projectDTO.ts +++ b/src/application/dto/project/projectDTO.ts @@ -6,7 +6,7 @@ import type { BaseDTO } from "@shared/application/dto/baseDTO.ts"; import { createImage } from "@shared/application/dto/utils/createImage"; export const projectDTO: BaseDTO = { - render: (raw) => { + create: (raw) => { return raw.map((rawProject) => { const id = rawProject.fields.id ? rawProject.fields.id : slugify(rawProject.fields.name as unknown as string); diff --git a/src/application/dto/tag/tagDTO.ts b/src/application/dto/tag/tagDTO.ts index fd0b9691a..c67be1f34 100644 --- a/src/application/dto/tag/tagDTO.ts +++ b/src/application/dto/tag/tagDTO.ts @@ -6,7 +6,7 @@ import { getArticlesByTag } from "./utils/getArticlesByTag"; import { groupBy } from "./utils/groupBy"; export const tagDTO: BaseDTO> = { - render: async (raw) => { + create: async (raw) => { const articles = await getCollection("articles"); const tags = await Promise.all( diff --git a/src/application/dto/testimonial/testimonialDTO.ts b/src/application/dto/testimonial/testimonialDTO.ts index 0eea064fe..3dfed9917 100644 --- a/src/application/dto/testimonial/testimonialDTO.ts +++ b/src/application/dto/testimonial/testimonialDTO.ts @@ -3,7 +3,7 @@ import type { BaseDTO } from "@shared/application/dto/baseDTO.ts"; import { createImage } from "@shared/application/dto/utils/createImage"; export const testimonialDTO: BaseDTO = { - render: (raw) => { + create: (raw) => { return raw.map((rawTestimonial) => { return { author: rawTestimonial.fields.author, diff --git a/src/application/entities/articles/articles.ts b/src/application/entities/articles/articles.ts index 3ade6dfeb..ebf84f0b4 100644 --- a/src/application/entities/articles/articles.ts +++ b/src/application/entities/articles/articles.ts @@ -10,7 +10,7 @@ export const articles = defineCollection({ content_type: "article", order: ["-fields.publishDate"], }); - const articles = articleDTO.render(rawArticles as unknown as RawArticle[]); + const articles = articleDTO.create(rawArticles as unknown as RawArticle[]); return articles.map((article) => ({ id: article.slug, diff --git a/src/application/entities/authors/authors.ts b/src/application/entities/authors/authors.ts index 036a791ae..daf50fd55 100644 --- a/src/application/entities/authors/authors.ts +++ b/src/application/entities/authors/authors.ts @@ -9,7 +9,7 @@ export const authors = defineCollection({ const { items: rawAuthors } = await client.getEntries({ content_type: "author", }); - const authors = await authorDTO.render(rawAuthors as unknown as RawAuthor[]); + const authors = await authorDTO.create(rawAuthors as unknown as RawAuthor[]); return authors.map((author) => ({ id: author.name, diff --git a/src/application/entities/cities/cities.ts b/src/application/entities/cities/cities.ts index bf0b0e9a4..9b043ca44 100644 --- a/src/application/entities/cities/cities.ts +++ b/src/application/entities/cities/cities.ts @@ -10,7 +10,7 @@ export const cities = defineCollection({ content_type: "city", order: ["fields.startDate"], }); - const cities = cityDTO.render(rawCities as unknown as RawCity[]); + const cities = cityDTO.create(rawCities as unknown as RawCity[]); return cities.map((city) => ({ id: city.name, diff --git a/src/application/entities/projects/projects.ts b/src/application/entities/projects/projects.ts index efe5c1f27..264137342 100644 --- a/src/application/entities/projects/projects.ts +++ b/src/application/entities/projects/projects.ts @@ -10,7 +10,7 @@ export const projects = defineCollection({ content_type: "project", }); - return projectDTO.render(rawProjects as unknown as RawProject[]); + return projectDTO.create(rawProjects as unknown as RawProject[]); }, schema: projectsSchema, }); diff --git a/src/application/entities/tags/tags.ts b/src/application/entities/tags/tags.ts index f290379f0..8da836c6d 100644 --- a/src/application/entities/tags/tags.ts +++ b/src/application/entities/tags/tags.ts @@ -11,7 +11,7 @@ export const tags = defineCollection({ content_type: "tag", }); - const tags = await tagDTO.render(rawTags as unknown as RawTag[]); + const tags = await tagDTO.create(rawTags as unknown as RawTag[]); return Object.keys(tags).map((letter) => ({ id: letter, diff --git a/src/application/entities/testimonials/testimonials.ts b/src/application/entities/testimonials/testimonials.ts index 79b9bd8e9..4a25250ef 100644 --- a/src/application/entities/testimonials/testimonials.ts +++ b/src/application/entities/testimonials/testimonials.ts @@ -9,7 +9,7 @@ export const testimonials = defineCollection({ const { items: rawTestimonials } = await client.getEntries({ content_type: "testimonial", }); - const testimonials = testimonialDTO.render(rawTestimonials as unknown as RawTestimonial[]); + const testimonials = testimonialDTO.create(rawTestimonials as unknown as RawTestimonial[]); return testimonials.map((testimonial) => ({ id: testimonial.author, diff --git a/src/pages/articles/_article.css b/src/pages/articles/_article.css index 14ed71612..bf40d2beb 100644 --- a/src/pages/articles/_article.css +++ b/src/pages/articles/_article.css @@ -5,6 +5,13 @@ line-height: var(--base-line-height); margin: 2rem 0; + @supports (initial-letter: 3 2) { + & > p:first-of-type::first-letter { + initial-letter: 3 2; + padding-right: 0.25rem; + } + } + @media (width <= 960px) { gap: 2rem 0 ; padding-inline: 1rem; diff --git a/src/pages/index.astro b/src/pages/index.astro index e977ca058..36ebe84fa 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -5,7 +5,7 @@ import MyWork from "@modules/home/components/myWork/MyWork.astro"; import Testimonials from "@modules/home/components/testimonials/Testimonials.astro"; import Welcome from "@modules/home/components/welcome/Welcome.astro"; -// todo: review classNames (-wraper or __wrapper, etc) (check grid names as well) +// todo: review classNames (-wraper or __wrapper, etc) --> should be __wrapper // todo: check metadata all pages // todo: add small transitions & animations // - Latest articles (https://codepen.io/jh3y/pen/MWLyGxo) diff --git a/src/pages/tags/index.astro b/src/pages/tags/index.astro index 7cc4ba707..d8cbf32e3 100644 --- a/src/pages/tags/index.astro +++ b/src/pages/tags/index.astro @@ -19,7 +19,7 @@ const tags = await getCollection("tags");
    {tags[index].data.tags.map((tag) => (
  • - {tag.name}(×{tag.count}) + {tag.name}(×{tag.count})