Skip to content

Commit

Permalink
add overtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
meodai committed Dec 14, 2023
1 parent 0b16f0e commit 814bc48
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
Binary file added src/frontend/assets/icons/unwnowndapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/frontend/src/flows/dappsExplorer/dapps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export class KnownDapp {
return this.descr.oneLiner;
}

public set oneLiner(oneLiner: string | undefined) {
this.descr.oneLiner = oneLiner;
}

public get website(): string | undefined {
return this.descr.website;
}
Expand Down
10 changes: 4 additions & 6 deletions src/frontend/src/flows/dappsExplorer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ const dappsExplorerTemplate = ({

export const dappsExplorerPage = renderPage(dappsExplorerTemplate);

export const dappTemplate = ({
logoSrc,
name,
oneLiner,
oneLinerAboveTitle = false,
}: KnownDapp & { oneLinerAboveTitle?: boolean }): TemplateResult => {
export const dappTemplate = (
{ logoSrc, name, oneLiner }: KnownDapp,
oneLinerAboveTitle = false
): TemplateResult => {
return html`
<div class="c-action-list__icon" aria-hidden="true">
<img src=${logoSrc} alt=${name} loading="lazy" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"en": {
"title": "Approve information sharing",
"allow_start": "Allow verifying credential",
"label_ii_input": "Your Internet Identity",
"allow_sep_with": "with",
"cancel": "Cancel",
"allow": "Allow",
Expand Down
15 changes: 11 additions & 4 deletions src/frontend/src/flows/verifiableCredentials/allowCredentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const getOrigin = (
oneLiner: string
): KnownDapp => {
let foundDapp = dapplist.find((dapp) => dapp.hasOrigin(origin));

if (!foundDapp) {
foundDapp = new KnownDapp({
name: "Unknown Dapp",
Expand All @@ -31,6 +32,8 @@ const getOrigin = (
oneLiner: oneLiner,
});
}
console.log("one liner", oneLiner);
foundDapp.oneLiner = oneLiner;
return foundDapp;
};

Expand Down Expand Up @@ -70,12 +73,16 @@ const allowCredentialsTemplate = ({
consentMessage.send(unsafeHTML(sanitized));
})();

const originDapp = getOrigin(providerOrigin, knownDapps, `${copy.issued_by}`);
const originDapp = getOrigin(
providerOrigin,
knownDapps,
copy.issued_by as string
);

const relyingDapp = getOrigin(
relyingOrigin,
knownDapps,
`${copy.relying_party}`
copy.relying_party as string
);

const slot = html`
Expand All @@ -93,8 +100,8 @@ const allowCredentialsTemplate = ({
${anchorInput.template}
<h2 class="c-card__label l-stack">${copy.allow_start}</h2>
<ul class="c-action-list">
<li class="c-action-list__item">${dappTemplate(originDapp)}</li>
<li class="c-action-list__item">${dappTemplate(relyingDapp)}</li>
<li class="c-action-list__item">${dappTemplate(originDapp, true)}</li>
<li class="c-action-list__item">${dappTemplate(relyingDapp, true)}</li>
</ul>
<div class="c-button-group">
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2541,6 +2541,12 @@ a.c-action-list__item {
justify-content: center;
}

.c-action-list__label--inverted {
flex-direction: column-reverse;
align-items: flex-start;
justify-content: center;
}

.c-action-list__action {
cursor: pointer;
color: var(--rc-text);
Expand Down

0 comments on commit 814bc48

Please sign in to comment.