From 7daddb2f22cd1b60361d24522560cd81af2701ad Mon Sep 17 00:00:00 2001 From: Siro Devs Date: Thu, 12 Mar 2026 10:29:53 +0300 Subject: [PATCH 1/3] added height and weight definations to tags in HomeContent.js --- next-env.d.ts | 1 + src/components/Layout/HomeContent.js | 6 ++++++ yarn.lock | 16 +++++----------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/next-env.d.ts b/next-env.d.ts index 52e831b4..254b73c1 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,5 +1,6 @@ /// /// +/// // NOTE: This file should not be edited // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. diff --git a/src/components/Layout/HomeContent.js b/src/components/Layout/HomeContent.js index 964dd238..26d79f08 100644 --- a/src/components/Layout/HomeContent.js +++ b/src/components/Layout/HomeContent.js @@ -514,6 +514,8 @@ export function HomeContent() { title="logo by @sawaratsuki1004" className="uwu-visible mb-10 lg:mb-8 h-24 lg:h-32" src="/images/uwu.png" + width={313} + height={160} /> @@ -806,6 +808,8 @@ const CommunityImages = memo(function CommunityImages({isLazy}) { loading={isLazy ? 'lazy' : 'eager'} src={src} alt={alt} + width={800} + height={500} className="aspect-[4/3] h-full w-full flex object-cover rounded-2xl bg-gray-10 dark:bg-gray-80" /> @@ -1646,6 +1650,8 @@ function Thumbnail({video}) { className="h-8 w-8 border-2 shadow-md border-gray-70 object-cover rounded-full" src={src} alt="" + width={56} + height={54} /> ))} diff --git a/yarn.lock b/yarn.lock index 1a4de1a4..7566815e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3188,22 +3188,15 @@ emoji-regex@^9.2.2: resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== -<<<<<<< HEAD -encodeurl@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" - integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== -======= emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" - integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== ->>>>>>> 427f24d694674be458f0fe7cb97ab1c8fe736586 +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== enquirer@^2.3.5: version "2.3.6" @@ -3637,6 +3630,7 @@ eslint-plugin-jsx-a11y@^6.4.1: "eslint-plugin-local-rules@link:eslint-local-rules": version "0.0.0" + uid "" eslint-plugin-react-compiler@^19.0.0-beta-e552027-20250112: version "19.0.0-beta-e552027-20250112" From 5af8b24f032f248b3c2a6f8a1236f788ea0949a5 Mon Sep 17 00:00:00 2001 From: Siro Devs Date: Thu, 12 Mar 2026 11:03:05 +0300 Subject: [PATCH 2/3] fixing the images --- src/components/Layout/HomeContent.js | 14 ++++---------- src/content/learn/thinking-in-react.md | 1 + 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/components/Layout/HomeContent.js b/src/components/Layout/HomeContent.js index 26d79f08..f9b785db 100644 --- a/src/components/Layout/HomeContent.js +++ b/src/components/Layout/HomeContent.js @@ -509,13 +509,11 @@ export function HomeContent() {
- logo by @sawaratsuki1004
@@ -804,12 +802,10 @@ const CommunityImages = memo(function CommunityImages({isLazy}) { className={cn( 'overflow-clip relative before:absolute before:inset-0 before:pointer-events-none before:-translate-x-full group-hover:before:animate-[shimmer_1s_forwards] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent transition-transform ease-in-out duration-300' )}> - {alt}
@@ -1568,7 +1564,7 @@ function Cover({background, children}) {
{children}
-
{image.speakers.map((src, i) => ( - ))}
diff --git a/src/content/learn/thinking-in-react.md b/src/content/learn/thinking-in-react.md index ae4ddd9f..2cd9ff90 100644 --- a/src/content/learn/thinking-in-react.md +++ b/src/content/learn/thinking-in-react.md @@ -50,6 +50,7 @@ Kuna vijenzi vitano kwenye skrini hii: + 1. `FilterableProductTable` (kijivu) ina programu nzima. 2. `SearchBar` (bluu) inapokea ingizo la mtumiaji. 3. `ProductTable` (lavender) huonyesha na kuchuja orodha kulingana na ingizo la mtumiaji. From 47175c6cf90f49634d6eb585b2c09292119be669 Mon Sep 17 00:00:00 2001 From: Siro Devs Date: Thu, 12 Mar 2026 11:18:41 +0300 Subject: [PATCH 3/3] finding the source of truth in MDX configs and page components --- src/components/MDX/MDXComponents.tsx | 8 ++-- src/components/PageHeading.tsx | 57 +++++++++++++++++++++++++++- src/sidebarReference.json | 2 +- 3 files changed, 59 insertions(+), 8 deletions(-) diff --git a/src/components/MDX/MDXComponents.tsx b/src/components/MDX/MDXComponents.tsx index aa4dd006..334e72f3 100644 --- a/src/components/MDX/MDXComponents.tsx +++ b/src/components/MDX/MDXComponents.tsx @@ -315,7 +315,7 @@ function Illustration({ return (
- {alt} (
- {info.alt} - ); + return {alt}; } export const MDXComponents = { diff --git a/src/components/PageHeading.tsx b/src/components/PageHeading.tsx index 85f095ff..ba4b413a 100644 --- a/src/components/PageHeading.tsx +++ b/src/components/PageHeading.tsx @@ -14,8 +14,12 @@ import Tag from 'components/Tag'; import {H1} from './MDX/Heading'; import type {RouteTag, RouteItem} from './Layout/getRouteMeta'; import * as React from 'react'; +import {useState, useEffect} from 'react'; +import {useRouter} from 'next/router'; import {IconCanary} from './Icon/IconCanary'; import {IconExperimental} from './Icon/IconExperimental'; +import {IconCopy} from './Icon/IconCopy'; +import {Button} from './Button'; interface PageHeadingProps { title: string; @@ -27,6 +31,51 @@ interface PageHeadingProps { breadcrumbs: RouteItem[]; } +function CopyAsMarkdownButton() { + const {asPath} = useRouter(); + const [copied, setCopied] = useState(false); + + useEffect(() => { + if (!copied) return; + const timer = setTimeout(() => setCopied(false), 2000); + return () => clearTimeout(timer); + }, [copied]); + + async function fetchPageBlob() { + const cleanPath = asPath.split(/[?#]/)[0]; + const res = await fetch(cleanPath + '.md'); + if (!res.ok) throw new Error('Failed to fetch'); + const text = await res.text(); + return new Blob([text], {type: 'text/plain'}); + } + + async function handleCopy() { + try { + await navigator.clipboard.write([ + // Don't wait for the blob, or Safari will refuse clipboard access + new ClipboardItem({'text/plain': fetchPageBlob()}), + ]); + setCopied(true); + } catch { + // Silently fail + } + } + + return ( + + ); +} + function PageHeading({ title, status, @@ -34,11 +83,15 @@ function PageHeading({ tags = [], breadcrumbs, }: PageHeadingProps) { - console.log('version', version); return (
- {breadcrumbs ? : null} +
+
+ {breadcrumbs ? : null} +
+ +

{title} {version === 'canary' && ( diff --git a/src/sidebarReference.json b/src/sidebarReference.json index 8121a735..622fa687 100644 --- a/src/sidebarReference.json +++ b/src/sidebarReference.json @@ -575,4 +575,4 @@ ] } ] -} \ No newline at end of file +}