0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(demo-app): improve sign-out button in demo-app

This commit is contained in:
Charles Zhao 2022-10-11 15:23:10 +08:00
parent b9bb78521d
commit 3a9d95ed3e
No known key found for this signature in database
GPG key ID: 4858774754C92DF2
2 changed files with 9 additions and 1 deletions

View file

@ -75,6 +75,10 @@
cursor: pointer;
background: var(--color-hover);
}
&:focus {
outline: 3px solid var(--color-focused-variant);
}
}
.continue {

View file

@ -81,7 +81,11 @@ const Main = () => {
tabIndex={0}
className={styles.button}
onClick={async () => signOut(`${window.location.origin}/demo-app`)}
onKeyDown={async () => signOut(`${window.location.origin}/demo-app`)}
onKeyDown={({ key }) => {
if (key === 'Enter' || key === ' ') {
void signOut(`${window.location.origin}/demo-app`);
}
}}
>
{t('sign_out')}
</div>