Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: use next/image

Isaiah Hamiltonffc5f48544e6
diff --git a/www/components/Blog/BlogListItem.tsx b/www/components/Blog/BlogListItem.tsx
index e7790bcded6..0ea2ddace28 100644
--- a/www/components/Blog/BlogListItem.tsx
+++ b/www/components/Blog/BlogListItem.tsx
@@ -56,11 +56,14 @@ const BlogListItem = ({ post }: Props) => {
<div className="flex items-center -space-x-2">
{author.map((author: any) => {
return (
- <div>
+ <div className="w-10 rounded-full ring-2 ring-white dark:ring-scale-200">
{author.author_image_url && (
- <img
+ <Image
src={author.author_image_url}
- className="w-10 rounded-full ring-2 ring-white dark:ring-scale-200"
+ className="rounded-full border dark:border-dark"
+ width="100%"
+ height="100%"
+ layout="responsive"
/>
)}
</div>
diff --git a/www/components/Footer/index.tsx b/www/components/Footer/index.tsx
index 3bb8cc544b6..aa6cda77fe0 100644
--- a/www/components/Footer/index.tsx
+++ b/www/components/Footer/index.tsx
@@ -5,6 +5,7 @@ import DarkModeToggle from '../DarkModeToggle'
import Link from 'next/link'
import { useTheme } from '../Providers'
import { Badge } from '@supabase/ui'
+import Image from 'next/image'
const Footer = () => {
const { basePath } = useRouter()
@@ -22,14 +23,15 @@ const Footer = () => {
<div className="xl:grid xl:grid-cols-3 xl:gap-8">
<div className="space-y-8 xl:col-span-1">
<Link href="#" as="/">
- <a>
- <img
- className="w-40"
+ <a className="w-40">
+ <Image
src={
isDarkMode
? `${basePath}/brand-assets/supabase-logo-wordmark--dark.svg`
: `${basePath}/brand-assets/supabase-logo-wordmark--light.svg`
}
+ width={160}
+ height={30}
alt="Supabase"
/>
</a>
diff --git a/www/components/Nav/Developers.tsx b/www/components/Nav/Developers.tsx
index 7b8f87cf73f..379ee1ed08b 100644
--- a/www/components/Nav/Developers.tsx
+++ b/www/components/Nav/Developers.tsx
@@ -2,6 +2,7 @@ import React from 'react'
import DevelopersData from 'data/Developers.json'
import AnnouncementsData from 'data/Announcements.json'
import { useRouter } from 'next/router'
+import Image from 'next/image'
type Props = {
text: string
@@ -68,11 +69,12 @@ const Developers = () => {
href={caseStudy.url}
className="p-3 flex rounded-lg hover:bg-gray-100 dark:hover:bg-dark-700 transition ease-in-out duration-150 border items-center"
>
- <div className="hidden sm:block flex-shrink-0">
- <img
- className="w-32 h-20 object-cover rounded-md"
+ <div className="hidden sm:block flex-shrink-0 relative overflow-auto w-32 h-20 rounded-md">
+ <Image
src={`${basePath}/${caseStudy.imgUrl}`}
alt="caseStudyThumb"
+ layout="fill"
+ objectFit="cover"
/>
</div>
<div className="min-w-0 flex-1 sm:ml-4">
diff --git a/www/components/Nav/Product.tsx b/www/components/Nav/Product.tsx
index 10abb5aabce..9ac3e291f9a 100644
--- a/www/components/Nav/Product.tsx
+++ b/www/components/Nav/Product.tsx
@@ -4,6 +4,7 @@ import CaseStudiesData from 'data/CaseStudies.json'
import { useRouter } from 'next/router'
import ProductIcon from '../ProductIcon'
import { Badge } from '@supabase/ui'
+import Image from 'next/image'
const Product = () => {
const { basePath } = useRouter()
@@ -59,11 +60,12 @@ const Product = () => {
href={caseStudy.url}
className="p-3 flex rounded-lg hover:bg-gray-100 dark:hover:bg-dark-700 transition ease-in-out duration-150 border items-center"
>
- <div className="hidden sm:block flex-shrink-0">
- <img
- className="w-32 h-20 object-cover rounded-md"
+ <div className="hidden sm:block flex-shrink-0 relative overflow-auto w-32 h-20 rounded-md">
+ <Image
src={`${basePath}/${caseStudy.imgUrl}`}
alt="caseStudyThumb"
+ layout="fill"
+ objectFit="cover"
/>
</div>
<div className="min-w-0 flex-1 sm:ml-4">
diff --git a/www/components/Nav/index.tsx b/www/components/Nav/index.tsx
index ed2669215d0..fcc0a223029 100644
--- a/www/components/Nav/index.tsx
+++ b/www/components/Nav/index.tsx
@@ -14,6 +14,7 @@ import Announcement from '~/components/Nav/Announcement'
import { useTheme } from '~/components/Providers'
import TextLink from '../TextLink'
+import Image from 'next/image'
const Nav = () => {
const { basePath } = useRouter()
@@ -192,14 +193,15 @@ const Nav = () => {
<div className="flex items-center">
<div className="flex-shrink-0 flex items-center">
<Link href="/" as="/">
- <a>
- <img
- className="block h-6 w-auto"
+ <a className="block h-6 w-auto">
+ <Image
src={
isDarkMode
? `${basePath}/brand-assets/supabase-logo-wordmark--dark.svg`
: `${basePath}/brand-assets/supabase-logo-wordmark--light.svg`
}
+ width={124}
+ height={24}
alt="Logo"
/>
</a>
diff --git a/www/next.config.js b/www/next.config.js
index 291212b011d..2849d87d27d 100644
--- a/www/next.config.js
+++ b/www/next.config.js
@@ -7,6 +7,7 @@ module.exports = withMDX({
trailingSlash: false,
images: {
domains: [
+ 'avatars.githubusercontent.com',
'github.com',
'ca.slack-edge.com',
'res.cloudinary.com',
diff --git a/www/pages/404.tsx b/www/pages/404.tsx
index 64971430cd2..297c45c05cd 100644
--- a/www/pages/404.tsx
+++ b/www/pages/404.tsx
@@ -31,7 +31,7 @@ const Error404 = () => {
? '/images/supabase-logo-wordmark--dark.svg'
: '/images/supabase-logo-wordmark--light.svg'
}
- alt=""
+ alt="supabase logo"
height={24}
width={120}
/>
diff --git a/www/pages/auth/Auth.tsx b/www/pages/auth/Auth.tsx
index eda48cfc38e..52b4c0c5d5f 100644
--- a/www/pages/auth/Auth.tsx
+++ b/www/pages/auth/Auth.tsx
@@ -101,12 +101,13 @@ function AuthPage() {
<div className="grid grid-cols-12">
<div className="mb-10 lg:mb-0 col-span-12 lg:col-span-3">
<p className="mb-4">
- <div className="flex items-center flex-wrap xl:w-64">
- <div className="mb-2 mr-2">
+ <div className="grid grid-rows-2 grid-flow-col gap-2 xl:w-64">
+ <div className="w-fit flex items-center">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 32.58 31.77"
width={21}
+ height={21}
className="text-gray-800 dark:text-white"
>
<path
@@ -117,13 +118,15 @@ function AuthPage() {
</div>
{AuthProviders.map((auth) => {
return (
- <img
- className="mb-2 mr-2"
- src={`${basePath}/images/product/auth/${auth.name}-icon.svg`}
- width={21}
- alt={`${auth.name} auth login icon`}
- key={auth.name}
- />
+ <div className="w-fit flex items-center">
+ <Image
+ src={`${basePath}/images/product/auth/${auth.name}-icon.svg`}
+ alt={`${auth.name} auth login icon`}
+ key={auth.name}
+ height={21}
+ width={21}
+ />
+ </div>
)
})}
</div>
diff --git a/www/pages/beta.tsx b/www/pages/beta.tsx
index 526fe46e700..19c5db738cd 100644
--- a/www/pages/beta.tsx
+++ b/www/pages/beta.tsx
@@ -8,6 +8,7 @@ import { APP_NAME, DESCRIPTION } from 'lib/constants'
import { NextSeo } from 'next-seo'
import Head from 'next/head'
import Link from 'next/link'
+import Image from 'next/image'
import { useRouter } from 'next/router'
import { useEffect, useRef, useState } from 'react'
import Layout from '~/components/Layouts/Default'
@@ -1002,7 +1003,7 @@ const Beta = (props: Props) => {
<div className="flex items-center justify-between px-5 py-5 shadow-lg xl:px-20 bg-scale-1200 dark:bg-scale-300">
<Link href="/">
<a>
- <img className="h-5" src={`${basePath}/images/logo-dark.png`} />
+ <Image src={`${basePath}/images/logo-dark.png`} height={20} width={20} />
</a>
</Link>
<HamburgerMenu openMenu={() => setMenuOpen(!menuOpen)} />
diff --git a/www/pages/brand-assets.tsx b/www/pages/brand-assets.tsx
index 6bd7ecdae99..8b7307d3fe2 100644
--- a/www/pages/brand-assets.tsx
+++ b/www/pages/brand-assets.tsx
@@ -8,6 +8,7 @@ import { useRouter } from 'next/router'
import SectionContainer from '~/components/Layouts/SectionContainer'
import { NextSeo } from 'next-seo'
+import Image from 'next/image'
const Index = () => {
// base path for images
@@ -46,11 +47,11 @@ const Index = () => {
</SectionContainer>
<SectionContainer>
<div className="grid grid-cols-12 border dark:border-gray-600 rounded-lg shadow-small">
- <div className="col-span-12 lg:col-span-5">
- <img
+ <div className="col-span-12 lg:col-span-5 relative overflow-auto w-full h-60 rounded-lg">
+ <Image
src={`/brand-assets/logo-preview.jpg`}
- width="100%"
- className="object-cover h-full rounded-l-lg"
+ layout="fill"
+ objectFit="cover"
/>
</div>
<div className="col-span-12 lg:col-span-7 flex items-center">
diff --git a/www/pages/database/Database.tsx b/www/pages/database/Database.tsx
index 384ef4fdb3e..34dcc656675 100644
--- a/www/pages/database/Database.tsx
+++ b/www/pages/database/Database.tsx
@@ -104,7 +104,9 @@ function Database() {
<div className="mb-4 flex items-center space-x-2">
<ProductIcon icon={Solutions['database'].icon} />
<IconX />
- <img src={`${basePath}/images/product/database/postgresql-icon.svg`} width={30} />
+ <div className="w-fit flex items-center">
+ <Image src={`${basePath}/images/product/database/postgresql-icon.svg`} width={30} height={30} />
+ </div>
</div>
<h4 className="h4">Just Postgres</h4>
<p className="p">Every Supabase project is a dedicated Postgres database.</p>