Skip to content

Commit

Permalink
chore: Overengineered a solution to image width problems on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobinstein committed Jan 14, 2025
1 parent 4cdfdc5 commit b6d89b2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/learn/network-composition/page.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {HeroPattern} from "@/components/HeroPattern"
import Diagram from "@/components/Diagram"

<HeroPattern />

Expand All @@ -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.

<img src="https://arweave.net/ztJ2iYMIelFOwc4vXv8iYzPAES4bFCf-sdO5ZIc5bKI" />
<div className="caption">Diagram 1: The Permanent Cloud Network</div>
<Diagram src="https://arweave.net/ztJ2iYMIelFOwc4vXv8iYzPAES4bFCf-sdO5ZIc5bKI" title="Diagram 1" description="The Permanent Cloud Network" />

{/* <img src="https://arweave.net/ztJ2iYMIelFOwc4vXv8iYzPAES4bFCf-sdO5ZIc5bKI" />
<div className="caption">Diagram 1: The Permanent Cloud Network</div> */}

Major Components of the Permanent Cloud:

Expand Down
29 changes: 29 additions & 0 deletions src/components/Diagram.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';

interface DiagramProps {
src: string;
title?: string;
description?: string;
}

const Diagram: React.FC<DiagramProps> = ({ src, title, description }) => {
if (!src) {
console.error('Diagram component requires a valid src string.');
return null;
}

return (
<div className="flex flex-col items-center">
<img src={src} alt={title || 'Diagram'} className="max-w-full h-auto" />
{(title || description) && (
<p className="text-center text-sm mt-2">
{title && <strong>{title}</strong>}
{title && description && ': '}
{description}
</p>
)}
</div>
);
};

export default Diagram;

0 comments on commit b6d89b2

Please sign in to comment.