Skip to content

Commit

Permalink
Merge branch 'main' into yuri/add-tangle-dapp-pool-creation-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yurixander committed Oct 16, 2024
2 parents d503dc7 + a92af4b commit f2a019f
Show file tree
Hide file tree
Showing 150 changed files with 2,735 additions and 544 deletions.
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
fi
dotenv_if_exists
layout node
use flake
watch_file flake.nix
# vi: ft=sh
11 changes: 0 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ _Provide a detailed description of proposed changes._

-

### Proposed area of change

_Put an `x` in the boxes that apply._

- [ ] `Overview`
- [ ] `Anchor System`
- [ ] `dApps`
- [ ] `Tangle`
- [ ] `Protocols`
- [ ] `Relayers`

### Reference issue to close (if applicable)

_Specify any issues that can be closed from these changes (e.g. Closes #233)._
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ out/*
out
.dccache
*.code-workspace
.direnv
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<a href="https://www.tangle.tools/">
<img src="https://github.com/webb-tools/tangle-docs/assets/38070512/12b7b949-89be-4c9d-9be1-2115d2ea15a2" alt="image" />
<img src="https://github.com/tangle-network/tangle-docs/assets/38070512/12b7b949-89be-4c9d-9be1-2115d2ea15a2" alt="image" />
</a>
</div>

Expand Down Expand Up @@ -52,7 +52,7 @@ navigation.

```bash
# create a new folder to get going
git clone https://github.com/webb-tools/tangle-docs.git
git clone https://github.com/tangle-network/tangle-docs.git
```

2. **Install dependencies**
Expand Down
50 changes: 50 additions & 0 deletions components/BlueprintIntroCards.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from "react";
import { GrNodes } from "react-icons/gr";
import { BetweenVerticalEnd } from "lucide-react";
import Link from "next/link";

const BlueprintIntroCards = () => {
const cards = [
{
icon: <BetweenVerticalEnd className="text-blue-500" size={24} />,
title: "Tangle's Gadget SDK Repo",
description:
"Check out our Gadget SDK repository to get started building your own gadgets.",
link: "https://github.com/tangle-network/gadget",
},
{
icon: <BetweenVerticalEnd className="text-blue-500" size={24} />,
title: "Hello World Blueprint",
description:
"Get started with a simple Hello World example using Tangle Blueprints.",
link: "../developers/getting-started",
},
{
icon: <GrNodes className="text-blue-500" size={24} />,
title: "Build an Eigenlayer AVS",
description:
"Build an Eigenlayer AVS with the Tangle Blueprint SDK and hook into a variety of EVM compatible utilities for task automation, slashing, and more.",
link: "../developers/eigenlayer-avs",
},
];

return (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 my-12">
{cards.map((card, index) => (
<Link href={card.link} key={index} className="block">
<div className="border border-black dark:border-white p-4 h-full flex flex-col transition-colors duration-300 hover:bg-purple-100 dark:hover:bg-purple-900">
<div className="flex-shrink-0 mb-2">{card.icon}</div>
<h3 className="text-xl font-bold mb-4 text-black dark:text-white">
{card.title}
</h3>
<p className="text-sm flex-grow text-black dark:text-white">
{card.description}
</p>
</div>
</Link>
))}
</div>
);
};

export default BlueprintIntroCards;
2 changes: 1 addition & 1 deletion components/CommonActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const features = [
Icon: FaGithub,
title: "Tangle Open Source",
description: `Multy-party threshold ECDSA (GG20) Substrate node`,
href: "https://github.com/webb-tools/tangle",
href: "https://github.com/tangle-network/tangle",
action: "View the Repo",
},
{
Expand Down
1 change: 0 additions & 1 deletion components/DiscordBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import DiscordButton from "./DiscordButton";
import { ThemeSwitch } from "nextra-theme-docs";

const DiscordBanner = () => {
return (
Expand Down
146 changes: 146 additions & 0 deletions components/ExpandableImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
import React, { useState, useEffect, useCallback, useRef } from "react";
import { FiZoomIn, FiZoomOut, FiRefreshCw } from "react-icons/fi";

interface ExpandableImageProps {
src: string;
alt: string;
allowZoom?: boolean;
}

const ExpandableImage: React.FC<ExpandableImageProps> = ({
src,
alt,
allowZoom = false,
}) => {
const [isExpanded, setIsExpanded] = useState(false);
const [scale, setScale] = useState(1);
const [position, setPosition] = useState({ x: 0, y: 0 });
const containerRef = useRef<HTMLDivElement>(null);
const imageRef = useRef<HTMLImageElement>(null);

// Ensure the src starts with a leading slash or is an absolute URL
const imageSrc =
src.startsWith("http") || src.startsWith("/") ? src : `/${src}`;

const handleImageClick = () => {
setIsExpanded(true);
resetZoom();
};

const handleModalClick = useCallback(() => {
setIsExpanded(false);
resetZoom();
}, []);

const resetZoom = () => {
setScale(1);
setPosition({ x: 0, y: 0 });
};

const handleZoomIn = () => {
setScale((prevScale) => Math.min(prevScale + 0.5, 5));
};

const handleZoomOut = () => {
setScale((prevScale) => Math.max(prevScale - 0.5, 1));
};

const handleScroll = useCallback(
(event: WheelEvent) => {
if (scale > 1) {
event.preventDefault();
const sensitivity = 0.5;
setPosition((prevPosition) => ({
x: prevPosition.x - event.deltaX * sensitivity,
y: prevPosition.y - event.deltaY * sensitivity,
}));
}
},
[scale],
);

useEffect(() => {
const container = containerRef.current;
if (isExpanded && container) {
container.addEventListener("wheel", handleScroll, { passive: false });
}

return () => {
if (container) {
container.removeEventListener("wheel", handleScroll);
}
};
}, [isExpanded, handleScroll]);

return (
<>
<div className="cursor-pointer hover:opacity-80 transition-opacity my-4">
<img
src={imageSrc}
alt={alt}
width={800}
height={600}
onClick={handleImageClick}
style={{ maxWidth: "100%", height: "auto" }}
className="mx-auto"
/>
</div>
{isExpanded && (
<div
className="fixed inset-0 bg-black bg-opacity-80 flex justify-center items-center z-50"
onClick={handleModalClick}
>
<div
ref={containerRef}
className="relative overflow-hidden"
style={{
width: "90vw",
height: "90vh",
}}
onClick={(e) => e.stopPropagation()}
>
<img
ref={imageRef}
src={imageSrc}
alt={alt}
style={{
width: "100%",
height: "100%",
objectFit: "contain",
transform: `scale(${scale})`,
transition: "transform 0.2s ease-out",
cursor: allowZoom && scale > 1 ? "move" : "default",
transformOrigin: "center",
translate: `${position.x}px ${position.y}px`,
}}
/>
{allowZoom && (
<div className="absolute bottom-4 right-4 flex space-x-2">
<button
onClick={handleZoomIn}
className="bg-white bg-opacity-50 p-2 rounded-full hover:bg-opacity-75 transition-colors"
>
<FiZoomIn size={24} />
</button>
<button
onClick={handleZoomOut}
className="bg-white bg-opacity-50 p-2 rounded-full hover:bg-opacity-75 transition-colors"
>
<FiZoomOut size={24} />
</button>
<button
onClick={resetZoom}
className="bg-white bg-opacity-50 p-2 rounded-full hover:bg-opacity-75 transition-colors"
>
<FiRefreshCw size={24} />
</button>
</div>
)}
</div>
</div>
)}
</>
);
};

export default ExpandableImage;
12 changes: 6 additions & 6 deletions components/NetworkResources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const NETWORK_DATA = {
property: "Runtime Types",
value: {
type: "link",
url: "https://www.npmjs.com/package/@webb-tools/tangle-substrate-types",
text: "@webb-tools/tangle-substrate-types",
url: "https://www.npmjs.com/package/@tangle-network/tangle-substrate-types",
text: "@tangle-network/tangle-substrate-types",
},
},
{
Expand All @@ -86,7 +86,7 @@ const NETWORK_DATA = {
property: "GitHub Repo",
value: {
type: "link",
url: "https://github.com/webb-tools/tangle",
url: "https://github.com/tangle-network/tangle",
text: "Tangle Repository",
},
},
Expand Down Expand Up @@ -139,8 +139,8 @@ const NETWORK_DATA = {
property: "Runtime Types",
value: {
type: "link",
url: "https://www.npmjs.com/package/@webb-tools/tangle-substrate-types",
text: "@webb-tools/tangle-substrate-types",
url: "https://www.npmjs.com/package/@tangle-network/tangle-substrate-types",
text: "@tangle-network/tangle-substrate-types",
},
},
{
Expand All @@ -155,7 +155,7 @@ const NETWORK_DATA = {
property: "GitHub Repo",
value: {
type: "link",
url: "https://github.com/webb-tools/tangle",
url: "https://github.com/tangle-network/tangle",
text: "Tangle Repository",
},
},
Expand Down
10 changes: 5 additions & 5 deletions components/OldFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ const navigation = {
general: [
{
name: "Tangle Network Whitepaper",
href: "https://github.com/webb-tools/tangle/blob/main/Tangle_Network_Whitepaper_March282024.pdf",
href: "https://github.com/tangle-network/tangle/blob/main/Tangle_Network_Whitepaper_March282024.pdf",
},
// { name: "FAQ", href: "/faq" },
],
source: [
{
name: "Webb.js API Tools",
href: "https://webb-tools.github.io/webb.js/",
href: "https://tangle-network.github.io/webb.js/",
},
{
name: "Solidity",
href: "https://webb-tools.github.io/protocol-solidity/",
href: "https://tangle-network.github.io/protocol-solidity/",
},
{
name: "Substrate",
href: "https://webb-tools.github.io/protocol-substrate/",
href: "https://tangle-network.github.io/protocol-substrate/",
},
//TODO: need source docs
// { name: "ZK Gadgets", href: "/docs" },
Expand All @@ -63,7 +63,7 @@ const navigation = {
community: [
{
name: "GitHub",
href: "https://github.com/webb-tools/tangle",
href: "https://github.com/tangle-network/tangle",
},
{
name: "Telegram",
Expand Down
2 changes: 1 addition & 1 deletion components/QuickStart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const DappsAreaBridge = () => {
description: "Monorepo for Webb dApps",
name: "webb-dapp",
}}
href="https://github.com/webb-tools/webb-dapp"
href="https://github.com/tangle-network/webb-dapp"
></DetailedFeatureLink>
</div>
);
Expand Down
10 changes: 5 additions & 5 deletions components/RepoArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ export const RepoArea = () => {
<DetailedFeatureLink
feature={{
Icon: GitHubIcon,
description: `An MPC-as-a-service blockchain infrastructure for empowering cross-chain and zero-knowledge applications development.`,
description: `A marketplace for on-demand, multi-party crypto infrastructure`,
name: "Tangle Network Repo",
}}
href="https://github.com/webb-tools/tangle"
href="https://github.com/tangle-network/tangle"
/>
<DetailedFeatureLink
feature={{
Icon: GitHubIcon,
description: `Documentation for the Tangle Network`,
name: "Tangle Docs Repo",
}}
href="https://github.com/webb-tools/tangle-docs"
href="https://github.com/tangle-network/tangle-docs"
/>
</div>
);
Expand All @@ -34,7 +34,7 @@ export const StatsdApp = () => {
description: "Monorepo for Webb dApps",
name: "webb-dapp",
}}
href="https://github.com/webb-tools/webb-dapp"
href="https://github.com/tangle-network/webb-dapp"
></DetailedFeatureLink>
<DetailedFeatureLink
feature={{
Expand All @@ -50,7 +50,7 @@ export const StatsdApp = () => {
description: "SubQuery implementation for DKG and Webb Networks",
name: "webb-subql",
}}
href="https://github.com/webb-tools/webb-subql"
href="https://github.com/tangle-network/webb-subql"
></DetailedFeatureLink>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion components/Social.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TelegramIcon, TwitterIcon } from "./Icons";
function Github() {
return (
<a
href="https://github.com/webb-tools/tangle"
href="https://github.com/tangle-network/tangle"
className="hidden p-2 text-current sm:flex hover:opacity-75"
title="Tangle GitHub repo"
target="_blank"
Expand Down
Loading

0 comments on commit f2a019f

Please sign in to comment.