Skip to content

Commit

Permalink
Remove unnecessary top margin
Browse files Browse the repository at this point in the history
  • Loading branch information
lmuntaner committed Jul 9, 2024
1 parent 812c5c7 commit bf0d3da
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 31 deletions.
7 changes: 5 additions & 2 deletions src/frontend/src/flows/authorize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const authnTemplateAuthorize = ({
const firstTimeUnknown = (action: "pick" | "use_existing" | "first_time") => {
const altOrigin = isAltOriginOf(action);
return html`
<div class="l-stack">
<div>
${h1(copy.first_time_create)}
<p class="t-lead l-stack">${copy.first_time_unknown_subtitle}</p>
${nonNullish(altOrigin)
Expand All @@ -110,8 +110,11 @@ export const authnTemplateAuthorize = ({
// Variation: the user has used II before
const returning = (action: "pick" | "use_existing") => {
const altOrigin = isAltOriginOf(action);
// The "use_existing" screen has a different layout (mainWindow) than the "pick" screen (landingPage).
// Ideally the outer space would be handled by the parent.
const className = action === "use_existing" ? "l-stack" : undefined;
return html`
<div class="l-stack">
<div class="${className}">
${h1(html`${copy[`${action}_title_1`]}`)}
<p class="t-lead l-stack">
${copy[`${action}_subtitle`]} ${copy[`${action}_subtitle_join`]}
Expand Down
51 changes: 22 additions & 29 deletions src/frontend/src/flows/manage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,44 +55,37 @@ export const authnTemplateManage = ({
}: {
dapps: KnownDapp[];
}): AuthnTemplates => {
const wrap = ({
title,
subtitle,
showDapps = false,
}: {
title: TemplateElement;
subtitle?: string;
showDapps?: boolean;
}): TemplateResult => html`
${showDapps ? dappsHeader({ dapps, clickable: false }) : undefined}
<header class="l-stack">
<h1 class="t-title t-title--main">${title}</h1>
${nonNullish(subtitle)
? html` <p class="t-lead l-stack">${subtitle}</p>`
: undefined}
</header>
`;
const title = (title: string) =>
html`<h1 class="t-title t-title--main">${title}</h1>`;

const subtitle = (subtitle: string) =>
`<p class="t-lead l-stack">${subtitle}</p>`;

return {
firstTime: {
slot: wrap({
title: "Securely connect to dapps on the Internet Computer",
showDapps: true,
}),
slot: html`
${dappsHeader({ dapps, clickable: false })}
<header>
${title("Securely connect to dapps on the Internet Computer")}
</header>
`,
useExistingText: "Use existing",
createAnchorText: "Create Internet Identity",
},
useExisting: {
slot: wrap({
title: html`Enter Identity 🔑`,
subtitle: "to continue",
}),
slot: html`
<header class="l-stack">
${title("Enter Identity 🔑")} ${subtitle("to continue")}
</header>
`,
},

pick: {
slot: wrap({
title: html`Choose Identity 🔑`,
subtitle: "to continue",
}),
slot: html`
<header>
${title("Choose Identity 🔑")} ${subtitle("to continue")}
</header>
`,
},
};
};
Expand Down

0 comments on commit bf0d3da

Please sign in to comment.