Skip to main content
Version: 2.3.0

ProfilePicChangeModal

The profile picture change modal is used to change or remove the user's current profile picture.

Loading...

Usage#

import React from "react";
import {
ProfilePicChangeModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const ProfilePicChangeExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("profile-picture")}>
change your profile picture
</button>
<PelcroModalController>
<ProfilePicChangeModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.

onChangeSuccess#

() โ‡’ void

Callback function called when the picture is changed succesfully.

onRemoveSuccess#

() โ‡’ void

Callback function called when the picture is removed succesfully.

onChangeFailure#

(errorObject) โ‡’ void

Callback function called when changing the picture fails.

onRemoveFailure#

(errorObject) โ‡’ void

Callback function called when removing the picture fails.