From 56e6f1f6085a8edb2523b24a47a1b53acff02921 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Wed, 29 Nov 2023 04:48:55 -0500 Subject: [PATCH] show output settings at all times --- frontend/src/App.tsx | 13 +- .../src/components/OutputSettingsSection.tsx | 133 +++++++++--------- 2 files changed, 77 insertions(+), 69 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 80f6714..5bf973b 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -186,12 +186,13 @@ function App() { - {appState === AppState.INITIAL && ( - - )} + {IS_RUNNING_ON_CLOUD && !settings.openAiApiKey && } diff --git a/frontend/src/components/OutputSettingsSection.tsx b/frontend/src/components/OutputSettingsSection.tsx index 7631043..43318f8 100644 --- a/frontend/src/components/OutputSettingsSection.tsx +++ b/frontend/src/components/OutputSettingsSection.tsx @@ -81,15 +81,20 @@ function generateDisplayString(settings: OutputSettings) { interface Props { outputSettings: OutputSettings; setOutputSettings: React.Dispatch>; + shouldDisableUpdates?: boolean; } -function OutputSettingsSection({ outputSettings, setOutputSettings }: Props) { +function OutputSettingsSection({ + outputSettings, + setOutputSettings, + shouldDisableUpdates = false, +}: Props) { const onCSSValueChange = (value: string) => { setOutputSettings((prev) => { if (prev.js === JSFrameworkOption.REACT) { if (value !== CSSOption.TAILWIND) { toast.error( - "React only supports Tailwind CSS. Change JS framework to Vanilla to use Bootstrap." + 'React only supports Tailwind CSS. Change JS framework to "No Framework" to use Bootstrap.' ); } return { @@ -122,71 +127,73 @@ function OutputSettingsSection({ outputSettings, setOutputSettings }: Props) { return (
{generateDisplayString(outputSettings)}{" "} - - - - - -
-
-

Code Settings

-

- Customize your code output -

-
-
-
- - + {!shouldDisableUpdates && ( + + + + + +
+
+

Code Settings

+

+ Customize your code output +

-
- - - {displayCSSOption(outputSettings.css)} - - - - - Tailwind - - - Bootstrap - - - - + + {displayJSOption(outputSettings.js)} + + + + + No Framework + + + React + + + + +
+
+ + +
-
- - + + + )}
); }