Skip to content

Commit

Permalink
Fix #273 (#280)
Browse files Browse the repository at this point in the history
* sale countdown

* Fixes #273
  • Loading branch information
creed-victor authored Jan 24, 2021
1 parent 5b17e69 commit 52fe4ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 56 deletions.
4 changes: 3 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@
</div>
<script type="text/javascript">
try {
window.ethereum.autoRefreshOnNetworkChange = false;
if (window.ethereum) {
window.ethereum.autoRefreshOnNetworkChange = false;
}
} catch (e) {
console.warn(e);
}
Expand Down
53 changes: 3 additions & 50 deletions src/app/components/SaleBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import moment from 'moment';
import './SaleBanner.scss';
import samurai from './assets/banner-samurai.svg';
import { useSaleEndTime } from '../../containers/SalesPage/hooks/useSaleEndTime';
import { currentNetwork } from '../../../utils/classifiers';

const startDate =
currentNetwork === 'mainnet'
? moment('2021-01-25 17:00+00000', 'YYYY-MM-DD HH:mmZZ').utc().toDate()
: (null as any);
const startDate: Date = moment('2021-01-25 14:00+00000', 'YYYY-MM-DD HH:mmZZ')
.utc()
.toDate();

export function SaleBanner() {
const [show, setShow] = useState(true);
Expand Down Expand Up @@ -56,51 +54,6 @@ export function SaleBanner() {
return null;
}

//todo: temp only, until date is not decided
if (currentNetwork === 'mainnet') {
return (
<div className="banner-container">
<div className="banner py-3">
<div className="info-container">
<h2 className="text-uppercase title-container black-font">
<>SOV* Genesis Pre-Order</>
</h2>
<div className="sub-info-container">
<p className="sub-info-text black-font">SOV Token Pre-Order</p>
</div>
<div className="button-container">
<Link
className="button button-nav button-black button-white button-container"
to="/genesis"
>
<span className="button-text text-nowrap">Learn More</span>
</Link>
</div>
</div>
<div className="picture-container">
<img
className="banner-samurai"
src={samurai}
alt="banner-samurai"
/>
</div>
<div className="close-button-container">
<Button
minimal
color="black"
className="float-right"
onClick={() => {
closeBanner();
}}
>
<Icon icon="cross" iconSize={30} />
</Button>
</div>
</div>
</div>
);
}

return (
<div className="banner-container">
<div className="banner py-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ function detectInjectableWallet() {
return 'none';
}

if (window.ethereum.isLiquality) {
if (window.ethereum?.isLiquality) {
return 'liquality';
}

if (window.ethereum.isNiftyWallet) {
if (window.ethereum?.isNiftyWallet) {
return 'nifty';
}

if (window.ethereum.isMetaMask) {
if (window.ethereum?.isMetaMask) {
return 'metamask';
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/containers/SalesPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ import EnterCodeLanding from './EnterCodeLanding';
import { StyledButton } from '../../components/SalesButton';

function detectInjectableWallet() {
if (window.ethereum.isNiftyWallet) {
if (window.ethereum?.isNiftyWallet) {
return 'nifty';
}
if (window.ethereum.isMetaMask) {
if (window.ethereum?.isMetaMask) {
return 'metamask';
}
return 'unknown';
Expand Down

0 comments on commit 52fe4ae

Please sign in to comment.