Skip to content

Commit

Permalink
rename vanilla to "no framework"
Browse files Browse the repository at this point in the history
  • Loading branch information
abi committed Nov 29, 2023
1 parent e2c1bd2 commit 58298a1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function App() {
);
const [outputSettings, setOutputSettings] = useState<OutputSettings>({
css: CSSOption.TAILWIND,
js: JSFrameworkOption.VANILLA,
js: JSFrameworkOption.NO_FRAMEWORK,
});
const [shouldIncludeResultImage, setShouldIncludeResultImage] =
useState<boolean>(false);
Expand Down
22 changes: 16 additions & 6 deletions frontend/src/components/OutputSettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
SelectTrigger,
} from "./ui/select";
import { CSSOption, JSFrameworkOption, OutputSettings } from "../types";
import { capitalize } from "../lib/utils";
import toast from "react-hot-toast";
import { Label } from "@radix-ui/react-label";
import { Button } from "./ui/button";
Expand All @@ -23,6 +22,17 @@ function displayCSSOption(option: CSSOption) {
}
}

function displayJSOption(option: JSFrameworkOption) {
switch (option) {
case JSFrameworkOption.REACT:
return "React";
case JSFrameworkOption.NO_FRAMEWORK:
return "No Framework";
default:
return option;
}
}

function convertStringToCSSOption(option: string) {
switch (option) {
case "tailwind":
Expand All @@ -46,7 +56,7 @@ function generateDisplayString(settings: OutputSettings) {
</div>
);
} else if (
settings.js === JSFrameworkOption.VANILLA &&
settings.js === JSFrameworkOption.NO_FRAMEWORK &&
settings.css === CSSOption.TAILWIND
) {
return (
Expand All @@ -56,7 +66,7 @@ function generateDisplayString(settings: OutputSettings) {
</div>
);
} else if (
settings.js === JSFrameworkOption.VANILLA &&
settings.js === JSFrameworkOption.NO_FRAMEWORK &&
settings.css === CSSOption.BOOTSTRAP
) {
return (
Expand Down Expand Up @@ -135,12 +145,12 @@ function OutputSettingsSection({ outputSettings, setOutputSettings }: Props) {
className="col-span-2 h-8"
id="output-settings-js"
>
{capitalize(outputSettings.js)}
{displayJSOption(outputSettings.js)}
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem value={JSFrameworkOption.VANILLA}>
Vanilla
<SelectItem value={JSFrameworkOption.NO_FRAMEWORK}>
No Framework
</SelectItem>
<SelectItem value={JSFrameworkOption.REACT}>
React
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export enum CSSOption {
}

export enum JSFrameworkOption {
VANILLA = "vanilla",
NO_FRAMEWORK = "vanilla",
REACT = "react",
VUE = "vue",
}
Expand Down

0 comments on commit 58298a1

Please sign in to comment.