Skip to content

Commit

Permalink
removed docs links for non-oas bins
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtwist committed Nov 3, 2024
1 parent a2dc2a8 commit ec2b1e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 2 additions & 5 deletions tests/pizza.oas.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@
},
"examples": {
"orderResponseExample": {
"summary": "Order Response Example",
"value": {
"orderId": "abc123",
"estimatedDeliveryTime": "45 minutes"
}
"orderId": "abc123",
"estimatedDeliveryTime": "45 minutes"
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion www/components/BinHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -42,7 +44,7 @@ const BinHeader = ({
{binUrl}
</code>
<CopyButton textToCopy={binUrl} />
<DocsButton docsUrl={docsUrl} />
{isOas && <DocsButton docsUrl={docsUrl} />}
</div>
<div className="flex gap-4 px-4 items-center">
<RMOLink />
Expand Down
4 changes: 3 additions & 1 deletion www/pages/bins/[binId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<main>
<BinHeader
Expand Down Expand Up @@ -181,7 +183,7 @@ const Bin = () => {
Copied!
</span>
</button>
<DocsButton docsUrl={docsUrl} />
{isOas && <DocsButton docsUrl={docsUrl} />}
</div>
</div>
) : (
Expand Down

0 comments on commit ec2b1e7

Please sign in to comment.