diff --git a/components/Card.tsx b/components/Card.tsx index 5900682d3..9d0477ced 100644 --- a/components/Card.tsx +++ b/components/Card.tsx @@ -1,6 +1,7 @@ import React from 'react'; import Link from 'next/link'; import TextTruncate from 'react-text-truncate'; +import Image from 'next/image'; export interface CardProps { title: string; body: string; @@ -36,8 +37,11 @@ const CardBody = ({
{image && ( - {title} @@ -46,9 +50,11 @@ const CardBody = ({
{icon && ( - {title} diff --git a/components/DarkModeToggle.tsx b/components/DarkModeToggle.tsx index 798a92646..cadf3b7ac 100644 --- a/components/DarkModeToggle.tsx +++ b/components/DarkModeToggle.tsx @@ -1,6 +1,7 @@ import { useTheme } from 'next-themes'; import { useEffect, useState } from 'react'; import React from 'react'; +import Image from 'next/image'; function ListItem({ children, @@ -52,7 +53,7 @@ export default function DarkModeToggle() { className='dark-mode-toggle rounded-md dark:hover:bg-gray-700 p-1.5 hover:bg-gray-100 transition duration-150 ' data-test='dark-mode-toggle' > - Dark Mode setTheme('system')} data-test='select-system-theme' > - System theme setTheme('light')} data-test='select-light-theme' > - System theme setTheme('dark')} data-test='select-dark-theme' > - System theme {

{details[0]}

{details[1] ? ( - green tick + green tick ) : ( - red cross + red cross )}
diff --git a/components/JsonEditor.tsx b/components/JsonEditor.tsx index b16289f18..af506734a 100644 --- a/components/JsonEditor.tsx +++ b/components/JsonEditor.tsx @@ -6,6 +6,7 @@ import getPartsOfJson, { SyntaxPart } from '~/lib/getPartsOfJson'; import jsonSchemaReferences from './jsonSchemaLinks'; import { useRouter } from 'next/router'; import { FullMarkdownContext } from '~/context'; +import Image from 'next/image'; import getScopesOfParsedJsonSchema, { JsonSchemaPathWithScope, JsonSchemaScope, @@ -294,16 +295,22 @@ export default function JsonEditor({ initialCode }: { initialCode: string }) { }} data-test='copy-clipboard-button' > - Copy icon - + Copied icon + />
{isJsonSchema ? ( <> - schema +  logo-white{' '} + schema ) : ( <>data @@ -451,7 +465,13 @@ export default function JsonEditor({ initialCode }: { initialCode: string }) { className='text-white px-4 py-3 font-sans flex flex-row justify-end items-center bg-red-500/30 text-sm' data-test='not-compliant-to-schema' > - + Error icon not compliant to schema
)} @@ -460,7 +480,13 @@ export default function JsonEditor({ initialCode }: { initialCode: string }) { className='text-white px-4 py-3 font-sans flex flex-row justify-end items-center bg-slate-500/30 text-sm' data-test='compliant-to-schema' > - + Checkmark icon compliant to schema )} diff --git a/components/Layout.tsx b/components/Layout.tsx index a43fc53ac..441b83188 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -10,6 +10,7 @@ import { useTheme } from 'next-themes'; import DarkModeToggle from './DarkModeToggle'; import extractPathWithoutFragment from '~/lib/extractPathWithoutFragment'; import ScrollButton from './ScrollButton'; +import Image from 'next/image'; type Props = { children: React.ReactNode; @@ -327,7 +328,13 @@ const Footer = () => ( >
- + logo-white
( href='https://json-schema.org/slack' className='flex items-center text-white' > - Slack logo Slack @@ -360,7 +370,14 @@ const Footer = () => ( href='https://x.com/jsonschema' className='flex items-center text-white' > - X + X logo{' '} + X
@@ -368,9 +385,12 @@ const Footer = () => ( href='https://linkedin.com/company/jsonschema/' className='flex items-center text-white' > - LinkedIn logo LinkedIn @@ -380,7 +400,13 @@ const Footer = () => ( href='https://www.youtube.com/@JSONSchemaOrgOfficial' className='flex items-center text-white' > - + YouTube logo Youtube
@@ -389,9 +415,12 @@ const Footer = () => ( href='https://github.com/json-schema-org' className='flex items-center text-white' > - GitHub logo GitHub @@ -422,7 +451,13 @@ const Logo = () => { return (
- + Dynamic image
); diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 3dc4815b6..baa20be2d 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -9,7 +9,7 @@ import extractPathWithoutFragment from '~/lib/extractPathWithoutFragment'; import CarbonAds from './CarbonsAds'; import { useTheme } from 'next-themes'; import ExternalLinkIcon from '../public/icons/external-link-black.svg'; - +import Image from 'next/image'; const DocLink = ({ uri, label, @@ -329,7 +329,13 @@ export const DocsNav = ({ onClick={handleClickDoc} >
- eye icon + eye icon
- compass icon + compass icon
- book icon + book icon
- clipboard icon + clipboard icon
{ component: ({ label }) => { return (
- + star {label}
); @@ -398,7 +404,13 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => { component: ({ label }) => { return (
- + info yellow {label}
); @@ -414,10 +426,12 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => {
)}
-
{children}
@@ -435,10 +449,12 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => {
)}
-
{children}
@@ -456,10 +472,12 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => { )}
-
{children}
@@ -477,10 +495,12 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => { )}
-
{children}
diff --git a/pages/blog/index.page.tsx b/pages/blog/index.page.tsx index 67aaf5e74..b99ac68d2 100644 --- a/pages/blog/index.page.tsx +++ b/pages/blog/index.page.tsx @@ -11,6 +11,7 @@ import generateRssFeed from './generateRssFeed'; import { useRouter } from 'next/router'; import useSetUrlParam from '~/lib/useSetUrlParam'; import { SectionContext } from '~/context'; +import Image from 'next/image'; type Author = { name: string; @@ -145,8 +146,10 @@ export default function StaticMarkdownPage({ {recentBlog[0] && (
- hero image example @@ -210,7 +213,13 @@ export default function StaticMarkdownPage({ href='/rss/feed.xml' className='flex items-center text-blue-500 hover:text-blue-600 cursor-pointer' > - + rss RSS Feed
diff --git a/pages/blog/posts/[slug].page.tsx b/pages/blog/posts/[slug].page.tsx index 5f9615ffd..14301176d 100644 --- a/pages/blog/posts/[slug].page.tsx +++ b/pages/blog/posts/[slug].page.tsx @@ -12,6 +12,7 @@ import readingTime from 'reading-time'; import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import CarbonAds from '~/components/CarbonsAds'; +import Image from 'next/image'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/blog/posts'); @@ -60,7 +61,13 @@ export default function StaticMarkdownPage({ href='/blog' className='font-semibold text-sm pb-0 lg:pb-5 text-slate-700 dark:text-slate-300 dark:hover:text-slate-100 hover:text-slate-800 inline-flex flex-row items-center' > - {' '} + Left arrow icon Go back to blog
diff --git a/pages/community/index.page.tsx b/pages/community/index.page.tsx index 11692b016..852404a48 100644 --- a/pages/community/index.page.tsx +++ b/pages/community/index.page.tsx @@ -287,9 +287,12 @@ export default function communityPages(props: any) {
- {blogPosts[0].frontmatter.title}

{blogPosts[0].frontmatter.title} diff --git a/pages/index.page.tsx b/pages/index.page.tsx index 2d6beb0fb..a653b28c6 100644 --- a/pages/index.page.tsx +++ b/pages/index.page.tsx @@ -7,6 +7,7 @@ const PATH = 'pages/blog/posts'; import readingTime from 'reading-time'; import Link from 'next/link'; import TextTruncate from 'react-text-truncate'; +import Image from 'next/image'; import { fetchRemoteICalFile, printEventsForNextWeeks, @@ -106,11 +107,16 @@ const Home = (props: any) => { const [common_room_logo, setCommon_room_logo] = useState(''); const [slack_logo, setSlack_logo] = useState(''); const [ccopter_logo, setCCopter_logo] = useState(''); + const [isClient, setIsClient] = useState(false); const [octue_logo, setOctue_logo] = useState(''); const [apideck_logo, setApideck_logo] = useState(''); const [rxdb_logo, setRxdb_logo] = useState(''); const [wda_logo, setWDA_logo] = useState(''); + useEffect(() => { + // Ensure the component is only rendered client-side + setIsClient(true); + }, []); useEffect(() => { if (resolvedTheme === 'dark') { setAsyncapi_logo('/img/logos/dark-mode/asyncapi_white.svg'); @@ -183,22 +189,38 @@ const Home = (props: any) => {

Used by

- - - - + {isClient && ( + <> + zapier + microsoft + postman + github + + )}

@@ -287,10 +309,17 @@ const Home = (props: any) => { {/* SidebySide section*/}

- + {isClient && ( + <> + community + + )}

Explore the JSON Schema Ecosystem @@ -329,12 +358,30 @@ const Home = (props: any) => {

Join the JSON Schema Slack Workspace! - + {isClient && ( + <> + slack + + )}

- + {isClient && ( + <> + slack-json-schema + + )} + {/*

Event

*/}

Join our Slack to ask questions, get feedback on your @@ -346,10 +393,17 @@ const Home = (props: any) => { href='https://json-schema.org/slack' className='flex items-center ' > - + {isClient && ( + <> + slack + + )} Join Slack @@ -360,10 +414,17 @@ const Home = (props: any) => {

The JSON Schema Blog

- + {isClient && ( + <> + blog + + )}

{' '} {blogPosts[0].frontmatter.title} @@ -604,54 +665,154 @@ const Home = (props: any) => { target='_blank' rel='noreferrer' > - + {isClient && ( + <> + asyncapi + + )} - + {isClient && ( + <> + airbnb + + )} - + {isClient && ( + <> + postman + + )} - + {isClient && ( + <> + endjin + + )} - + {isClient && ( + <> + llc + + )} - + {isClient && ( + <> + vpsserver + + )} - + {isClient && ( + <> + itflashcards + + )} - + {isClient && ( + <> + route4me + + )} - + {isClient && ( + <> + n8n + + )} - + {isClient && ( + <> + ccopter + + )} @@ -734,10 +895,30 @@ for Accounting integrations'

{' '}
diff --git a/pages/tools/components/ToolingDetailModal.tsx b/pages/tools/components/ToolingDetailModal.tsx index 0b735f440..5f39a6fc5 100644 --- a/pages/tools/components/ToolingDetailModal.tsx +++ b/pages/tools/components/ToolingDetailModal.tsx @@ -6,6 +6,7 @@ import Badge from './ui/Badge'; import type { JSONSchemaTool } from '../JSONSchemaTool'; import toTitleCase from '../lib/toTitleCase'; import Link from 'next/link'; +import Image from 'next/image'; import Tag from './ui/Tag'; export default function ToolingDetailModal({ @@ -43,9 +44,12 @@ export default function ToolingDetailModal({
{tool.landscape?.logo && (
- landscape logos
)} @@ -341,13 +345,15 @@ const BowtieReportBadge = ({ uri }: { uri: string }) => { {loading && !error && (
)} - setLoading(false)} onError={() => { setLoading(false); setError(true); }} + width={100} + height={20} style={{ display: loading ? 'none' : 'block' }} alt='Bowtie Badge' className='my-1' diff --git a/pages/tools/index.page.tsx b/pages/tools/index.page.tsx index aa41bdedf..fd75e68d7 100644 --- a/pages/tools/index.page.tsx +++ b/pages/tools/index.page.tsx @@ -16,6 +16,7 @@ import ToolingTable from './components/ToolingTable'; import useToolsTransform from './hooks/useToolsTransform'; import getDistinctEntries from './lib/getDistinctEntries'; import type { JSONSchemaTool } from './JSONSchemaTool'; +import Image from 'next/image'; export type FilterCriteriaFields = | 'languages' @@ -181,9 +182,12 @@ export default function ToolingPage({ target='_blank' rel='noreferrer' > - adding your tool

@@ -199,9 +203,12 @@ export default function ToolingPage({ target='_blank' rel='noreferrer' > - try bowtie