id
This commit is contained in:
1 parent
3c0c470ca3
commit
2d85abf030
2 files changed
+39
-16
No files matched your search
@@ -28,6 +28,7 @@ import type { StatusPageResponse } from "@/Types/StatusPage";
|
|||||||
import timezones from "@/Utils/timezones.json";
|
import timezones from "@/Utils/timezones.json";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { MuiColorInput } from "mui-color-input";
|
||||||
|
|
||||||
interface TimezoneOption {
|
interface TimezoneOption {
|
||||||
_id: string;
|
_id: string;
|
||||||
@@ -130,7 +131,7 @@ const CreateStatusPage = () => {
|
|||||||
headers: { "Content-Type": "multipart/form-data" },
|
headers: { "Content-Type": "multipart/form-data" },
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
result = await put(`/status-page/${url}`, fd, {
|
result = await put(`/status-page/${statusPageData?.statusPage.id}`, fd, {
|
||||||
headers: { "Content-Type": "multipart/form-data" },
|
headers: { "Content-Type": "multipart/form-data" },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -358,23 +359,37 @@ const CreateStatusPage = () => {
|
|||||||
title={t("pages.statusPages.form.appearance.title")}
|
title={t("pages.statusPages.form.appearance.title")}
|
||||||
subtitle={t("pages.statusPages.form.appearance.description")}
|
subtitle={t("pages.statusPages.form.appearance.description")}
|
||||||
rightContent={
|
rightContent={
|
||||||
<Stack alignItems={"center"}>
|
<Stack spacing={theme.spacing(8)}>
|
||||||
|
<Stack alignItems={"center"}>
|
||||||
|
<Controller
|
||||||
|
name="logo"
|
||||||
|
control={control}
|
||||||
|
render={({ field }) => (
|
||||||
|
<ImageUpload
|
||||||
|
src={field.value?.data}
|
||||||
|
onChange={(file) => {
|
||||||
|
if (file) {
|
||||||
|
field.onChange({
|
||||||
|
data: file.src,
|
||||||
|
contentType: file.file.type,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
field.onChange(null);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
<Controller
|
<Controller
|
||||||
name="logo"
|
name="color"
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<ImageUpload
|
<MuiColorInput
|
||||||
src={field.value?.data}
|
format="hex"
|
||||||
onChange={(file) => {
|
value={field.value}
|
||||||
if (file) {
|
onChange={field.onChange}
|
||||||
field.onChange({
|
label={t("pages.statusPages.form.appearance.option.color.label")}
|
||||||
data: file.src,
|
|
||||||
contentType: file.file.type,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
field.onChange(null);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -943,7 +943,15 @@
|
|||||||
},
|
},
|
||||||
"appearance": {
|
"appearance": {
|
||||||
"title": "Appearance",
|
"title": "Appearance",
|
||||||
"description": "Define the default look and feel of your public status page."
|
"description": "Define the default look and feel of your public status page.",
|
||||||
|
"option": {
|
||||||
|
"logo": {
|
||||||
|
"label": "Logo"
|
||||||
|
},
|
||||||
|
"color": {
|
||||||
|
"label": "Brand color"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"features": {
|
"features": {
|
||||||
"title": "Features",
|
"title": "Features",
|
||||||
|
|||||||
Reference in new issue
Block a user