fix: replace with toast

pull/5494/head
Arik Chakma 8 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 [profileRoadmaps, setProfileRoadmaps] = useState<RoadmapType[]>([]);
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [success, setSuccess] = useState('');
const handleSubmit = async (e: FormEvent<HTMLFormElement>) => { const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {
e.preventDefault(); e.preventDefault();
setIsLoading(true); setIsLoading(true);
setSuccess('');
const { response, error } = await httpPatch( const { response, error } = await httpPatch(
`${import.meta.env.PUBLIC_API_URL}/v1-update-public-profile-config`, `${import.meta.env.PUBLIC_API_URL}/v1-update-public-profile-config`,
@ -77,7 +75,7 @@ export function UpdatePublicProfileForm() {
} }
await loadProfileSettings(); await loadProfileSettings();
setSuccess('Profile updated successfully'); toast.success('Profile updated successfully');
}; };
const loadProfileSettings = async () => { 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 <button
type="submit" type="submit"
disabled={isLoading} disabled={isLoading}

Loading…
Cancel
Save