- Make status page url disabled and read from env

- Use ColorPicker for color selection
This commit is contained in:
Shemy Gan committed 2025-01-10 15:27:07 -05:00
1 parent df4a7f6720
commit df86c926c7
3 files changed
+29 -21

No files matched your search

@@ -17,6 +17,7 @@ import ProgressUpload from "../../ProgressBars";
import ImageIcon from "@mui/icons-material/Image";
import { HttpAdornment } from "../../Inputs/TextInput/Adornments";
import { StatusFormContext } from "../../../Pages/Status/CreateStatusContext";
import ColorPicker from "../../Inputs/ColorPicker";
/**
* General settings panel is ued to compose part of the public static page
@@ -53,6 +54,13 @@ const GeneralSettingsPanel = () => {
setProgress({ value: 0, isLoading: false });
};
const handleColorChange = (newValue) => {
setForm((prev) => ({
...prev,
color: newValue,
}));
}
const handleChange = (event) => {
event.preventDefault();
const { value, id, name } = event.target;
@@ -114,9 +122,7 @@ const GeneralSettingsPanel = () => {
};
return (
<TabPanel
value="General settings"
>
<TabPanel value="General settings">
<Stack
component="form"
className="status-general-settings-form"
@@ -170,13 +176,13 @@ const GeneralSettingsPanel = () => {
type="url"
label="Your status page address"
disabled
value={SUBDOAMIN_PREFIX+ STATUS_PAGE}
// startAdornment={
// <HttpAdornment
// prefix={SUBDOAMIN_PREFIX}
// https={false}
// />
// }
value={form.url ?? STATUS_PAGE}
startAdornment={
<HttpAdornment
prefix={SUBDOAMIN_PREFIX}
https={false}
/>
}
onChange={handleChange}
onBlur={handleBlur}
helperText={errors["url"]}
@@ -227,8 +233,8 @@ const GeneralSettingsPanel = () => {
onClick={removeLogo}
sx={{
width: "100%",
maxWidth:"200px",
alignSelf: "center"
maxWidth: "200px",
alignSelf: "center",
}}
>
Remove Logo
@@ -236,14 +242,14 @@ const GeneralSettingsPanel = () => {
) : (
""
)}
<TextInput
<ColorPicker
id="color"
label="Color"
value={form.color}
error={errors["color"]}
onChange={handleChange}
onChange={handleColorChange}
onBlur={handleBlur}
/>
></ColorPicker>
</Stack>
</ConfigBox>
</Stack>