-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Blockaid announcement modal (#1465)
* add Blockaid announcement modal * removing console.log * add blockAnnounced data migration * rm unused prop * fix translations
- Loading branch information
Showing
18 changed files
with
287 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
extension/src/popup/components/account/BlockaidAnnouncement/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import React from "react"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
import { useTranslation } from "react-i18next"; | ||
import { Button, Icon, Paragraph } from "@stellar/design-system"; | ||
|
||
import { AppDispatch } from "popup/App"; | ||
|
||
import { LoadingBackground } from "popup/basics/LoadingBackground"; | ||
import { | ||
settingsSelector, | ||
saveIsBlockaidAnnounced, | ||
} from "popup/ducks/settings"; | ||
import { openTab } from "popup/helpers/navigate"; | ||
|
||
import BlockaidLogo from "popup/assets/blockaid-logo.svg"; | ||
|
||
import "./styles.scss"; | ||
|
||
export const BlockaidAnnouncement = () => { | ||
const { t } = useTranslation(); | ||
const dispatch: AppDispatch = useDispatch(); | ||
const { isBlockaidAnnounced } = useSelector(settingsSelector); | ||
|
||
const handleLearnMore = () => { | ||
openTab("https://blockaid.io"); | ||
}; | ||
|
||
const handleCloseModal = () => { | ||
dispatch(saveIsBlockaidAnnounced({ isBlockaidAnnounced: true })); | ||
}; | ||
|
||
return isBlockaidAnnounced ? null : ( | ||
<> | ||
<LoadingBackground isActive /> | ||
<div className="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.Close onClick={handleCloseModal} /> | ||
</div> | ||
</div> | ||
<div className="BlockaidAnnouncement__modal__image"> | ||
<img src={BlockaidLogo} alt="Blockaid Logo" /> | ||
</div> | ||
<div className="BlockaidAnnouncement__modal__description"> | ||
<Paragraph size="sm"> | ||
{t("Freighter now uses Blockaid to keep your accounts safer.")} | ||
</Paragraph> | ||
<Paragraph size="sm">{t("By default it will verify")}:</Paragraph> | ||
</div> | ||
<div className="BlockaidAnnouncement__modal__list"> | ||
<ul> | ||
<li>{t("The domains you interact with")}</li> | ||
<li>{t("The assets you interact with")}</li> | ||
<li>{t("The accounts you interact with")}</li> | ||
<li> | ||
{t( | ||
"The operations and functions executed in transactions and smart contracts", | ||
)} | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div className="BlockaidAnnouncement__modal__buttons"> | ||
<Button | ||
size="md" | ||
isFullWidth | ||
variant="secondary" | ||
type="button" | ||
onClick={handleLearnMore} | ||
icon={<Icon.ExternalLink />} | ||
iconPosition="right" | ||
> | ||
{t("Learn more")} | ||
</Button> | ||
<Button | ||
data-testid="BlockaidAnnouncement__accept" | ||
size="md" | ||
variant="primary" | ||
isFullWidth | ||
type="button" | ||
onClick={handleCloseModal} | ||
> | ||
{t("Got it")} | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; |
50 changes: 50 additions & 0 deletions
50
extension/src/popup/components/account/BlockaidAnnouncement/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.BlockaidAnnouncement { | ||
height: 100%; | ||
width: 100%; | ||
position: absolute; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
&__modal { | ||
background: var(--color-gray-10); | ||
border-radius: 0.5rem; | ||
border: 1px solid var(--color-gray-40); | ||
padding: 1rem; | ||
width: 312px; | ||
z-index: 2; | ||
|
||
&__title { | ||
display: flex; | ||
line-height: 1.5rem; | ||
margin-bottom: 1.5rem; | ||
} | ||
|
||
&__close { | ||
cursor: pointer; | ||
} | ||
|
||
&__image { | ||
margin-bottom: 0.5rem; | ||
} | ||
|
||
&__description { | ||
color: var(--color-gray-70); | ||
} | ||
|
||
&__list { | ||
color: var(--color-gray-70); | ||
|
||
ul { | ||
font-size: 0.875rem !important; | ||
margin-left: 1rem !important; | ||
} | ||
} | ||
|
||
&__buttons { | ||
display: flex; | ||
column-gap: 1rem; | ||
margin-top: 1rem; | ||
} | ||
} | ||
} |
Oops, something went wrong.