parent
8a94609fb9
commit
d1aa0983b6
6 changed files with 979 additions and 1002 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,16 @@ |
|||||||
|
--- |
||||||
|
import DeleteAccountPopup from "./DeleteAccountPopup.astro"; |
||||||
|
--- |
||||||
|
<DeleteAccountPopup /> |
||||||
|
|
||||||
|
<h2 class='text-xl font-bold sm:text-2xl'>Delete Account</h2> |
||||||
|
<p class='mt-2 text-gray-400'> |
||||||
|
Permanently remove your account from the roadmap.sh. This cannot be undone and all your progress and data will be lost. |
||||||
|
</p> |
||||||
|
|
||||||
|
<button |
||||||
|
data-popup='delete-account-popup' |
||||||
|
class="mt-4 w-full rounded-lg bg-red-600 py-2 text-base font-regular text-white outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-1" |
||||||
|
> |
||||||
|
Delete Account |
||||||
|
</button> |
@ -1,54 +0,0 @@ |
|||||||
export function showDeleteAccountPopup() { |
|
||||||
const popupEl = document.querySelector(`#delete-account-popup`); |
|
||||||
if (!popupEl) { |
|
||||||
return; |
|
||||||
} |
|
||||||
|
|
||||||
popupEl.classList.remove('hidden'); |
|
||||||
popupEl.classList.add('flex'); |
|
||||||
|
|
||||||
const focusEl = popupEl.querySelector<HTMLElement>('[autofocus]'); |
|
||||||
if (focusEl) { |
|
||||||
focusEl.focus(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
export function hideDeleteAccountPopup() { |
|
||||||
const popupEl = document.querySelector(`#delete-account-popup`); |
|
||||||
if (!popupEl) { |
|
||||||
return; |
|
||||||
} |
|
||||||
|
|
||||||
popupEl.classList.remove('flex'); |
|
||||||
popupEl.classList.add('hidden'); |
|
||||||
|
|
||||||
const focusEl = popupEl.querySelector<HTMLElement>('[autofocus]'); |
|
||||||
if (focusEl) { |
|
||||||
focusEl.blur(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
export function DeleteAccount() { |
|
||||||
return ( |
|
||||||
<div> |
|
||||||
<div> |
|
||||||
<h2 className="text-xl font-bold sm:text-2xl"> |
|
||||||
Delete Account |
|
||||||
</h2> |
|
||||||
<p className="mt-2 text-gray-400"> |
|
||||||
Permanently remove your account from the roadmap.sh. This action is |
|
||||||
not reversible, so please continue with caution. |
|
||||||
</p> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div className="mt-4"> |
|
||||||
<button |
|
||||||
className="inline-flex h-10 items-center justify-center rounded-md bg-red-500 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-red-500/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-200 disabled:pointer-events-none disabled:opacity-50" |
|
||||||
onClick={showDeleteAccountPopup} |
|
||||||
> |
|
||||||
Delete Account |
|
||||||
</button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
); |
|
||||||
} |
|
Loading…
Reference in new issue