Skip to content

Commit

Permalink
Merge pull request #60 from AstraProtocol/feat/add-phising-banner
Browse files Browse the repository at this point in the history
feat: add phising banner
  • Loading branch information
Tien Dao committed Jul 26, 2023
2 parents 26837af + 57b21ed commit 684af77
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
Binary file added public/images/ic_secure.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: 3 additions & 1 deletion public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1606,5 +1606,7 @@
"Infinity": "Infinity",
"Your approve current is not enough": "Your approve current is not enough",
"Error importing list": "Error importing list",
"Enter valid list location": "Enter valid list location"
"Enter valid list location": "Enter valid list location",
"Phishing warning: Please make sure you’re visiting": "Phishing warning: Please make sure you’re visiting",
"Check the URL carefully": "Check the URL carefully"
}
4 changes: 3 additions & 1 deletion public/locales/vi-VN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1606,5 +1606,7 @@
"Infinity": "Vô tận",
"Your approve current is not enough": "Hiện tại phê duyệt của bạn không đủ",
"Error importing list": "Lỗi khi nhập danh sách",
"Enter valid list location": "Nhập địa chỉ danh sách không hợp lệ"
"Enter valid list location": "Nhập địa chỉ danh sách không hợp lệ",
"Phishing warning: Please make sure you’re visiting": "Cảnh báo lừa đảo: Vui lòng đảm bảo bạn đang truy cập",
"Check the URL carefully": "Hãy kiểm tra URL cẩn thận"
}
5 changes: 3 additions & 2 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { VI, EN } from '../../config/localization/languages'
import useAuth from 'hooks/useAuth'
import { Modal, useModal } from 'components/Modal'
import NavigationConnect from 'components/ButtonConnect/NavigationConnect'
import PhisingBanner from 'components/PhisingBanner'

export default function Navbar() {
const [shadow, setShadow] = useState(false)
Expand All @@ -31,7 +32,6 @@ export default function Navbar() {

const { t, setLanguage, currentLanguage } = useTranslation()


const _hideMenu = () => {
// setLoad(false)
//time for animation
Expand Down Expand Up @@ -172,6 +172,7 @@ export default function Navbar() {

return (
<>
<PhisingBanner />
<nav
className={clsx(styles.navbar, 'margin-bottom-sm', {
[styles.navShadow]: shadow,
Expand All @@ -188,7 +189,7 @@ export default function Navbar() {
</div>
</div>
<div className={clsx(styles.left, 'link')}>
<Logo type="swap" size='small' text={process.env.NEXT_PUBLIC_TITLE} />
<Logo type="swap" size="small" text={process.env.NEXT_PUBLIC_TITLE} />
</div>
<div className={styles.right}>
<Navigation items={menus} />
Expand Down
34 changes: 34 additions & 0 deletions src/components/PhisingBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useMobileLayout } from '@astraprotocol/astra-ui'
import { useTranslation } from 'contexts/Localization'
import Image from 'next/image'

const PhisingBanner = () => {
const { isMobile } = useMobileLayout('small')
const { t } = useTranslation()
const URL = process.env.NEXT_PUBLIC_HOST

if (isMobile) return null

return (
<div
className="banner flex flex-justify-center flex-align-center padding-top-md padding-bottom-md"
style={{ backgroundColor: '#1C2742', gap: 10 }}
>
<Image src="/images/ic_secure.png" width={isMobile ? 84 : 44} height={isMobile ? 80 : 40} alt="icon" />
<div style={{ lineHeight: 1.2 }}>
<span style={{ color: '#FFA549' }}>{t('Phishing warning: Please make sure you’re visiting')}</span>
<a
href={URL}
target="_blank"
rel="noreferrer"
className="margin-left-xs margin-right-xs contrast-color-100"
>
{URL}
</a>
<span style={{ color: '#FFA549' }}>- {t('Check the URL carefully')}.</span>
</div>
</div>
)
}

export default PhisingBanner
4 changes: 3 additions & 1 deletion src/config/localization/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1606,5 +1606,7 @@
"Infinity": "Vô tận",
"Your approve current is not enough": "Hiện tại phê duyệt của bạn không đủ",
"Error importing list": "Lỗi khi nhập danh sách",
"Enter valid list location": "Nhập địa chỉ danh sách không hợp lệ"
"Enter valid list location": "Nhập địa chỉ danh sách không hợp lệ",
"Phishing warning: Please make sure you’re visiting": "Cảnh báo lừa đảo: Vui lòng đảm bảo bạn đang truy cập",
"Check the URL carefully": "Hãy kiểm tra URL cẩn thận"
}

0 comments on commit 684af77

Please sign in to comment.