Add config.ts with configurable endpoint

This commit is contained in:
powermaker450 2024-09-12 00:04:20 -04:00
parent a80f13cf8d
commit 9081ae7169
3 changed files with 9 additions and 1 deletions

View file

@ -13,6 +13,7 @@ import {
Zoom,
} from "@mui/material";
import SettingsIcon from "@mui/icons-material/Settings";
import config from "../config";
export interface EndpointDialogProps {
endpoint: string;
@ -89,7 +90,7 @@ const EndpointDialog = ({
isValidEndpoint() ? closeTheError() : showTheError();
}}
placeholder="localhost:8080"
placeholder={config.defaultEndpoint}
error={error}
helperText={errorText}
/>

6
src/config.ts Normal file
View file

@ -0,0 +1,6 @@
const config = {
// Change this to whatever you like. I plan to make this easily configurable later.
defaultEndpoint: "localhost:8080"
}
export default config;

View file

@ -14,6 +14,7 @@ import ReviewField, { ReviewFieldProps } from "../components/ReviewField";
import { useEffect, useState } from "react";
import EndpointDialog from "../components/EndpointDialong";
import PageSwitcher from "../components/PageSwitcher";
import config from "../config";
interface HomeProps {
endpoint: string;