Merge pull request #140 from tmshv/upd/next-image-updates

next/image updates
This commit is contained in:
tmshv authored and GitHub committed 2023-02-09 20:38:05 +05:00
commit b9f8fcd14e
10 files changed
+12 -9

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ import { Youtube } from "@/components/Youtube"
import { paramsToSlug } from "@/remote/lib" import { paramsToSlug } from "@/remote/lib"
import { PageGrid } from "@/components/PageGrid" import { PageGrid } from "@/components/PageGrid"
import { useRouter } from "next/router" import { useRouter } from "next/router"
import { FileCard } from "@/components/FIleCard" import { FileCard } from "@/components/FileCard"
import { Picture } from "@/ui/Picture" import { Picture } from "@/ui/Picture"
import { tail } from "@/lib/array" import { tail } from "@/lib/array"
import { getMenu, getPageBySlug, getUrls } from "@/remote/api" import { getMenu, getPageBySlug, getUrls } from "@/remote/api"
+3 -3
View File
@@ -5,10 +5,10 @@ export type CardGridProps = {
style?: React.CSSProperties style?: React.CSSProperties
} }
export const CardGrid: React.FC<CardGridProps> = props => { export const CardGrid: React.FC<CardGridProps> = ({ children, style }) => {
return ( return (
<section className={s.grid} style={props.style}> <section className={s.grid} style={style}>
{props.children} {children}
</section> </section>
) )
} }
File renamed without changes.
@@ -10,6 +10,7 @@
.image { .image {
box-shadow: var(--shadow); box-shadow: var(--shadow);
object-fit: contain;
} }
.info { .info {
@@ -37,7 +37,6 @@ export const FileCard: React.FC<FileCardProps> = props => {
alt={""} alt={""}
width={100} width={100}
height={100} height={100}
objectFit={"contain"}
/> />
</div> </div>
</a> </a>
+4 -2
View File
@@ -42,8 +42,10 @@ export const PageGrid: React.FC<PageGridProps> = props => {
href={item.url} href={item.url}
cover={( cover={(
<Image <Image
layout={"fill"} fill
objectFit={"cover"} style={{
objectFit: "cover",
}}
src={item.cover.src} src={item.cover.src}
alt={item.cover.alt ?? ""} alt={item.cover.alt ?? ""}
placeholder={item.cover.blur ? "blur" : "empty"} placeholder={item.cover.blur ? "blur" : "empty"}
-1
View File
@@ -3,7 +3,6 @@ import s from "./styles.module.css"
import cx from "classnames" import cx from "classnames"
import { ITag } from "src/types" import { ITag } from "src/types"
import { Button } from "@/ui/Button" import { Button } from "@/ui/Button"
import Image from "next/image"
const directionClass = { const directionClass = {
horizontal: "", horizontal: "",
-1
View File
@@ -41,7 +41,6 @@ export const Picture: React.FC<PictureProps> = memo(({
alt={alt ?? ""} alt={alt ?? ""}
width={width} width={width}
height={height} height={height}
layout={"responsive"}
blurDataURL={blur} blurDataURL={blur}
placeholder={blur ? "blur" : "empty"} placeholder={blur ? "blur" : "empty"}
/> />
+3
View File
@@ -22,6 +22,9 @@
/* override nextjs blurred placeholder filter */ /* override nextjs blurred placeholder filter */
/* need for border radius */ /* need for border radius */
filter: none !important; filter: none !important;
width: 100%;
height: auto;
} }
.pic figcaption { .pic figcaption {