Skip to content

Commit

Permalink
Merge branch 'main' into ajiang/navigation-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed May 24, 2024
2 parents 0226a8e + 0a719c4 commit 9631973
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
7 changes: 6 additions & 1 deletion packages/ui/app/src/api-playground/PlaygroundContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export const PLAYGROUND_FORM_STATE_ATOM = atomWithStorage<Record<string, Playgro
{},
);

const fetcher = async (url: string) => {
const res = await fetch(url);
return res.json();
};

export const PlaygroundContextProvider: FC<PropsWithChildren> = ({ children }) => {
const { isApiPlaygroundEnabled } = useFeatureFlags();
const [apis, setApis] = useAtom(APIS);
Expand All @@ -58,7 +63,7 @@ export const PlaygroundContextProvider: FC<PropsWithChildren> = ({ children }) =

const key = urljoin(basePath ?? "", "/api/fern-docs/resolve-api");

const { data } = useSWR<Record<string, ResolvedRootPackage> | null>(key);
const { data } = useSWR<Record<string, ResolvedRootPackage> | null>(key, fetcher);
useEffect(() => {
if (data != null) {
setApis(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ exports[`CopyToClipboardButton > renders correctly 1`] = `
<button
aria-disabled={false}
className="group fern-copy-button fern-button minimal normal rounded square"
data-state="off"
data-state="closed"
data-testid="copy-btn"
disabled={false}
onBlur={[Function]}
onClick={[Function]}
onClickCapture={[Function]}
onFocus={[Function]}
onPointerDown={[Function]}
onPointerLeave={[Function]}
onPointerMove={[Function]}
tabIndex={0}
>
<span
Expand Down
4 changes: 1 addition & 3 deletions packages/ui/components/src/FernTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { FC, ReactNode } from "react";

interface FernTooltipProps extends Tooltip.TooltipProps, Omit<Tooltip.TooltipContentProps, "content"> {
content: ReactNode | undefined;
isReady?: boolean;
}

export const FernTooltip: FC<FernTooltipProps> = ({
Expand All @@ -15,10 +14,9 @@ export const FernTooltip: FC<FernTooltipProps> = ({
onOpenChange,
delayDuration,
disableHoverableContent,
isReady,
...props
}) => {
if (content == null || content === "" || !isReady) {
if (content == null || content === "") {
return <>{children}</>;
}
return (
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/docs-bundle/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const assetPrefix = process.env.CDN_URI != null ? new URL("/", process.env.CDN_URI).href : undefined;
const assetPrefix =
process.env.NEXT_PUBLIC_CDN_URI != null ? new URL("/", process.env.NEXT_PUBLIC_CDN_URI).href : undefined;
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/docs-bundle/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import * as Sentry from "@sentry/nextjs";

const sentryEnv = process?.env.NEXT_PUBLIC_APPLICATION_ENVIRONMENT ?? "dev";
const assetPrefix = process.env.CDN_URI != null ? new URL("/", process.env.CDN_URI).href : undefined;
const assetPrefix =
process.env.NEXT_PUBLIC_CDN_URI != null ? new URL("/", process.env.NEXT_PUBLIC_CDN_URI).href : undefined;
const tunnelPath = "/api/fern-docs/monitoring";

Sentry.init({
Expand Down

0 comments on commit 9631973

Please sign in to comment.