From f6e15e609b7f6da8035a9108e127247946728a3a Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Thu, 18 Jan 2024 10:46:12 -0500 Subject: [PATCH 1/2] remove buildwithfern logo --- packages/ui/app/src/App.tsx | 2 +- .../ui/app/src/docs-context/DocsContext.ts | 2 ++ .../src/docs-context/DocsContextProvider.tsx | 3 +++ packages/ui/app/src/sidebar/BuiltWithFern.tsx | 21 +++++++++++-------- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/ui/app/src/App.tsx b/packages/ui/app/src/App.tsx index 40b6fa98e8..dfb19802bb 100644 --- a/packages/ui/app/src/App.tsx +++ b/packages/ui/app/src/App.tsx @@ -37,7 +37,7 @@ export const App: React.FC = ({ docs, resolvedPath }) => { (children, Context) => ( {children} ), - + diff --git a/packages/ui/app/src/docs-context/DocsContext.ts b/packages/ui/app/src/docs-context/DocsContext.ts index 32fdf37ab3..9e52c182c8 100644 --- a/packages/ui/app/src/docs-context/DocsContext.ts +++ b/packages/ui/app/src/docs-context/DocsContext.ts @@ -2,6 +2,7 @@ import { APIV1Read, DocsV1Read, FdrAPI } from "@fern-api/fdr-sdk"; import React from "react"; export const DocsContext = React.createContext({ + domain: "app.buildwithfern.com", // eslint-disable-next-line @typescript-eslint/no-non-null-assertion docsDefinition: undefined!, resolveApi: () => undefined, @@ -10,6 +11,7 @@ export const DocsContext = React.createContext({ }); export interface DocsContextValue { + domain: string; docsDefinition: DocsV1Read.DocsDefinition; resolveApi: (apiId: FdrAPI.ApiDefinitionId) => APIV1Read.ApiDefinition | undefined; diff --git a/packages/ui/app/src/docs-context/DocsContextProvider.tsx b/packages/ui/app/src/docs-context/DocsContextProvider.tsx index d6d833d777..007d930584 100644 --- a/packages/ui/app/src/docs-context/DocsContextProvider.tsx +++ b/packages/ui/app/src/docs-context/DocsContextProvider.tsx @@ -6,10 +6,12 @@ import { DocsContext } from "./DocsContext"; export declare namespace DocsContextProvider { export type Props = PropsWithChildren<{ docsDefinition: DocsV1Read.DocsDefinition; + domain: string; }>; } export const DocsContextProvider: React.FC = ({ + domain, docsDefinition: unmemoizedDocsDefinition, children, }) => { @@ -54,6 +56,7 @@ export const DocsContextProvider: React.FC = ({ return ( = ({ className }) => { - const onClick = useCallback(() => { - window.open("https://buildwithfern.com", "_blank", "noopener noreferrer"); - }, []); - const { isHovering, ...containerCallbacks } = useIsHovering(); + const { domain } = useDocsContext(); + + if (domain.toLowerCase().includes("polytomic")) { + return null; + } + return ( -
@@ -33,6 +36,6 @@ export const BuiltWithFern: React.FC = ({ className }) => { > Built with Fern
-
+ ); }; From c2e3add6179c97c7ffef04bb5fbdd0c3c9b02c3d Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Thu, 18 Jan 2024 10:47:10 -0500 Subject: [PATCH 2/2] donezo --- packages/ui/app/src/sidebar/BuiltWithFern.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ui/app/src/sidebar/BuiltWithFern.tsx b/packages/ui/app/src/sidebar/BuiltWithFern.tsx index 503c915a20..cbf691fa3f 100644 --- a/packages/ui/app/src/sidebar/BuiltWithFern.tsx +++ b/packages/ui/app/src/sidebar/BuiltWithFern.tsx @@ -15,6 +15,7 @@ export const BuiltWithFern: React.FC = ({ className }) => { const { domain } = useDocsContext(); + // TODO: move this to venus if (domain.toLowerCase().includes("polytomic")) { return null; }