Skip to content

Commit 1c0966f

Browse files
authored
(refactor) api reference (#1828)
* (refactor)-api-reference * redirect * refactor * requested changes * requested changes
1 parent 10d62a9 commit 1c0966f

File tree

6 files changed

+26
-16
lines changed

6 files changed

+26
-16
lines changed

apps/api-reference/next.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ export default {
99
},
1010
},
1111

12+
redirects: async () => [
13+
{
14+
source: "/price-feeds/evm",
15+
destination: "/price-feeds/evm/parsePriceFeedUpdates",
16+
permanent: false,
17+
},
18+
],
1219
webpack(config) {
1320
config.module.rules.push({
1421
test: /\.svg$/i,

apps/api-reference/src/app/benchmarks/page.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/api-reference/src/components/Benchmarks/index.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

apps/api-reference/src/components/Header/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ export const Header = ({
3131
>
3232
<ul className="contents">
3333
<li className="contents">
34-
<NavLink href="/price-feeds/evm/getPrice">Price Feeds</NavLink>
34+
<NavLink href="/price-feeds/evm/getPriceNoOlderThan">
35+
Price Feeds
36+
</NavLink>
3537
</li>
3638
<li className="contents">
37-
<NavLink href="/benchmarks">Benchmarks</NavLink>
39+
<NavLink
40+
href="https://benchmarks.pyth.network/docs#/"
41+
target="_blank"
42+
>
43+
Benchmarks
44+
</NavLink>
3845
</li>
3946
<li className="contents">
4047
<NavLink href="/entropy">Entropy</NavLink>

apps/api-reference/src/components/Header/nav-link.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const baseClasses = "font-semibold text-sm py-2 px-3";
99

1010
type NavLinkProps = Omit<ComponentProps<typeof Link>, "href"> & {
1111
href: string;
12+
target?: "_blank" | "_self";
1213
};
1314

1415
export const NavLink = ({ className, ...props }: NavLinkProps) => {

apps/api-reference/src/components/Home/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ export const Home = () => (
2929
</ProductLink>
3030
</li>
3131
<li className="contents">
32-
<ProductLink icon={Benchmarks} href="/benchmarks" name="Benchmarks">
32+
<ProductLink
33+
icon={Benchmarks}
34+
href="https://benchmarks.pyth.network/docs#/"
35+
target="_blank"
36+
name="Benchmarks"
37+
>
3338
Get historical market data from any Pyth feed for use in both on-
3439
and off-chain applications
3540
</ProductLink>
@@ -49,6 +54,7 @@ export const Home = () => (
4954
type ProductLinkProps = {
5055
name: string;
5156
href: string;
57+
target?: "_blank" | "_self";
5258
children: string;
5359
icon: ElementType<SVGProps<SVGSVGElement>>;
5460
};
@@ -57,11 +63,13 @@ const ProductLink = ({
5763
name,
5864
children,
5965
href,
66+
target,
6067
icon: Icon,
6168
}: ProductLinkProps) => (
6269
<Button
6370
as={Link}
6471
href={href}
72+
target={target}
6573
gradient
6674
className="flex max-w-2xl flex-col items-center gap-2 p-6 text-center sm:flex-row sm:gap-6 sm:pr-12 sm:text-left"
6775
>

0 commit comments

Comments
 (0)