Merge pull request #124 from ente-io/delete_account
Add delete account button on sidebar
This commit is contained in:
commit
756189cf48
|
@ -76,13 +76,14 @@ export default function Sidebar(props: Props) {
|
||||||
const win = window.open(feedbackURL, '_blank');
|
const win = window.open(feedbackURL, '_blank');
|
||||||
win.focus();
|
win.focus();
|
||||||
}
|
}
|
||||||
function openSupportMail() {
|
|
||||||
const a = document.createElement('a');
|
|
||||||
a.href = 'mailto:contact@ente.io';
|
|
||||||
|
|
||||||
|
function initiateEmail(email: string) {
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = 'mailto:' + email;
|
||||||
a.rel = 'noreferrer noopener';
|
a.rel = 'noreferrer noopener';
|
||||||
a.click();
|
a.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
function exportFiles() {
|
function exportFiles() {
|
||||||
if (isElectron()) {
|
if (isElectron()) {
|
||||||
|
@ -215,7 +216,7 @@ export default function Sidebar(props: Props) {
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
<LinkButton
|
<LinkButton
|
||||||
style={{ marginTop: '30px' }}
|
style={{ marginTop: '30px' }}
|
||||||
onClick={openSupportMail}>
|
onClick={() => initiateEmail('contact@ente.io')}>
|
||||||
{constants.SUPPORT}
|
{constants.SUPPORT}
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
<>
|
<>
|
||||||
|
@ -309,6 +310,26 @@ export default function Sidebar(props: Props) {
|
||||||
}>
|
}>
|
||||||
{constants.LOGOUT}
|
{constants.LOGOUT}
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
|
<LinkButton
|
||||||
|
variant="danger"
|
||||||
|
style={{ marginTop: '30px' }}
|
||||||
|
onClick={() =>
|
||||||
|
props.setDialogMessage({
|
||||||
|
title: `${constants.DELETE_ACCOUNT}`,
|
||||||
|
content: constants.DELETE_MESSAGE(),
|
||||||
|
staticBackdrop: true,
|
||||||
|
proceed: {
|
||||||
|
text: constants.DELETE_ACCOUNT,
|
||||||
|
action: () => {
|
||||||
|
initiateEmail('account-deletion@ente.io');
|
||||||
|
},
|
||||||
|
variant: 'danger',
|
||||||
|
},
|
||||||
|
close: { text: constants.CANCEL },
|
||||||
|
})
|
||||||
|
}>
|
||||||
|
{constants.DELETE_ACCOUNT}
|
||||||
|
</LinkButton>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
marginTop: '40px',
|
marginTop: '40px',
|
||||||
|
|
|
@ -191,6 +191,19 @@ const englishConstants = {
|
||||||
SKIP: 'skip',
|
SKIP: 'skip',
|
||||||
CANCEL: 'cancel',
|
CANCEL: 'cancel',
|
||||||
LOGOUT: 'logout',
|
LOGOUT: 'logout',
|
||||||
|
DELETE_ACCOUNT: 'delete account',
|
||||||
|
DELETE_MESSAGE: () => (
|
||||||
|
<>
|
||||||
|
<p>
|
||||||
|
please send an email to{' '}
|
||||||
|
<a href="mailto:account-deletion@ente.io">
|
||||||
|
account-deletion@ente.io
|
||||||
|
</a>{' '}
|
||||||
|
from your registered email address.{' '}
|
||||||
|
</p>
|
||||||
|
your request will be processed within 72 hours.
|
||||||
|
</>
|
||||||
|
),
|
||||||
LOGOUT_MESSAGE: 'sure you want to logout?',
|
LOGOUT_MESSAGE: 'sure you want to logout?',
|
||||||
CHANGE: 'change',
|
CHANGE: 'change',
|
||||||
CHANGE_EMAIL: 'change email?',
|
CHANGE_EMAIL: 'change email?',
|
||||||
|
|
Loading…
Reference in a new issue