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

feat(ui): Use real credential miniature icons #872

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
Binary file removed src/ui/assets/images/minicred.jpg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ ion-modal.archived-credentials-modal {
flex-direction: row;

img.credential-miniature {
height: 2.75rem;
width: 4rem;
height: 2.5rem;
border-radius: 0.25rem;
}

Expand Down Expand Up @@ -188,8 +187,7 @@ ion-modal.archived-credentials-modal {
}

img.credential-miniature {
height: 2.2rem;
width: 3.2rem;
height: 2rem;
}
}
}
Expand Down
11 changes: 5 additions & 6 deletions src/ui/components/ArchivedCredentials/CredentialItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import {
IonItemSliding,
IonLabel,
} from "@ionic/react";
import { CredentialStatus } from "../../../core/agent/services/credentialService.types";
import { IpexCommunicationService } from "../../../core/agent/services/ipexCommunicationService";
import { i18n } from "../../../i18n";
import "./ArchivedCredentials.scss";
import { CREDENTIAL_BG } from "../../globals/types";
import { formatShortDate } from "../../utils/formatters";
import "./ArchivedCredentials.scss";
import { CredentialItemProps } from "./ArchivedCredentials.types";
import Minicred from "../../assets/images/minicred.jpg";
import RareEvoBackground from "../../assets/images/rare-evo-bg.jpg";
import { CredentialStatus } from "../../../core/agent/services/credentialService.types";
import { IpexCommunicationService } from "../../../core/agent/services/ipexCommunicationService";

const CredentialItem = ({
credential,
Expand All @@ -28,7 +27,7 @@ const CredentialItem = ({
const isRareEvo =
credential.schema === IpexCommunicationService.SCHEMA_SAID_RARE_EVO_DEMO;

const image = isRareEvo ? RareEvoBackground : Minicred;
const image = isRareEvo ? CREDENTIAL_BG.RARE : CREDENTIAL_BG.KERI;

return (
<IonItemSliding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,23 @@
}

&.green {
background: linear-gradient(
90.04deg,
#667745 28.46%,
#879e54 78.5%,
#a8c55f 123.53%,
#b9cf7c 165.71%
);
background: var(--ion-color-secondary-gradient-green);
}

&.dark {
background: linear-gradient(91.22deg, #222222 -5.14%, #697949 165.6%);
background: var(--ion-color-gradient-dark);
}

&.brown {
background: linear-gradient(90.04deg, #986c32 28.46%, #4c371a 165.71%);
background: var(--ion-color-gradient-brown);
}

&.primary {
background: linear-gradient(91.86deg, #92ffc0 28.76%, #00a5e6 119.14%);
background: var(--ion-color-primary-gradient);
}

&.secondary {
background: linear-gradient(91.86deg, #363c4a 28.76%, #030321 119.14%);
background: var(--ion-color-secondary-gradient);
}
}
}
4 changes: 2 additions & 2 deletions src/ui/pages/ConnectionDetails/ConnectionDetails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
&.credential-miniature {
height: 1.56rem;
width: 2.75rem;
border-radius: 0.125rem;
border-radius: 0.2rem;
}
}

Expand Down Expand Up @@ -133,7 +133,7 @@
&.credential-miniature {
height: 1.248rem;
width: 2.2rem;
border-radius: 0.125rem;
border-radius: 0.2rem;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import i18next from "i18next";
import Minicred from "../../../assets/images/minicred.jpg";
import KeriLogo from "../../../assets/images/KeriGeneric.jpg";
import { formatShortDate, formatTimeToSec } from "../../../utils/formatters";
import {
ConnectionDetails,
ConnectionHistoryItem,
} from "../../../../core/agent/agent.types";
import { i18n } from "../../../../i18n";
import { ConnectionHistoryType } from "../../../../core/agent/services/connectionService.types";
import { i18n } from "../../../../i18n";
import KeriLogo from "../../../assets/images/KeriGeneric.jpg";
import { CREDENTIAL_BG } from "../../../globals/types";
import { formatShortDate, formatTimeToSec } from "../../../utils/formatters";

const ConnectionHistoryEvent = ({
index,
Expand All @@ -18,6 +18,11 @@ const ConnectionHistoryEvent = ({
historyItem?: ConnectionHistoryItem;
connectionDetails?: ConnectionDetails;
}) => {

const isRareEvo = historyItem?.credentialType === "Rare EVO 2024 Attendee";

const image = isRareEvo ? CREDENTIAL_BG.RARE : CREDENTIAL_BG.KERI;

return historyItem ? (
<div
className="connection-details-history-event"
Expand All @@ -33,7 +38,7 @@ const ConnectionHistoryEvent = ({
/>
) : (
<img
src={Minicred}
src={image}
alt="credential-miniature"
className="credential-miniature"
/>
Expand Down
12 changes: 12 additions & 0 deletions src/ui/styles/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
#92ffc0 28.76%,
#47ff94 119.14%
);

--ion-color-secondary-gradient-green: linear-gradient(
90.04deg,
#667745 28.46%,
#879e54 78.5%,
#a8c55f 123.53%,
#b9cf7c 165.71%
);

--ion-color-gradient-dark: linear-gradient(91.22deg, #222222 -5.14%, #697949 165.6%);
--ion-color-gradient-brown: linear-gradient(90.04deg, #986c32 28.46%, #4c371a 165.71%);
--ion-color-secondary-gradient: linear-gradient(91.86deg, #363c4a 28.76%, #030321 119.14%);
}

.ion-color-dark-grey {
Expand Down
Loading