PhishingDetected.tsx 1.45 KiB
Newer Older
Andrei Eres's avatar
Andrei Eres committed
import { useStore } from 'nanostores/react'
Andrei Eres's avatar
Andrei Eres committed
import React from 'react'
import styled from 'styled-components'
import Header from '../components/Header'
Andrei Eres's avatar
Andrei Eres committed
import { router } from '../stores/router'
import { BaseProps } from '../types'
Andrei Eres's avatar
Andrei Eres committed

Andrei Eres's avatar
Andrei Eres committed
const PhishingDetected: React.FC<BaseProps> = ({ className }) => {
  const { param: website } = useStore(router)
Andrei Eres's avatar
Andrei Eres committed
  const decodedWebsite = decodeURIComponent(website)

  return (
    <>
Andrei Eres's avatar
Andrei Eres committed
      <Header text={'Phishing detected'} />
Andrei Eres's avatar
Andrei Eres committed
      <div className={className}>
        <p>
Andrei Eres's avatar
Andrei Eres committed
          {
Andrei Eres's avatar
Andrei Eres committed
            'You have been redirected because the Polkadot{.js} extension believes that this website could compromise the security of your accounts and your tokens.'
Andrei Eres's avatar
Andrei Eres committed
          }
Andrei Eres's avatar
Andrei Eres committed
        </p>
        <p className='websiteAddress'>{decodedWebsite}</p>
        <p>
Andrei Eres's avatar
Andrei Eres committed
          Note that this website was reported on a community-driven, curated
          list. It might be incomplete or inaccurate. If you think that this
          website was flagged incorrectly,{' '}
          <a href='https://github.com/polkadot-js/phishing/issues/new'>
            please open an issue by clicking here
          </a>
          .
Andrei Eres's avatar
Andrei Eres committed
        </p>
      </div>
    </>
  )
}

export default styled(PhishingDetected)`
  p {
Andrei Eres's avatar
Andrei Eres committed
    color: ${({ theme }: BaseProps) => theme.subTextColor};
Andrei Eres's avatar
Andrei Eres committed
    margin-bottom: 1rem;
    margin-top: 0;

    a {
Andrei Eres's avatar
Andrei Eres committed
      color: ${({ theme }: BaseProps) => theme.subTextColor};
Andrei Eres's avatar
Andrei Eres committed
    }

    &.websiteAddress {
      font-size: 1.3rem;
      text-align: center;
    }
  }
`