Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable button on limit of authenticators #2868

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/frontend/src/flows/manage/authenticatorsSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const authenticatorsSection = ({
)}</ul>
<div class="c-action-list__actions">
<button
?disabled=${authenticators.length >= MAX_AUTHENTICATORS}
.disabled=${authenticators.length >= MAX_AUTHENTICATORS}
class="c-button c-button--primary c-tooltip c-tooltip--onDisabled c-tooltip--left"
@click="${() => onAddDevice()}"
id="addAdditionalDevice"
Expand Down
116 changes: 116 additions & 0 deletions src/showcase/src/pages/displayManageMaxDevices.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
import Screen from "../layouts/Screen.astro";
---

<Screen title="Display Manage" pageName="displayManage">
<script>
import { toast } from "$src/components/toast";
import { userNumber } from "../constants";
import { dapps } from "../constants";
import { displayManagePage } from "$src/flows/manage";
import { html } from "lit-html";
import identityCardBackground from "$src/assets/identityCardBackground.png";
import { PreLoadImage } from "$src/utils/preLoadImage";

const identityBackground = new PreLoadImage(identityCardBackground.src);

displayManagePage({
identityBackground,
userNumber,
devices: {
authenticators: [
{
alias: "Chrome on iPhone",
remove: () => toast.info("remove"),
rename: () => toast.info("rename"),
last_usage: [BigInt(Date.now() * 1000000)],
},
{
alias: "Yubikey Blue",
remove: () => toast.info("remove"),
rename: () => toast.info("rename"),
last_usage: [
BigInt(Date.now() * 1000000 - 1_000_000_000 * 60 * 60 * 24 * 7),
],
},
{
alias: "Yubikey Blue",
remove: () => toast.info("remove"),
rename: () => toast.info("rename"),
last_usage: [
BigInt(Date.now() * 1000000 - 1_000_000_000 * 60 * 60 * 24 * 30),
],
},
{
alias: "Yubikey Blue",
remove: () => toast.info("remove"),
rename: () => toast.info("rename"),
last_usage: [
BigInt(Date.now() * 1000000 - 1_000_000_000 * 60 * 60 * 24 * 30),
],
},
{
alias: "Yubikey Blue",
remove: () => toast.info("remove"),
rename: () => toast.info("rename"),
last_usage: [
BigInt(Date.now() * 1000000 - 1_000_000_000 * 60 * 60 * 24 * 30),
],
},
{
alias: "Yubikey Blue",
remove: () => toast.info("remove"),
rename: () => toast.info("rename"),
last_usage: [
BigInt(Date.now() * 1000000 - 1_000_000_000 * 60 * 60 * 24 * 30),
],
},
{
alias: "Yubikey Blue",
remove: () => toast.info("remove"),
rename: () => toast.info("rename"),
last_usage: [
BigInt(Date.now() * 1000000 - 1_000_000_000 * 60 * 60 * 24 * 30),
],
},
{
alias: "Yubikey Blue",
remove: () => toast.info("remove"),
rename: () => toast.info("rename"),
last_usage: [
BigInt(Date.now() * 1000000 - 1_000_000_000 * 60 * 60 * 24 * 30),
],
},
],
recoveries: {
recoveryPhrase: {
isProtected: true,
unprotect: () => toast.info("unprotect"),
reset: () => toast.info("reset"),
},
},
pinAuthenticators: [],
},
onAddDevice: () => {
toast.info("add device requested");
},
addRecoveryPhrase: () => {
toast.info("add recovery phrase");
},
addRecoveryKey: () => {
toast.info("add recovery key");
},
credentials: [],
onLinkAccount: () => {
toast.info("link account");
},
onUnlinkAccount: () => {
toast.info("unlink account");
},
dapps,
exploreDapps: () => {
toast.info("explore dapps");
},
});
</script>
</Screen>
Loading