2022-12-17 14:45:50 +00:00
|
|
|
import * as amplitude from "@amplitude/analytics-browser";
|
|
|
|
|
2022-12-06 14:53:31 +00:00
|
|
|
// NextJs
|
2022-12-06 10:41:38 +00:00
|
|
|
import Image from "next/image";
|
2022-11-30 08:11:45 +00:00
|
|
|
|
2022-12-06 10:41:38 +00:00
|
|
|
// Styles
|
2022-12-16 09:14:47 +00:00
|
|
|
import styled from "styled-components";
|
2022-12-06 10:41:38 +00:00
|
|
|
import color from "../styles/color";
|
|
|
|
|
|
|
|
// Components
|
|
|
|
import { PrimaryButton } from "../components/primary-button";
|
2022-12-12 08:46:50 +00:00
|
|
|
import { ConnectWalletModal } from "../components/connect-wallet-modal";
|
2022-11-30 13:49:09 +00:00
|
|
|
|
2022-12-06 10:41:38 +00:00
|
|
|
// Image Assets
|
|
|
|
import MainTitle from "../public/images/svg/main-title.svg";
|
|
|
|
import MainLogo from "../public/images/svg/main-logo.svg";
|
|
|
|
import CheckIcon from "../public/images/svg/check-icon.svg";
|
2022-12-17 09:10:53 +00:00
|
|
|
import StarIcon from "../public/images/svg/bg-asset-3.svg";
|
2022-12-06 14:53:31 +00:00
|
|
|
import { Logo } from "../components/logo";
|
2022-12-12 13:45:24 +00:00
|
|
|
import { useEffect, useState } from "react";
|
2022-12-16 16:57:10 +00:00
|
|
|
import { MINIMUM_OSMO_FEE, SELECTED_WALLET_KEY } from "../constants/wallet";
|
2022-12-15 15:43:18 +00:00
|
|
|
import { replaceToInstallPage } from "../utils/url";
|
|
|
|
import { REFERRAL_KEY } from "../constants/icns";
|
2022-11-30 13:49:09 +00:00
|
|
|
|
2022-11-30 08:11:45 +00:00
|
|
|
export default function Home() {
|
2022-12-12 06:51:25 +00:00
|
|
|
const [isModalOpen, setModalOpen] = useState(false);
|
2022-11-30 13:49:09 +00:00
|
|
|
|
2022-12-12 06:51:25 +00:00
|
|
|
const onClickConnectWalletButton = async () => {
|
2022-12-17 14:45:50 +00:00
|
|
|
amplitude.track("click connect wallet button");
|
|
|
|
|
2022-12-12 06:51:25 +00:00
|
|
|
setModalOpen(true);
|
2022-11-30 13:49:09 +00:00
|
|
|
};
|
|
|
|
|
2022-12-12 13:45:24 +00:00
|
|
|
useEffect(() => {
|
2022-12-15 15:43:18 +00:00
|
|
|
localStorage.removeItem(REFERRAL_KEY);
|
|
|
|
|
|
|
|
if (window.location.search) {
|
|
|
|
const [, referral] =
|
|
|
|
window.location.search.match(/^(?=.*referral=([^&]+)|).+$/) || [];
|
|
|
|
|
|
|
|
if (referral) {
|
|
|
|
localStorage.setItem(REFERRAL_KEY, referral);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-12 13:45:24 +00:00
|
|
|
localStorage.removeItem(SELECTED_WALLET_KEY);
|
|
|
|
}, []);
|
|
|
|
|
2022-11-30 08:11:45 +00:00
|
|
|
return (
|
2022-12-16 09:14:47 +00:00
|
|
|
<Container>
|
|
|
|
<Logo />
|
|
|
|
|
|
|
|
<MainContainer>
|
|
|
|
<MainTitleContainer>
|
|
|
|
<MainTitleImageBackground>
|
2022-12-17 09:10:53 +00:00
|
|
|
<Image
|
|
|
|
src={StarIcon}
|
|
|
|
width={50}
|
|
|
|
height={50}
|
|
|
|
alt="Star Icon"
|
|
|
|
className="starIcon first"
|
|
|
|
/>
|
|
|
|
<Image
|
|
|
|
src={StarIcon}
|
|
|
|
width={50}
|
|
|
|
height={50}
|
|
|
|
alt="Star Icon"
|
|
|
|
className="starIcon last"
|
|
|
|
/>
|
2022-12-16 09:14:47 +00:00
|
|
|
<MainTitleImageContainer>
|
|
|
|
<Image
|
|
|
|
src={MainTitle}
|
|
|
|
fill={true}
|
|
|
|
sizes="60rem"
|
|
|
|
alt="Main Title"
|
|
|
|
priority
|
|
|
|
/>
|
|
|
|
</MainTitleImageContainer>
|
|
|
|
</MainTitleImageBackground>
|
|
|
|
|
|
|
|
<ConnectButtonContainer>
|
|
|
|
<PrimaryButton onClick={onClickConnectWalletButton}>
|
|
|
|
Connect Wallet
|
|
|
|
</PrimaryButton>
|
|
|
|
</ConnectButtonContainer>
|
|
|
|
<SubContainer>
|
|
|
|
<CheckContainer>
|
|
|
|
<CheckIconContainer>
|
|
|
|
<Image
|
|
|
|
src={CheckIcon}
|
|
|
|
fill={true}
|
|
|
|
sizes="1.6rem"
|
|
|
|
alt="Check Icon"
|
|
|
|
/>
|
|
|
|
</CheckIconContainer>
|
|
|
|
You are a <CheckBoldText> keplr </CheckBoldText> user.
|
|
|
|
if not, you can install
|
|
|
|
<InstallLInk onClick={replaceToInstallPage}>HERE</InstallLInk>
|
|
|
|
</CheckContainer>
|
|
|
|
<CheckContainer>
|
|
|
|
<CheckIconContainer>
|
|
|
|
<Image
|
|
|
|
src={CheckIcon}
|
|
|
|
fill={true}
|
|
|
|
sizes="1.6rem"
|
|
|
|
alt="Check Icon"
|
|
|
|
/>
|
|
|
|
</CheckIconContainer>
|
2022-12-16 16:57:10 +00:00
|
|
|
<CheckBoldText>{MINIMUM_OSMO_FEE} </CheckBoldText> is
|
|
|
|
required for this transaction
|
2022-12-16 09:14:47 +00:00
|
|
|
</CheckContainer>
|
|
|
|
</SubContainer>
|
|
|
|
</MainTitleContainer>
|
|
|
|
|
|
|
|
<MainLogoContainer>
|
|
|
|
<Image src={MainLogo} fill={true} sizes="25rem" alt="Main Logo" />
|
|
|
|
</MainLogoContainer>
|
|
|
|
</MainContainer>
|
|
|
|
|
|
|
|
<ConnectWalletModal
|
|
|
|
isModalOpen={isModalOpen}
|
|
|
|
onCloseModal={() => setModalOpen(false)}
|
|
|
|
/>
|
|
|
|
</Container>
|
2022-11-30 09:58:19 +00:00
|
|
|
);
|
2022-11-30 08:11:45 +00:00
|
|
|
}
|
2022-12-06 10:41:38 +00:00
|
|
|
|
|
|
|
const Container = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
2022-12-17 09:10:53 +00:00
|
|
|
|
|
|
|
background-image: url("/images/svg/bg-asset-1.svg"),
|
|
|
|
url("/images/svg/bg-asset-2.svg"), url("/images/svg/bg-asset-2.svg"),
|
|
|
|
url("/images/svg/bg-asset-3.svg"), url("/images/svg/bg-asset-3.svg");
|
|
|
|
background-size: 5rem 5rem, 5rem 5rem, 5rem 5rem, 3.125rem 3.125rem,
|
|
|
|
3.125rem 3.125rem;
|
|
|
|
background-position: 80px 640px, 960px 80px, 1200px 720px, 136px 776px,
|
|
|
|
1016px 696px;
|
|
|
|
background-repeat: no-repeat;
|
2022-12-06 10:41:38 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
const MainContainer = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
|
|
margin-top: 15rem;
|
|
|
|
margin-left: 10rem;
|
2022-12-17 09:10:53 +00:00
|
|
|
|
|
|
|
img.starIcon {
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
&.first {
|
|
|
|
left: -24px;
|
|
|
|
top: -24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.last {
|
|
|
|
right: -23px;
|
|
|
|
top: -24px;
|
|
|
|
}
|
|
|
|
}
|
2022-12-06 10:41:38 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
const MainTitleContainer = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
padding: 0.1rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const MainTitleImageBackground = styled.div`
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
width: 70rem;
|
|
|
|
height: 19.9rem;
|
|
|
|
|
|
|
|
background-color: ${color.black};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const MainTitleImageContainer = styled.div`
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
2022-12-06 14:53:31 +00:00
|
|
|
width: 60rem;
|
2022-12-06 10:41:38 +00:00
|
|
|
height: 19.9rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const MainLogoContainer = styled.div`
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
right: 2.5rem;
|
|
|
|
|
|
|
|
min-width: 25rem;
|
|
|
|
height: 25rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ConnectButtonContainer = styled.div`
|
|
|
|
width: 19.9rem;
|
|
|
|
height: 5rem;
|
|
|
|
|
|
|
|
margin-left: 5rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const SubContainer = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
|
|
width: 29.9rem;
|
|
|
|
height: 4.9rem;
|
|
|
|
|
|
|
|
margin-top: 5.1rem;
|
|
|
|
margin-left: 5rem;
|
|
|
|
|
|
|
|
background-color: ${color.black};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const CheckContainer = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
font-family: "Inter", serif;
|
|
|
|
font-style: normal;
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: 0.8rem;
|
|
|
|
line-height: 16px;
|
|
|
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
2022-12-15 15:43:18 +00:00
|
|
|
padding-left: 0.75rem;
|
|
|
|
|
|
|
|
color: ${color.grey["400"]};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const InstallLInk = styled.a`
|
|
|
|
color: ${color.grey["400"]};
|
|
|
|
text-decoration: underline;
|
|
|
|
|
|
|
|
cursor: pointer;
|
2022-12-06 10:41:38 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
const CheckBoldText = styled.span`
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
|
|
|
color: ${color.grey["100"]};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const CheckIconContainer = styled.div`
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
width: 1.6rem;
|
|
|
|
height: 1.5rem;
|
|
|
|
`;
|