From 2e358fc609818789c6bd3c692fa4a786ea05daef Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Thu, 9 Feb 2023 20:08:35 +0500 Subject: [PATCH 1/7] card grid component props refactor --- src/components/CardGrid/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/CardGrid/index.tsx b/src/components/CardGrid/index.tsx index 49180ac5..57aca06d 100644 --- a/src/components/CardGrid/index.tsx +++ b/src/components/CardGrid/index.tsx @@ -5,10 +5,10 @@ export type CardGridProps = { style?: React.CSSProperties } -export const CardGrid: React.FC = props => { +export const CardGrid: React.FC = ({ children, style }) => { return ( -
- {props.children} +
+ {children}
) } From abfe2e7d61350455b253f6615a64dcf7f3e3f54d Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Thu, 9 Feb 2023 20:08:52 +0500 Subject: [PATCH 2/7] use image component api from next 13 --- src/components/PageGrid/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/PageGrid/index.tsx b/src/components/PageGrid/index.tsx index 1ac578bd..822d7111 100644 --- a/src/components/PageGrid/index.tsx +++ b/src/components/PageGrid/index.tsx @@ -42,8 +42,10 @@ export const PageGrid: React.FC = props => { href={item.url} cover={( {item.cover.alt Date: Thu, 9 Feb 2023 20:11:54 +0500 Subject: [PATCH 3/7] rm layout from ui/Picture --- src/ui/Picture/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui/Picture/index.tsx b/src/ui/Picture/index.tsx index e466b87a..c91354f5 100644 --- a/src/ui/Picture/index.tsx +++ b/src/ui/Picture/index.tsx @@ -41,7 +41,6 @@ export const Picture: React.FC = memo(({ alt={alt ?? ""} width={width} height={height} - layout={"responsive"} blurDataURL={blur} placeholder={blur ? "blur" : "empty"} /> From 5ef4e38d79c01feb4f4c0d56cb96a26a7557ec39 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Thu, 9 Feb 2023 20:18:09 +0500 Subject: [PATCH 4/7] picture image style: add width/height for responsive --- src/ui/Picture/picture.module.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/Picture/picture.module.css b/src/ui/Picture/picture.module.css index 4fd352a5..69899b7b 100644 --- a/src/ui/Picture/picture.module.css +++ b/src/ui/Picture/picture.module.css @@ -22,6 +22,9 @@ /* override nextjs blurred placeholder filter */ /* need for border radius */ filter: none !important; + + width: 100%; + height: auto; } .pic figcaption { From 45b100ec158d3f3c635f0cf13785d7f19235a11a Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Thu, 9 Feb 2023 20:24:57 +0500 Subject: [PATCH 5/7] move object fit out of image props --- src/components/FIleCard/filecard.module.css | 1 + src/components/FIleCard/index.tsx | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FIleCard/filecard.module.css b/src/components/FIleCard/filecard.module.css index ffd660be..bf38627b 100644 --- a/src/components/FIleCard/filecard.module.css +++ b/src/components/FIleCard/filecard.module.css @@ -10,6 +10,7 @@ .image { box-shadow: var(--shadow); + object-fit: contain; } .info { diff --git a/src/components/FIleCard/index.tsx b/src/components/FIleCard/index.tsx index 9ac55feb..0c736988 100644 --- a/src/components/FIleCard/index.tsx +++ b/src/components/FIleCard/index.tsx @@ -37,7 +37,6 @@ export const FileCard: React.FC = props => { alt={""} width={100} height={100} - objectFit={"contain"} /> From c8ccda94338fa9a6bd00de7e3f54d017a26124b8 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Thu, 9 Feb 2023 20:25:07 +0500 Subject: [PATCH 6/7] rm unused image --- src/components/TagList/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/TagList/index.tsx b/src/components/TagList/index.tsx index 6882cac2..20c14833 100644 --- a/src/components/TagList/index.tsx +++ b/src/components/TagList/index.tsx @@ -3,7 +3,6 @@ import s from "./styles.module.css" import cx from "classnames" import { ITag } from "src/types" import { Button } from "@/ui/Button" -import Image from "next/image" const directionClass = { horizontal: "", From c1d33cf68120a0b8c216eaade4dab874011f2b27 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Thu, 9 Feb 2023 20:28:08 +0500 Subject: [PATCH 7/7] fix typo in FileCard component --- pages/[...slug].tsx | 2 +- src/components/{FIleCard => FileCard}/Signature.tsx | 0 src/components/{FIleCard => FileCard}/filecard.module.css | 0 src/components/{FIleCard => FileCard}/index.tsx | 0 src/components/{FIleCard => FileCard}/signature.module.css | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename src/components/{FIleCard => FileCard}/Signature.tsx (100%) rename src/components/{FIleCard => FileCard}/filecard.module.css (100%) rename src/components/{FIleCard => FileCard}/index.tsx (100%) rename src/components/{FIleCard => FileCard}/signature.module.css (100%) diff --git a/pages/[...slug].tsx b/pages/[...slug].tsx index bd931ec6..4331c2ca 100644 --- a/pages/[...slug].tsx +++ b/pages/[...slug].tsx @@ -10,7 +10,7 @@ import { Youtube } from "@/components/Youtube" import { paramsToSlug } from "@/remote/lib" import { PageGrid } from "@/components/PageGrid" import { useRouter } from "next/router" -import { FileCard } from "@/components/FIleCard" +import { FileCard } from "@/components/FileCard" import { Picture } from "@/ui/Picture" import { tail } from "@/lib/array" import { getMenu, getPageBySlug, getUrls } from "@/remote/api" diff --git a/src/components/FIleCard/Signature.tsx b/src/components/FileCard/Signature.tsx similarity index 100% rename from src/components/FIleCard/Signature.tsx rename to src/components/FileCard/Signature.tsx diff --git a/src/components/FIleCard/filecard.module.css b/src/components/FileCard/filecard.module.css similarity index 100% rename from src/components/FIleCard/filecard.module.css rename to src/components/FileCard/filecard.module.css diff --git a/src/components/FIleCard/index.tsx b/src/components/FileCard/index.tsx similarity index 100% rename from src/components/FIleCard/index.tsx rename to src/components/FileCard/index.tsx diff --git a/src/components/FIleCard/signature.module.css b/src/components/FileCard/signature.module.css similarity index 100% rename from src/components/FIleCard/signature.module.css rename to src/components/FileCard/signature.module.css