Skip to content

Commit

Permalink
make optional
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava committed Oct 1, 2024
1 parent 09169b5 commit 55c06ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import { PlaygroundEndpointDesktopLayout } from "./PlaygroundEndpointDesktopLayo
import { PlaygroundEndpointMobileLayout } from "./PlaygroundEndpointMobileLayout";

interface PlaygroundEndpointContentLayoutProps {
endpointId: string;
sendRequest: () => void;
form: ReactNode;
requestCard: ReactNode;
responseCard: ReactNode;
endpointId?: string;
}

export function PlaygroundEndpointContentLayout({
endpointId,
sendRequest,
form,
requestCard,
responseCard,
endpointId,
}: PlaygroundEndpointContentLayoutProps): ReactElement {
const isMobileScreen = useAtomValue(IS_MOBILE_SCREEN_ATOM);

Expand All @@ -40,19 +40,19 @@ export function PlaygroundEndpointContentLayout({
>
{!isMobileScreen ? (
<PlaygroundEndpointDesktopLayout
endpointId={endpointId}
scrollAreaHeight={scrollAreaHeight}
form={form}
requestCard={requestCard}
responseCard={responseCard}
endpointId={endpointId}
/>
) : (
<PlaygroundEndpointMobileLayout
endpointId={endpointId}
form={form}
requestCard={requestCard}
responseCard={responseCard}
sendButton={<PlaygroundSendRequestButton sendRequest={sendRequest} />}
endpointId={endpointId}
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { useFeatureFlags } from "../../atoms";
import { HorizontalSplitPane, VerticalSplitPane } from "../VerticalSplitPane";

interface PlaygroundEndpointDesktopLayoutProps {
endpointId: string;
scrollAreaHeight: number;
form: ReactNode;
requestCard: ReactNode;
responseCard: ReactNode;
endpointId?: string;
}

export function PlaygroundEndpointDesktopLayout({
endpointId,
scrollAreaHeight,
form,
requestCard,
responseCard,
endpointId,
}: PlaygroundEndpointDesktopLayoutProps): ReactElement {
const { grpcEndpoints } = useFeatureFlags();

Expand All @@ -28,15 +28,15 @@ export function PlaygroundEndpointDesktopLayout({
style={{ height: scrollAreaHeight }}
aboveClassName={
// TODO: Remove after pinecone demo
grpcEndpoints?.includes(endpointId)
endpointId && grpcEndpoints?.includes(endpointId)
? "py-6 flex items-stretch justify-stretch"
: "pt-6 pb-1 flex items-stretch justify-stretch"
}
belowClassName="pb-6 pt-1 flex items-stretch justify-stretch"
>
{
// TODO: Remove after pinecone demo
grpcEndpoints?.includes(endpointId) ? null : requestCard
endpointId && grpcEndpoints?.includes(endpointId) ? null : requestCard
}
{responseCard}
</VerticalSplitPane>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { ReactElement, ReactNode, useState } from "react";
import { useFeatureFlags } from "../../atoms";

interface PlaygroundEndpointMobileLayoutProps {
endpointId: string;
form: ReactNode;
requestCard: ReactNode;
responseCard: ReactNode;
sendButton: ReactNode;
endpointId?: string;
}

export function PlaygroundEndpointMobileLayout({
Expand Down Expand Up @@ -43,7 +43,7 @@ export function PlaygroundEndpointMobileLayout({
}
/> */}
</div>
{grpcEndpoints?.includes(endpointId) && requestCard}
{endpointId && grpcEndpoints?.includes(endpointId) && requestCard}
</div>
),
},
Expand Down

0 comments on commit 55c06ae

Please sign in to comment.