mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-11 04:56:40 +00:00
delete account set profile to inactive
This commit is contained in:
parent
da07929ed3
commit
de6790168c
2 changed files with 9 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ export interface DevSummary {
|
||||||
* @extends DevSummary to avoid duplication
|
* @extends DevSummary to avoid duplication
|
||||||
*/
|
*/
|
||||||
interface Dev extends DevSummary {
|
interface Dev extends DevSummary {
|
||||||
|
isActive: boolean;
|
||||||
bio: string;
|
bio: string;
|
||||||
status: string;
|
status: string;
|
||||||
company: string;
|
company: string;
|
||||||
|
|
@ -33,6 +34,7 @@ export const getDescription = (status: string, company: string) =>
|
||||||
/** blank Dev serve as placeholder when initializing a new profile */
|
/** blank Dev serve as placeholder when initializing a new profile */
|
||||||
export const blankDev: Dev = {
|
export const blankDev: Dev = {
|
||||||
id: '42',
|
id: '42',
|
||||||
|
isActive: true,
|
||||||
displayName: '',
|
displayName: '',
|
||||||
status: 'Developer',
|
status: 'Developer',
|
||||||
company: '',
|
company: '',
|
||||||
|
|
@ -60,6 +62,7 @@ export const blankDev: Dev = {
|
||||||
*/
|
*/
|
||||||
export const dummyDev: Dev = {
|
export const dummyDev: Dev = {
|
||||||
id: '0',
|
id: '0',
|
||||||
|
isActive: true,
|
||||||
displayName: 'John Doe',
|
displayName: 'John Doe',
|
||||||
status: 'Developer',
|
status: 'Developer',
|
||||||
company: 'Microsoft',
|
company: 'Microsoft',
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,11 @@ const Dashboard: FC<IProps> = ({
|
||||||
experiences,
|
experiences,
|
||||||
educations,
|
educations,
|
||||||
}) => {
|
}) => {
|
||||||
const logout = () => firebase.logout();
|
/** turns account to inactive then logs user out */
|
||||||
|
const deleteAccount = () => {
|
||||||
|
firebase.updateProfile({isActive: false}, {useSet: true, merge: true});
|
||||||
|
firebase.logout();
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -131,7 +135,7 @@ const Dashboard: FC<IProps> = ({
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="my-2">
|
<div className="my-2">
|
||||||
<button className="btn btn-danger" onClick={logout}>
|
<button className="btn btn-danger" onClick={deleteAccount}>
|
||||||
<FontAwesomeIcon icon={faUserSlash} /> Delete my Account
|
<FontAwesomeIcon icon={faUserSlash} /> Delete my Account
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue