From ec2b1e70ac2d95dc85ef107678636c1fd6637c18 Mon Sep 17 00:00:00 2001 From: Josh Twist Date: Sun, 3 Nov 2024 21:34:06 +0000 Subject: [PATCH] removed docs links for non-oas bins --- tests/pizza.oas.json | 7 ++----- www/components/BinHeader.tsx | 4 +++- www/pages/bins/[binId].tsx | 4 +++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/pizza.oas.json b/tests/pizza.oas.json index 3f37d53..ef85193 100644 --- a/tests/pizza.oas.json +++ b/tests/pizza.oas.json @@ -42,11 +42,8 @@ }, "examples": { "orderResponseExample": { - "summary": "Order Response Example", - "value": { - "orderId": "abc123", - "estimatedDeliveryTime": "45 minutes" - } + "orderId": "abc123", + "estimatedDeliveryTime": "45 minutes" } } } diff --git a/www/components/BinHeader.tsx b/www/components/BinHeader.tsx index 4ecb190..f002ba5 100644 --- a/www/components/BinHeader.tsx +++ b/www/components/BinHeader.tsx @@ -10,11 +10,13 @@ import RMOLink from "@/components/RMOLink"; import DocsButton from "./DocsButton"; const BinHeader = ({ + isOas, docsUrl, binUrl, onRefresh, isNewBin, }: { + isOas: boolean; docsUrl: string; binUrl: string; onRefresh: () => void; @@ -42,7 +44,7 @@ const BinHeader = ({ {binUrl} - + {isOas && }
diff --git a/www/pages/bins/[binId].tsx b/www/pages/bins/[binId].tsx index 97bf763..ac3dbbf 100644 --- a/www/pages/bins/[binId].tsx +++ b/www/pages/bins/[binId].tsx @@ -145,6 +145,8 @@ const Bin = () => { const docsUrl = `https://zudoku.dev/demo?api-url=${process.env.NEXT_PUBLIC_API_URL}/v1/bins/${binId}`; const binUrl = requests.url ?? `${process.env.NEXT_PUBLIC_API_URL}/${binId}`; + const isOas = (binId ?? "").indexOf("_oas") > 0; + return (
{ Copied! - + {isOas && }
) : (