Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
KeziahMoselle committed Jul 7, 2023
1 parent 2b59154 commit 605b68e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
11 changes: 3 additions & 8 deletions src/components/Header/CurrentVersion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { fetcher } from "@utils/fetcher";
import classNames from "classnames";
import { formatDistanceToNow } from "date-fns";
import Link from "next/link";
import useSWR from "swr";
import useSWR from "swr/immutable";

export function CurrentRelease({ className }: { className?: string }) {
const {
Expand All @@ -11,16 +11,11 @@ export function CurrentRelease({ className }: { className?: string }) {
isLoading,
} = useSWR(
"https://api.github.com/repos/NieR-Rein-Guide/nierrein.guide/releases?per_page=1?page=1",
fetcher,
{
revalidateOnFocus: false,
revalidateIfStale: false,
revalidateOnReconnect: false,
}
fetcher
);

if (isLoading) {
return <span>Fetching latest release...</span>;
return null;
}

if (error) {
Expand Down
40 changes: 21 additions & 19 deletions src/pages/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,25 +231,27 @@ export function EventItem({
</div>
</div>

<Image
layout="responsive"
src={
attributes.image?.data.attributes.formats?.large?.url ??
attributes.image?.data.attributes.formats?.medium?.url ??
attributes.image?.data.attributes.formats?.small?.url
}
alt={`${attributes.title} thumbnail`}
height={
attributes.image?.data.attributes.formats?.large?.height ??
attributes.image?.data.attributes.formats?.medium?.height ??
attributes.image?.data.attributes.formats?.small?.height
}
width={
attributes.image?.data.attributes.formats?.large?.width ??
attributes.image?.data.attributes.formats?.medium?.width ??
attributes.image?.data.attributes.formats?.small?.width
}
/>
{attributes?.image && (
<Image
layout="responsive"
src={
attributes.image?.data?.attributes?.formats?.large?.url ??
attributes.image?.data?.attributes?.formats?.medium?.url ??
attributes.image?.data?.attributes?.formats?.small?.url
}
alt={`${attributes.title} thumbnail`}
height={
attributes.image?.data?.attributes?.formats?.large?.height ??
attributes.image?.data?.attributes?.formats?.medium?.height ??
attributes.image?.data?.attributes?.formats?.small?.height
}
width={
attributes.image?.data?.attributes?.formats?.large?.width ??
attributes.image?.data?.attributes?.formats?.medium?.width ??
attributes.image?.data?.attributes?.formats?.small?.width
}
/>
)}

<Link
href={`/event/${attributes.slug}`}
Expand Down

0 comments on commit 605b68e

Please sign in to comment.