From b6d89b2d0383762dec2fd572a79fc61dd194c262 Mon Sep 17 00:00:00 2001 From: bobinstein Date: Tue, 14 Jan 2025 10:05:57 -0500 Subject: [PATCH] chore: Overengineered a solution to image width problems on mobile --- src/app/learn/network-composition/page.mdx | 7 ++++-- src/components/Diagram.tsx | 29 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/components/Diagram.tsx diff --git a/src/app/learn/network-composition/page.mdx b/src/app/learn/network-composition/page.mdx index c568a9c9..302948ce 100644 --- a/src/app/learn/network-composition/page.mdx +++ b/src/app/learn/network-composition/page.mdx @@ -1,4 +1,5 @@ import {HeroPattern} from "@/components/HeroPattern" +import Diagram from "@/components/Diagram" @@ -16,8 +17,10 @@ For users and developers, the permaweb offers low-cost, maintenance-free, and pe The AR.IO Network integrates decentralized protocols, services, and applications to power the permanent web alongside the traditional internet. Foundational components like Arweave and AO are independently developed, while AR.IO introduces essential services and incentives that enable seamless interaction and accessibility. - -
Diagram 1: The Permanent Cloud Network
+ + +{/* +
Diagram 1: The Permanent Cloud Network
*/} Major Components of the Permanent Cloud: diff --git a/src/components/Diagram.tsx b/src/components/Diagram.tsx new file mode 100644 index 00000000..e0481956 --- /dev/null +++ b/src/components/Diagram.tsx @@ -0,0 +1,29 @@ +import React from 'react'; + +interface DiagramProps { + src: string; + title?: string; + description?: string; +} + +const Diagram: React.FC = ({ src, title, description }) => { + if (!src) { + console.error('Diagram component requires a valid src string.'); + return null; + } + + return ( +
+ {title + {(title || description) && ( +

+ {title && {title}} + {title && description && ': '} + {description} +

+ )} +
+ ); +}; + +export default Diagram;