Add config.ts with configurable endpoint
This commit is contained in:
parent
a80f13cf8d
commit
9081ae7169
|
@ -13,6 +13,7 @@ import {
|
||||||
Zoom,
|
Zoom,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import SettingsIcon from "@mui/icons-material/Settings";
|
import SettingsIcon from "@mui/icons-material/Settings";
|
||||||
|
import config from "../config";
|
||||||
|
|
||||||
export interface EndpointDialogProps {
|
export interface EndpointDialogProps {
|
||||||
endpoint: string;
|
endpoint: string;
|
||||||
|
@ -89,7 +90,7 @@ const EndpointDialog = ({
|
||||||
|
|
||||||
isValidEndpoint() ? closeTheError() : showTheError();
|
isValidEndpoint() ? closeTheError() : showTheError();
|
||||||
}}
|
}}
|
||||||
placeholder="localhost:8080"
|
placeholder={config.defaultEndpoint}
|
||||||
error={error}
|
error={error}
|
||||||
helperText={errorText}
|
helperText={errorText}
|
||||||
/>
|
/>
|
||||||
|
|
6
src/config.ts
Normal file
6
src/config.ts
Normal 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;
|
|
@ -14,6 +14,7 @@ import ReviewField, { ReviewFieldProps } from "../components/ReviewField";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import EndpointDialog from "../components/EndpointDialong";
|
import EndpointDialog from "../components/EndpointDialong";
|
||||||
import PageSwitcher from "../components/PageSwitcher";
|
import PageSwitcher from "../components/PageSwitcher";
|
||||||
|
import config from "../config";
|
||||||
|
|
||||||
interface HomeProps {
|
interface HomeProps {
|
||||||
endpoint: string;
|
endpoint: string;
|
||||||
|
|
Loading…
Reference in a new issue