Skip to content

Commit

Permalink
Remove custom loader for now (#112)
Browse files Browse the repository at this point in the history
* Remove custom loader for now

* Mark images as legacy

* Migrate to next 13 images

* Prettier

Signed-off-by: Ayase Minori <[email protected]>

---------

Signed-off-by: Ayase Minori <[email protected]>
  • Loading branch information
sr229 authored Apr 18, 2024
1 parent cd0df11 commit 5dae4d7
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 49 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"eslint.format.enable": true,
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
Expand Down
41 changes: 5 additions & 36 deletions components/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 9 additions & 1 deletion components/MDXComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ const CustomLink = (props: Props) => {
}

const RoundedImage = (props: ImageProps) => {
return <Image {...props} />
return (
<Image
{...props}
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
)
}

const MDXComponents = {
Expand Down
4 changes: 4 additions & 0 deletions components/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const Profile: React.FC<{
width={size}
height={size}
alt=""
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
)

Expand Down
4 changes: 4 additions & 0 deletions components/sections/MenuComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ const MenuComp = () => {
width={1400}
height={800}
alt=""
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</motion.div>
</Parallax>
Expand Down
8 changes: 8 additions & 0 deletions components/sections/Partners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const Partners = () => {
alt={partner.name}
width={partner.imgWidth}
height={partner.imgHeight}
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
{partner.darkImg && (
<div
Expand All @@ -42,6 +46,10 @@ const Partners = () => {
alt={partner.name}
width={partner.imgWidth}
height={partner.imgHeight}
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</div>
)}
Expand Down
10 changes: 8 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ module.exports = withContentlayer()({
reactStrictMode: true,

images: {
loader: process.env.NODE_ENV == 'production' ? 'custom' : 'default',
loaderFile: 'image-loader.js',
domains: [
'avatars.githubusercontent.com',
'fosshost.org',
'owo.whats-th.is',
'images.unsplash.com',
'yuri.might-be-super.fun',
'chito.ge',
],
formats: ['image/avif', 'image/webp'],
},
swcMinify: true,
Expand Down
8 changes: 8 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const Custom404: NextPage = () => {
width={207}
height={45}
className="mx-auto"
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</div>

Expand All @@ -63,6 +67,10 @@ const Custom404: NextPage = () => {
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">
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/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
12 changes: 10 additions & 2 deletions pages/blog/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ const PostLayout: NextPage<{ post: Post }> = ({ post }) => {
className="rounded-md object-cover object-center "
alt=""
priority
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</a>

Expand All @@ -73,6 +77,10 @@ const PostLayout: NextPage<{ post: Post }> = ({ post }) => {
height={40}
alt=""
className="rounded-full"
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
<div className="pl-3">
<span className="font-semibold">{post.author}</span>
Expand Down Expand Up @@ -120,8 +128,8 @@ const PostLayout: NextPage<{ post: Post }> = ({ post }) => {
</Link>
</div>
{/* <div className="relative left-0 h-80 w-80 lg:top-24 2xl:absolute">
<Image src={circles} layout="fill" priority alt="" />
</div> */}
<Image src={circles} layout="fill" priority alt="" />
</div> */}
<Footer />
</>
)
Expand Down
8 changes: 8 additions & 0 deletions pages/blog/category/[category].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ function PostCard(post: Post) {
quality={100}
className="rounded-md object-cover object-center transition duration-300 hover:scale-105"
alt=""
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</Link>
<div className="w-full py-4 ">
Expand All @@ -87,6 +91,10 @@ function PostCard(post: Post) {
height={40}
alt=""
className="rounded-full"
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</Link>
<div className="pl-2 text-sm">
Expand Down
16 changes: 16 additions & 0 deletions pages/blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function PostCard(post: Post) {
quality={100}
className="rounded-md object-cover object-center transition duration-300 hover:scale-105"
alt=""
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</Link>
<div className="w-full py-4 ">
Expand All @@ -67,6 +71,10 @@ function PostCard(post: Post) {
height={40}
alt=""
className="rounded-full"
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</Link>
<div className="pl-2 text-sm">
Expand Down Expand Up @@ -157,6 +165,10 @@ const Blog: NextPage<{ posts: Post[] }> = ({ posts }) => {
className="rounded-md object-cover object-center transition duration-300 hover:scale-105"
alt=""
priority
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</Link>
<div className="py-4 md:px-8 md:py-8 lg:w-[32rem]">
Expand Down Expand Up @@ -194,6 +206,10 @@ const Blog: NextPage<{ posts: Post[] }> = ({ posts }) => {
height={40}
alt=""
className="rounded-full"
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</Link>
<div className="pl-2 text-sm">
Expand Down
11 changes: 10 additions & 1 deletion pages/contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,16 @@ const Home: NextPage<cache> = () => {
<div className="flex h-96 w-[16rem] flex-col justify-between rounded-2xl border p-8 px-10 text-center shadow dark:border-neutral-700">
<div>
<div className="item-center mx-auto flex h-24 w-24 items-center justify-center rounded-full border bg-pinkRed dark:border-none dark:border-neutral-700">
<Image src={envelope} width={48} height={48} alt="" />
<Image
src={envelope}
width={48}
height={48}
alt=""
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</div>
<h3 className=" mt-4 text-xl font-bold">{t(`anything-else`)}</h3>
<p className="mx-auto mt-2 max-w-[18rem] text-center text-sm">
Expand Down
12 changes: 10 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ const Home: NextPage<cache> = ({ contributors }) => {
width={1280}
height={720}
quality={90}
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</div>
</div>
Expand All @@ -124,8 +128,8 @@ const Home: NextPage<cache> = ({ contributors }) => {
{t(`extensions-in-development`)}
</p>
{/* <Link href="/extensions" passHref>
<a className="button"> {t(`explore-extensions-button`)}</a>
</Link> */}
<a className="button"> {t(`explore-extensions-button`)}</a>
</Link> */}
</div>
<div className=" mt-8" title="Coming soon....">
<Marquee speed={50} gradientWidth={0}>
Expand Down Expand Up @@ -163,6 +167,10 @@ const Home: NextPage<cache> = ({ contributors }) => {
height={64}
className="rounded-full"
alt=""
style={{
maxWidth: `100%`,
height: `auto`,
}}
/>
</div>
))}
Expand Down

0 comments on commit 5dae4d7

Please sign in to comment.