Skip to content

Commit

Permalink
Change component name to ButtonDeleteProfile
Browse files Browse the repository at this point in the history
  • Loading branch information
louilinn committed Oct 10, 2023
1 parent 7b94e4b commit c96b449
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 deletions.
2 changes: 1 addition & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
},
"bodyUndeployedToken": "Account not verified"
},
"RemoveYourData": {
"ButtonDeleteProfile": {
"titleText": "Are you sure you want to delete your profile data?",
"bodyText": "This action will delete your profile picture, username and email from our databases.",
"bodyText2": "However, this action will not delete historical transaction data or trust interactions.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ExternalLink from '~/components/ExternalLink';
import translate from '~/services/locale';
import notify, { NotificationsTypes } from '~/store/notifications/actions';
import { FAQ_URL } from '~/utils/constants';
import logError, { translateErrorForUser } from '~/utils/debug';
import logError from '~/utils/debug';

const useStyles = makeStyles(() => ({
textContainer: {
Expand All @@ -19,7 +19,7 @@ const useStyles = makeStyles(() => ({
},
}));

const RemoveYourData = () => {
const ButtonDeleteProfile = () => {
const classes = useStyles();
const dispatch = useDispatch();

Expand All @@ -34,7 +34,7 @@ const RemoveYourData = () => {
notify({
text: (
<Typography classes={{ root: 'body4_white' }} variant="body4">
{translate('RemoveYourData.notificationSuccess')}
{translate('ButtonDeleteProfile.notificationSuccess')}
</Typography>
),
type: NotificationsTypes.SUCCESS,
Expand All @@ -46,7 +46,7 @@ const RemoveYourData = () => {
notify({
text: (
<Typography classes={{ root: 'body4_white' }} variant="body4">
{translate('RemoveYourData.notification.Error')}
{translate('ButtonDeleteProfile.notification.Error')}
</Typography>
),
type: NotificationsTypes.ERROR,
Expand All @@ -62,16 +62,16 @@ const RemoveYourData = () => {
const dialogContentClose = (
<Box className={classes.dialogContentContainer}>
<Typography align="center" mb={2}>
{translate('RemoveYourData.bodyText')}
{translate('ButtonDeleteProfile.bodyText')}
</Typography>
<Typography align="center" mb={2}>
{translate('RemoveYourData.bodyText2')}
{translate('ButtonDeleteProfile.bodyText2')}
</Typography>
<Typography align="center" mb={2}>
{translate('RemoveYourData.bodyText3')}
{translate('ButtonDeleteProfile.bodyText3')}
</Typography>
<Typography align="center" mb={2}>
{translate('RemoveYourData.bodyText4')}
{translate('ButtonDeleteProfile.bodyText4')}
</Typography>
<ExternalLink href={FAQ_URL}>
<Typography
Expand All @@ -80,7 +80,7 @@ const RemoveYourData = () => {
paragraph
variant="body3"
>
{translate('RemoveYourData.readMore')}
{translate('ButtonDeleteProfile.readMore')}
</Typography>
</ExternalLink>
<Box pt={3}>
Expand All @@ -90,12 +90,12 @@ const RemoveYourData = () => {
fullWidth
onClick={dialogCloseInfoHandler}
>
{translate('RemoveYourData.confirmationDelete')}
{translate('ButtonDeleteProfile.confirmationDelete')}
</Button>
</Box>
<Box display="flex" flexDirection="column">
<Button isText m={2} onClick={() => setIsOpenDialogCloseInfo(false)}>
{translate('RemoveYourData.confirmationCancel')}
{translate('ButtonDeleteProfile.confirmationCancel')}
</Button>
</Box>
</Box>
Expand All @@ -111,17 +111,13 @@ const RemoveYourData = () => {
isBtnClose={false}
isOpen={isOpenDialogCloseInfo}
maxWidth={'xs'}
title={translate('RemoveYourData.titleText')}
title={translate('ButtonDeleteProfile.titleText')}
/>
<Button
isOutline
fullWidth
onClick={dialogOpenInfoHandler}
>
{translate('RemoveYourData.btnText')}
<Button fullWidth isOutline onClick={dialogOpenInfoHandler}>
{translate('ButtonDeleteProfile.btnText')}
</Button>
</Box>
);
};

export default RemoveYourData;
export default ButtonDeleteProfile;
6 changes: 3 additions & 3 deletions src/views/EditProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import { DASHBOARD_PATH } from '~/routes';
import Avatar from '~/components/Avatar';
import Button from '~/components/Button';
import ButtonBack from '~/components/ButtonBack';
import ButtonDeleteProfile from '~/components/ButtonDeleteProfile';
import CenteredHeading from '~/components/CenteredHeading';
import CheckboxPrivacy from '~/components/CheckboxPrivacy';
import CheckboxTerms from '~/components/CheckboxTerms';
import DialogInfo from '~/components/DialogInfo';
import Footer from '~/components/Footer';
import Header from '~/components/Header';
import RemoveYourData from '~/components/RemoveYourData';
import UploadFromCamera from '~/components/UploadFromCamera';
import VerifiedEmailInput from '~/components/VerifiedEmailInput';
import VerifiedUsernameInput from '~/components/VerifiedUsernameInput';
Expand Down Expand Up @@ -82,7 +82,7 @@ const useStyles = makeStyles((theme) => ({
position: 'relative',
zIndex: theme.zIndex.layer1,
},
removeYourData: {
ButtonDeleteProfile: {
position: 'relative',
marginTop: '5px',
},
Expand Down Expand Up @@ -527,7 +527,7 @@ const EditProfile = () => {
>
{translate('EditProfile.buttonSave')}
</Button>
<RemoveYourData className={classes.removeYourData} />
<ButtonDeleteProfile className={classes.ButtonDeleteProfile} />
</Footer>
</>
);
Expand Down
6 changes: 3 additions & 3 deletions src/views/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { useSelector } from 'react-redux';

import Button from '~/components/Button';
import ButtonBack from '~/components/ButtonBack';
import ButtonDeleteProfile from '~/components/ButtonDeleteProfile';
import CenteredHeading from '~/components/CenteredHeading';
import DialogBurn from '~/components/DialogBurn';
import ExternalLink from '~/components/ExternalLink';
import Header from '~/components/Header';
import RemoveYourData from '~/components/RemoveYourData';
import View from '~/components/View';
import translate from '~/services/locale';

Expand Down Expand Up @@ -87,11 +87,11 @@ const Settings = () => {
{translate('Settings.headingDangerZone')}
</Typography>
<Box my={2}>
<RemoveYourData />
<ButtonDeleteProfile />
</Box>
<Box my={2}>
<Button fullWidth isDanger onClick={handleConfirmOpen}>
{translate('Settings.buttonBurnWallet')}
{translate('Settings.buttonBurnWallet')}
</Button>
</Box>
</Box>
Expand Down

0 comments on commit c96b449

Please sign in to comment.