diff --git a/client/src/components/foundation/CoveredImage/CoveredImage.jsx b/client/src/components/foundation/CoveredImage/CoveredImage.jsx index ffc6fed..c74f9f4 100644 --- a/client/src/components/foundation/CoveredImage/CoveredImage.jsx +++ b/client/src/components/foundation/CoveredImage/CoveredImage.jsx @@ -10,7 +10,7 @@ import React from 'react'; * アスペクト比を維持したまま、要素のコンテンツボックス全体を埋めるように画像を拡大縮小します * @type {React.VFC} */ -const CoveredImage = ({ alt, src, children }) => { +const CoveredImage = ({ alt, src, children, eager }) => { return ( {children} @@ -18,7 +18,7 @@ const CoveredImage = ({ alt, src, children }) => { alt={alt} className="w-full h-full max-w-none object-cover" src={src} - loading="lazy" + loading={eager ? null : 'lazy'} /> ); diff --git a/client/src/components/post/ImageArea/ImageArea.jsx b/client/src/components/post/ImageArea/ImageArea.jsx index 20eda7f..30af41b 100644 --- a/client/src/components/post/ImageArea/ImageArea.jsx +++ b/client/src/components/post/ImageArea/ImageArea.jsx @@ -11,7 +11,7 @@ import { CoveredImage } from '../../foundation/CoveredImage'; */ /** @type {React.VFC} */ -const ImageArea = ({ images }) => { +const ImageArea = ({ images, eager }) => { return (
@@ -30,6 +30,7 @@ const ImageArea = ({ images }) => { = 2)} + eager={eager && idx === 0} > { images.length === 1 diff --git a/client/src/components/post/PostItem/PostItem.jsx b/client/src/components/post/PostItem/PostItem.jsx index 6ecbadc..379872c 100644 --- a/client/src/components/post/PostItem/PostItem.jsx +++ b/client/src/components/post/PostItem/PostItem.jsx @@ -63,7 +63,7 @@ const PostItem = ({ post }) => {

{post?.text ?? ' '}

{post?.images?.length > 0 ? (
- +
) : null} {post?.movie ? ( diff --git a/client/src/components/timeline/Timeline/Timeline.jsx b/client/src/components/timeline/Timeline/Timeline.jsx index 0e5bb67..43bfdcf 100644 --- a/client/src/components/timeline/Timeline/Timeline.jsx +++ b/client/src/components/timeline/Timeline/Timeline.jsx @@ -8,11 +8,11 @@ import { TimelineItem } from '../TimelineItem'; */ /** @type {React.VFC} */ -const Timeline = ({ timeline }) => { +const Timeline = ({ timeline, eager }) => { return (
- {timeline.map((post) => { - return ; + {timeline.map((post, idx) => { + return ; })}
); diff --git a/client/src/components/timeline/TimelineItem/TimelineItem.jsx b/client/src/components/timeline/TimelineItem/TimelineItem.jsx index c56a971..e66dd82 100644 --- a/client/src/components/timeline/TimelineItem/TimelineItem.jsx +++ b/client/src/components/timeline/TimelineItem/TimelineItem.jsx @@ -32,7 +32,7 @@ const isClickedAnchorOrButton = (target, currentTarget) => { */ /** @type {React.VFC} */ -const TimelineItem = ({ post }) => { +const TimelineItem = ({ post, eager }) => { const navigate = useNavigate(); /** @@ -78,7 +78,7 @@ const TimelineItem = ({ post }) => {

{post.text}

{post.images?.length > 0 ? (
- +
) : null} {post.movie ? ( diff --git a/client/src/components/timeline/TimelinePage/TimelinePage.jsx b/client/src/components/timeline/TimelinePage/TimelinePage.jsx index e750aaf..ab65a4f 100644 --- a/client/src/components/timeline/TimelinePage/TimelinePage.jsx +++ b/client/src/components/timeline/TimelinePage/TimelinePage.jsx @@ -9,7 +9,7 @@ import { Timeline } from '../Timeline'; /** @type {React.VFC} */ const TimelinePage = ({ timeline }) => { - return ; + return ; }; export { TimelinePage }; diff --git a/client/src/components/user_profile/UserProfilePage/UserProfilePage.jsx b/client/src/components/user_profile/UserProfilePage/UserProfilePage.jsx index 4020bdf..2c0e33d 100644 --- a/client/src/components/user_profile/UserProfilePage/UserProfilePage.jsx +++ b/client/src/components/user_profile/UserProfilePage/UserProfilePage.jsx @@ -15,7 +15,7 @@ const UserProfilePage = ({ timeline, user }) => { <>
- +
);