Formatting Fixes
This commit is contained in:
parent
f8ab2f12be
commit
d09df8a497
4 changed files with 42 additions and 32 deletions
|
|
@ -1,13 +1,21 @@
|
|||
import { useState } from "react";
|
||||
import { gradients } from "../../utils/styleUtils";
|
||||
|
||||
|
||||
export default function GradientChooserComponent({value, onChange}){
|
||||
return (
|
||||
<div className="flex flex-wrap gap-4 justify-center items-center">
|
||||
{gradients.map((gradient, idx) =>
|
||||
<div onClick={() => {onChange(gradient)}} className={"cursor-pointer w-12 h-12 rounded-full transition-all duration-400 " + gradient + (value === gradient ? " shadow-lg ring-2 ring-primary" : "")} key={idx}></div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default function GradientChooserComponent({ value, onChange }) {
|
||||
return (
|
||||
<div className="flex flex-wrap items-center justify-center gap-4">
|
||||
{gradients.map((gradient, idx) => (
|
||||
<div
|
||||
onClick={() => {
|
||||
onChange(gradient);
|
||||
}}
|
||||
className={
|
||||
"duration-400 h-12 w-12 cursor-pointer rounded-full transition-all " +
|
||||
gradient +
|
||||
(value === gradient ? " shadow-lg ring-2 ring-primary" : "")
|
||||
}
|
||||
key={idx}
|
||||
></div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,12 +100,10 @@ export default function ExtraSidebar(): JSX.Element {
|
|||
<div className="side-bar-button">
|
||||
{flow && flow.data && (
|
||||
<ApiModal flow={flow}>
|
||||
<button className={"w-full " + (!isBuilt ? "button-disable" : "")}>
|
||||
<div
|
||||
className={classNames(
|
||||
"extra-side-bar-buttons"
|
||||
)}
|
||||
>
|
||||
<button
|
||||
className={"w-full " + (!isBuilt ? "button-disable" : "")}
|
||||
>
|
||||
<div className={classNames("extra-side-bar-buttons")}>
|
||||
<IconComponent
|
||||
name="Code2"
|
||||
className={
|
||||
|
|
|
|||
|
|
@ -40,8 +40,9 @@ export default function ProfileSettingsPage(): JSX.Element {
|
|||
return;
|
||||
}
|
||||
try {
|
||||
if(password !== "") await resetPassword(userData!.id, { password });
|
||||
if(gradient !== "") await updateUser(userData!.id, { profile_image: gradient });
|
||||
if (password !== "") await resetPassword(userData!.id, { password });
|
||||
if (gradient !== "")
|
||||
await updateUser(userData!.id, { profile_image: gradient });
|
||||
if (gradient !== "") {
|
||||
let newUserData = cloneDeep(userData);
|
||||
newUserData!.profile_image = gradient;
|
||||
|
|
@ -52,7 +53,10 @@ export default function ProfileSettingsPage(): JSX.Element {
|
|||
handleInput({ target: { name: "cnfPassword", value: "" } });
|
||||
setSuccessData({ title: "Changes saved successfully!" });
|
||||
} catch (error) {
|
||||
setErrorData({ title: "Error saving changes", list: [(error as any).response.data.detail] });
|
||||
setErrorData({
|
||||
title: "Error saving changes",
|
||||
list: [(error as any).response.data.detail],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -92,16 +96,16 @@ export default function ProfileSettingsPage(): JSX.Element {
|
|||
<Form.Label className="data-[invalid]:label-invalid">
|
||||
Password{" "}
|
||||
</Form.Label>
|
||||
<InputComponent
|
||||
onChange={(value) => {
|
||||
handleInput({ target: { name: "password", value } });
|
||||
}}
|
||||
value={password}
|
||||
isForm
|
||||
password={true}
|
||||
placeholder="Password"
|
||||
className="w-full"
|
||||
/>
|
||||
<InputComponent
|
||||
onChange={(value) => {
|
||||
handleInput({ target: { name: "password", value } });
|
||||
}}
|
||||
value={password}
|
||||
isForm
|
||||
password={true}
|
||||
placeholder="Password"
|
||||
className="w-full"
|
||||
/>
|
||||
<Form.Message match="valueMissing" className="field-invalid">
|
||||
Please enter your password
|
||||
</Form.Message>
|
||||
|
|
|
|||
|
|
@ -84,12 +84,12 @@ export type changeUser = {
|
|||
is_superuser?: boolean;
|
||||
password?: string;
|
||||
profile_image?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type resetPasswordType = {
|
||||
password?: string;
|
||||
profile_image?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type Users = {
|
||||
id: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue