Skip to content

Commit

Permalink
Migrate to next 13 images
Browse files Browse the repository at this point in the history
  • Loading branch information
sr229 committed Apr 18, 2024
1 parent 0c00c9b commit 4b559ee
Show file tree
Hide file tree
Showing 12 changed files with 597 additions and 553 deletions.
43 changes: 6 additions & 37 deletions components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logo from 'public/images/logo.png'
import Image from "next/legacy/image"
import Image from "next/image"

Check failure on line 2 in components/Logo.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Replace `"next/image"` with `'next/image'`
import logoDark from 'public/images/logo-dark.png'

import logosquare from 'public/images/logo-square.png'
Expand All @@ -19,34 +19,15 @@ const Logo = ({
<>
{forceLight ? (
<div className={`${className} flex dark:hidden`}>
<Image
src={logoDark}
priority
width={width}
height={height}
layout="fixed"
alt=""
/>
<Image src={logoDark} priority width={width} height={height} alt="" />
</div>
) : (
<>
<div className={`${className} flex dark:hidden`}>
<Image
src={logo}
width={width}
height={height}
layout="fixed"
alt=""
/>
<Image src={logo} width={width} height={height} alt="" />
</div>
<div className={`${className} hidden dark:flex`}>
<Image
src={logoDark}
width={width}
height={height}
layout="fixed"
alt=""
/>
<Image src={logoDark} width={width} height={height} alt="" />
</div>
</>
)}
Expand All @@ -55,22 +36,10 @@ const Logo = ({
const LogoSquare: React.FC<{ size: number }> = ({ size }) => (
<>
<div className="flex dark:hidden">
<Image
src={logosquare}
width={size}
height={size}
layout="fixed"
alt=""
/>
<Image src={logosquare} width={size} height={size} alt="" />
</div>
<div className="hidden dark:flex">
<Image
src={logosquareDark}
width={size}
height={size}
layout="fixed"
alt=""
/>
<Image src={logosquareDark} width={size} height={size} alt="" />
</div>
</>
)
Expand Down
11 changes: 9 additions & 2 deletions components/MDXComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from 'next/link'
import Image, { ImageProps } from "next/legacy/image"
import Image, { ImageProps } from "next/image"

Check failure on line 2 in components/MDXComponents.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Replace `"next/image"` with `'next/image'`
import { ReactNode } from 'react'

interface Props {
Expand All @@ -19,7 +19,14 @@ const CustomLink = (props: Props) => {
}

const RoundedImage = (props: ImageProps) => {
return <Image {...props} />
return (
<Image

Check warning on line 23 in components/MDXComponents.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images
{...props}
style={{
maxWidth: "100%",

Check failure on line 26 in components/MDXComponents.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Replace `"100%"` with `'100%'`

Check failure on line 26 in components/MDXComponents.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Strings must use backtick
height: "auto"

Check failure on line 27 in components/MDXComponents.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Replace `"auto"` with `'auto',`

Check failure on line 27 in components/MDXComponents.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Strings must use backtick
}} />

Check failure on line 28 in components/MDXComponents.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Insert `⏎···`
);

Check failure on line 29 in components/MDXComponents.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Delete `;`
}

const MDXComponents = {
Expand Down
7 changes: 5 additions & 2 deletions components/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Image, { StaticImageData } from "next/legacy/image"
import Image, { StaticImageData } from "next/image"

Check failure on line 1 in components/Profile.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Replace `"next/image"` with `'next/image'`

const Profile: React.FC<{
size: number
Expand All @@ -11,7 +11,10 @@ const Profile: React.FC<{
width={size}
height={size}
alt=""
/>
style={{
maxWidth: "100%",

Check failure on line 15 in components/Profile.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

Replace `"100%"` with `'100%'`
height: "auto"
}} />
)

export default Profile
9 changes: 6 additions & 3 deletions components/sections/MenuComp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Image from "next/legacy/image"
import Image from "next/image"
import { Parallax } from 'components'
import { motion } from 'framer-motion'
import { useState, useEffect } from 'react'
Expand Down Expand Up @@ -95,11 +95,14 @@ const MenuComp = () => {
width={1400}
height={800}
alt=""
/>
style={{
maxWidth: "100%",
height: "auto"
}} />
</motion.div>
</Parallax>
</div>
)
);
}

export default MenuComp
14 changes: 10 additions & 4 deletions components/sections/Partners.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import partners from 'data/partners'
import { useTranslation } from 'next-i18next'
import Image from "next/legacy/image"
import Image from "next/image"
import Link from 'next/link'

const Partners = () => {
Expand All @@ -26,7 +26,10 @@ const Partners = () => {
alt={partner.name}
width={partner.imgWidth}
height={partner.imgHeight}
/>
style={{
maxWidth: "100%",
height: "auto"
}} />
{partner.darkImg && (
<div
className={`${
Expand All @@ -42,7 +45,10 @@ const Partners = () => {
alt={partner.name}
width={partner.imgWidth}
height={partner.imgHeight}
/>
style={{
maxWidth: "100%",
height: "auto"
}} />
</div>
)}
</div>
Expand All @@ -64,6 +70,6 @@ const Partners = () => {
</Link>
</div>
</div>
)
);
}
export default Partners
144 changes: 74 additions & 70 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { GetStaticProps, NextPage } from 'next'
import Link from 'next/link'

Check warning on line 2 in pages/404.tsx

View workflow job for this annotation

GitHub Actions / Run Type Check & Linters

'Link' is defined but never used
import Image from "next/legacy/image"
import Image from "next/image"
import Blahaj from 'public/images/blahaj.jpg'
import text404 from 'public/images/404text.png'

Expand All @@ -18,82 +18,86 @@ const Custom404: NextPage = () => {
console.log(path)
const inConstruction = [`/features`, `/plugins`].includes(path as string)

return (
<>
<SEO
title={
inConstruction
? `This page is currently being developed.`
: `You hit a dead end.`
}
/>
<Nav />
<div className="container mt-24" id="content">
<div className="z-20 mx-auto text-center ">
{!inConstruction ? (
<>
<div className="animation-flicker mt-4">
<Image
src={text404}
alt="404"
width={207}
height={45}
className="mx-auto"
/>
</div>
return <>
<SEO
title={
inConstruction
? `This page is currently being developed.`
: `You hit a dead end.`
}
/>
<Nav />
<div className="container mt-24" id="content">
<div className="z-20 mx-auto text-center ">
{!inConstruction ? (
<>
<div className="animation-flicker mt-4">
<Image
src={text404}
alt="404"
width={207}
height={45}
className="mx-auto"
style={{
maxWidth: "100%",
height: "auto"
}} />
</div>

<h1 className="text-5xl font-semibold lg:text-6xl">
{t(`dead-end`)}
</h1>
<p className="my-5 mt-4 text-xl ">{t(`guide-back`)}</p>
</>
) : (
<>
<h1 className="mt-8 text-3xl font-semibold lg:text-4xl">
{t(`in-construction`)}
</h1>
<p className="mt-4 text-lg">{t(`check-later`)}</p>
<p className="my-2 mb-4 text-sm lg:text-lg">
{t(`blahaj-while-waiting`)}
</p>
</>
)}
<h1 className="text-5xl font-semibold lg:text-6xl">
{t(`dead-end`)}
</h1>
<p className="my-5 mt-4 text-xl ">{t(`guide-back`)}</p>
</>
) : (
<>
<h1 className="mt-8 text-3xl font-semibold lg:text-4xl">
{t(`in-construction`)}
</h1>
<p className="mt-4 text-lg">{t(`check-later`)}</p>
<p className="my-2 mb-4 text-sm lg:text-lg">
{t(`blahaj-while-waiting`)}
</p>
</>
)}

<Image
src={Blahaj}
alt=""
className=" my-2 mx-auto max-h-[26rem] w-auto rounded-xl border"
/>
<Image
src={Blahaj}
alt=""
className=" my-2 mx-auto max-h-[26rem] w-auto rounded-xl border"
style={{
maxWidth: "100%",
height: "auto"
}} />

<div className="mx-auto mt-8 mb-8 flex flex-wrap justify-center gap-4">
<Button
type="primary"
className="whitespace-nowrap bg-pinkRed"
onClick={() => router.back()}
>
{t(`go-back`)}
</Button>

<Button
type="secondary"
href="https://www.ikea.com/us/en/p/blahaj-soft-toy-shark-90373590/"
className="whitespace-nowrap"
>
<span className="mx-auto">{t(`get-blahaj`)}</span>
</Button>
</div>
<div className="mx-auto mt-8 mb-8 flex flex-wrap justify-center gap-4">
<Button
type="primary"
className="whitespace-nowrap bg-pinkRed"
onClick={() => router.back()}
>
{t(`go-back`)}
</Button>

<a
href="https://twitter.com/niichi021"
className="pt-4 text-sm text-gray-700 dark:text-gray-300"
<Button
type="secondary"
href="https://www.ikea.com/us/en/p/blahaj-soft-toy-shark-90373590/"
className="whitespace-nowrap"
>
{t(`image-sauce`)}
</a>
<span className="mx-auto">{t(`get-blahaj`)}</span>
</Button>
</div>

<a
href="https://twitter.com/niichi021"
className="pt-4 text-sm text-gray-700 dark:text-gray-300"
>
{t(`image-sauce`)}
</a>
</div>
<Footer />
</>
)
</div>
<Footer />
</>;
}

export const getStaticProps: GetStaticProps = async ({ locale }) => {
Expand Down
30 changes: 26 additions & 4 deletions pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable prettier/prettier */
import type { NextPage, GetStaticProps } from 'next'
import Image from "next/legacy/image"
import Image from "next/image"
import Link from 'next/link'
import ReactMarkdown from 'react-markdown'

Expand Down Expand Up @@ -107,7 +107,17 @@ const OpenSource: NextPage<pageProps> = ({
</Fadein>
</div>
<Fadein className="mt-32 text-center ">
<Image src={repoIcon} alt="" quality={100} width={72} height={72} className="inline-block" />
<Image
src={repoIcon}
alt=""
quality={100}
width={72}
height={72}
className="inline-block"
style={{
maxWidth: "100%",
height: "auto"
}} />

<h2 className="mt-8 text-2xl font-bold lg:text-3xl">
{t(`section1-title`)}
Expand All @@ -127,7 +137,10 @@ const OpenSource: NextPage<pageProps> = ({
className="rounded-full"
src={user.profile}
alt=""
/>
style={{
maxWidth: "100%",
height: "auto"
}} />
</div>

</Link>)
Expand All @@ -143,7 +156,16 @@ const OpenSource: NextPage<pageProps> = ({
</p>
</Fadein>
<div className="container mt-12 text-center">
<Image src={donationImage} className="inline-block" width={400} height={400} alt="" />
<Image
src={donationImage}
className="inline-block"
width={400}
height={400}
alt=""
style={{
maxWidth: "100%",
height: "auto"
}} />
<h1 className="text-3xl font-bold"> {t(`section3-title`)}</h1>
<p className="mx-auto mt-2 mb-2 max-w-[34em]">{t(`section3-p`)}</p>
<button
Expand Down
Loading

0 comments on commit 4b559ee

Please sign in to comment.