Skip to content

Commit

Permalink
enabled blockaid modal and SDS updates (#1617)
Browse files Browse the repository at this point in the history
  • Loading branch information
piyalbasu authored Nov 5, 2024
1 parent 1fef11d commit c21090c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
13 changes: 12 additions & 1 deletion extension/src/background/helpers/dataStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ASSETS_LISTS_ID,
IS_HASH_SIGNING_ENABLED_ID,
IS_NON_SSL_ENABLED_ID,
// IS_BLOCKAID_ANNOUNCED_ID,
IS_BLOCKAID_ANNOUNCED_ID,
IS_HIDE_DUST_ENABLED_ID,
} from "constants/localStorageTypes";
import {
Expand Down Expand Up @@ -279,6 +279,17 @@ export const addHideDustIsEnabled = async () => {
}
};

export const addBlockaidAnnouncedIsEnabled = async () => {
const localStore = dataStorageAccess(browserLocalStorage);
const storageVersion = (await localStore.getItem(STORAGE_VERSION)) as string;

if (!storageVersion || semver.lt(storageVersion, "4.5.0")) {
await localStore.setItem(IS_BLOCKAID_ANNOUNCED_ID, false);

await migrateDataStorageVersion("4.5.0");
}
};

export const versionedMigration = async () => {
// sequentially call migrations in order to enforce smooth schema upgrades

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ export const BlockaidAnnouncement = () => {
<div className="BlockaidAnnouncement__modal">
<div className="BlockaidAnnouncement__modal__title">
<div>{t("Freighter is adding a new layer of protection")}</div>
<div className="BlockaidAnnouncement__modal__close">
<Icon.XClose onClick={handleCloseModal} />
</div>
</div>
<div className="BlockaidAnnouncement__modal__image">
<img src={BlockaidLogo} alt="Blockaid Logo" />
Expand Down Expand Up @@ -68,18 +65,18 @@ export const BlockaidAnnouncement = () => {
<Button
size="md"
isFullWidth
variant="secondary"
variant="tertiary"
type="button"
onClick={handleLearnMore}
icon={<Icon.Link01 />}
icon={<Icon.LinkExternal02 />}
iconPosition="right"
>
{t("Learn more")}
</Button>
<Button
data-testid="BlockaidAnnouncement__accept"
size="md"
variant="tertiary"
variant="secondary"
isFullWidth
type="button"
onClick={handleCloseModal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
justify-content: center;

&__modal {
background: var(--color-gray-10);
background: var(--sds-clr-gray-01);
border-radius: 0.5rem;
border: 1px solid var(--color-gray-40);
border: 1px solid var(--sds-clr-gray-06);
padding: 1rem;
width: 312px;
z-index: 2;
Expand All @@ -29,11 +29,11 @@
}

&__description {
color: var(--color-gray-70);
color: var(--sds-clr-gray-11);
}

&__list {
color: var(--color-gray-70);
color: var(--sds-clr-gray-11);

ul {
font-size: 0.875rem !important;
Expand All @@ -43,7 +43,7 @@

&__buttons {
display: flex;
column-gap: 1rem;
column-gap: 0.5rem;
margin-top: 1rem;
}
}
Expand Down
4 changes: 2 additions & 2 deletions extension/src/popup/views/Account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { AccountOptionsDropdown } from "popup/components/account/AccountOptionsD
import { AssetDetail } from "popup/components/account/AssetDetail";
import { Loading } from "popup/components/Loading";
import { NotFundedMessage } from "popup/components/account/NotFundedMessage";
// import { BlockaidAnnouncement } from "popup/components/account/BlockaidAnnouncement";
import { BlockaidAnnouncement } from "popup/components/account/BlockaidAnnouncement";

import "popup/metrics/authServices";

Expand Down Expand Up @@ -179,7 +179,7 @@ export const Account = () => {
publicKey={publicKey}
setLoading={setLoading}
/>
{/* <BlockaidAnnouncement /> */}
<BlockaidAnnouncement />
<View.Content hasNoTopPadding>
<div className="AccountView" data-testid="account-view">
<div className="AccountView__account-actions">
Expand Down

0 comments on commit c21090c

Please sign in to comment.