fix: replace with toast

pull/5494/head
Arik Chakma 10 months ago
parent e006f63e14
commit afad1ce3c3
  1. 10
      src/components/UpdateProfile/UpdatePublicProfileForm.tsx

@ -45,12 +45,10 @@ export function UpdatePublicProfileForm() {
const [profileRoadmaps, setProfileRoadmaps] = useState<RoadmapType[]>([]);
const [isLoading, setIsLoading] = useState(false);
const [success, setSuccess] = useState('');
const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {
e.preventDefault();
setIsLoading(true);
setSuccess('');
const { response, error } = await httpPatch(
`${import.meta.env.PUBLIC_API_URL}/v1-update-public-profile-config`,
@ -77,7 +75,7 @@ export function UpdatePublicProfileForm() {
}
await loadProfileSettings();
setSuccess('Profile updated successfully');
toast.success('Profile updated successfully');
};
const loadProfileSettings = async () => {
@ -408,12 +406,6 @@ export function UpdatePublicProfileForm() {
</>
)}
{success && (
<p className="mt-2 rounded-lg bg-green-100 p-2 text-green-700">
{success}
</p>
)}
<button
type="submit"
disabled={isLoading}

Loading…
Cancel
Save