Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullcount player integration #154

Merged
merged 67 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
1444a0a
new Fullcount address
Anton-Mushnin Feb 8, 2024
2b90d04
animated tridots
Anton-Mushnin Feb 8, 2024
26d6082
first two blocks
Anton-Mushnin Feb 9, 2024
2e61444
second two blocks
Anton-Mushnin Feb 9, 2024
4aa235a
logos
Anton-Mushnin Feb 9, 2024
1324ae4
footer
Anton-Mushnin Feb 9, 2024
fcf3e5f
mobile layout finished
Anton-Mushnin Feb 9, 2024
c6d47c6
typo, layout
Anton-Mushnin Feb 9, 2024
8cbd84b
layout
Anton-Mushnin Feb 9, 2024
b96b7f4
Merge pull request #146 from moonstream-to/landing
Anton-Mushnin Feb 9, 2024
c7c29fd
768View
Anton-Mushnin Feb 11, 2024
4b5390f
Hero 1024
Anton-Mushnin Feb 11, 2024
e03cd5c
1024 View
Anton-Mushnin Feb 11, 2024
705141c
layout
Anton-Mushnin Feb 12, 2024
98e32ec
check
Anton-Mushnin Feb 12, 2024
3b50698
Merge branch 'landing' into alpha
Anton-Mushnin Feb 12, 2024
bf81d58
fixing invisible ball
Anton-Mushnin Feb 13, 2024
0455e8e
removing twitter
Anton-Mushnin Feb 13, 2024
387857f
buttons hover style
Anton-Mushnin Feb 13, 2024
81c209b
Merge branch 'landing' into alpha
Anton-Mushnin Feb 13, 2024
300acf6
displaying takes, new heatMap
Anton-Mushnin Feb 13, 2024
f05fcfa
align
Anton-Mushnin Feb 13, 2024
02fbbcf
smartcontracts types
Anton-Mushnin Feb 14, 2024
2a7d548
fetch tokens and startSession
Anton-Mushnin Feb 14, 2024
65da1f3
join, commit, reveal
Anton-Mushnin Feb 14, 2024
3584989
unstake
Anton-Mushnin Feb 14, 2024
68397bf
lint
Anton-Mushnin Feb 14, 2024
93015ed
events layout
Anton-Mushnin Feb 15, 2024
39416a1
button actions
Anton-Mushnin Feb 15, 2024
3c0e889
login
Anton-Mushnin Feb 19, 2024
b4546fd
fetch tokens
Anton-Mushnin Feb 20, 2024
01a2e00
commit, reveal, abort
Anton-Mushnin Feb 21, 2024
9223e6e
adding user and account ot queryKey
Anton-Mushnin Feb 21, 2024
70137d7
fix joining of FCPlayer token
Anton-Mushnin Feb 21, 2024
9b40503
signUp
Anton-Mushnin Feb 21, 2024
696a5aa
lint
Anton-Mushnin Feb 21, 2024
2c62aae
mint FCPlayer
Anton-Mushnin Feb 21, 2024
3941974
web3 authorization sign up
Anton-Mushnin Feb 22, 2024
9964e34
sign in and sign up layout
Anton-Mushnin Feb 22, 2024
e3c0696
hex values handling
Anton-Mushnin Feb 22, 2024
07e605e
minting FullcountPlayerOption
Anton-Mushnin Feb 22, 2024
f05e43a
hiding go-to-session button
Anton-Mushnin Feb 22, 2024
dbabeb0
refetching tokens after atBat finish
Anton-Mushnin Feb 22, 2024
3235b54
lint
Anton-Mushnin Feb 22, 2024
601f06e
refactoring
Anton-Mushnin Feb 22, 2024
ed86a79
Show invite link if selected token in the session
Anton-Mushnin Feb 23, 2024
cebc11f
Adding OwnedTokens to the Context
Anton-Mushnin Feb 23, 2024
8801cd4
turning off web3 auth
Anton-Mushnin Feb 23, 2024
3b89c62
switching to prod fullcount player api
Anton-Mushnin Feb 23, 2024
7a8e436
fetch sessions limit
Anton-Mushnin Feb 23, 2024
9327f33
Merge branch 'alpha' into fullcount-player-integration
Anton-Mushnin Feb 23, 2024
9769fdc
handling tokens fetching errors
Anton-Mushnin Feb 27, 2024
3e8753c
auto reveal
Anton-Mushnin Feb 27, 2024
1826f82
auto reveal off
Anton-Mushnin Feb 27, 2024
5cd0afc
getWeb3Contracts util
Anton-Mushnin Feb 28, 2024
1dc7f55
setting provider from rpc
Anton-Mushnin Feb 28, 2024
08d9407
not fetching blb tokens without wallet
Anton-Mushnin Feb 28, 2024
124c1fc
hide address without wallet
Anton-Mushnin Feb 28, 2024
f24f54a
using getContracts util
Anton-Mushnin Feb 28, 2024
a6d42a0
reveal for BLBToken
Anton-Mushnin Feb 28, 2024
38e6d83
separate tokens
Anton-Mushnin Feb 28, 2024
8487468
layout
Anton-Mushnin Feb 28, 2024
136745f
closing session with progress 6
Anton-Mushnin Feb 28, 2024
ca39cb6
hiding 'go to session button'
Anton-Mushnin Feb 28, 2024
c613cfd
displaying open session progress
Anton-Mushnin Feb 28, 2024
74cccd9
hiding buttons behind login
Anton-Mushnin Feb 28, 2024
b5a0e74
hiding mint button behind login
Anton-Mushnin Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions web/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import theme from "../src/theme";
import { Web3Context } from "../src/contexts";
import "../src/styles/globals.css";
import { GameContextProvider } from "../src/contexts/GameContext";
import { UserProvider } from "../src/contexts/UserContext";

export default function App({ Component, pageProps }: AppProps) {
const [queryClient] = useState(new QueryClient());
Expand All @@ -17,9 +18,11 @@ export default function App({ Component, pageProps }: AppProps) {
<ChakraProvider theme={theme}>
<QueryClientProvider client={queryClient}>
<Web3Context>
<GameContextProvider>
<Component {...pageProps} />
</GameContextProvider>
<UserProvider>
<GameContextProvider>
<Component {...pageProps} />
</GameContextProvider>
</UserProvider>
</Web3Context>
</QueryClientProvider>
</ChakraProvider>
Expand Down
12 changes: 12 additions & 0 deletions web/pages/landing/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Layout from "../../src/components/layout/layout";
import Landing from "../../src/components/landing/Landing";

const Home = () => {
return (
<Layout home={true} title="Fullcount">
<Landing />
</Layout>
);
};

export default Home;
33 changes: 33 additions & 0 deletions web/src/components/AnimatedMessage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useEffect, useState } from "react";
import styles from "./playing/PlayView.module.css";

const AnimatedMessage = ({ message }: { message: string }) => {
const [numberOfDots, setNumberOfDots] = useState({ number: 1, trend: "up" });
useEffect(() => {
const intervalId = setInterval(() => {
setNumberOfDots((prevCount) => {
if (prevCount.number === 1) {
return { number: 2, trend: "up" };
} else if (prevCount.number === 3) {
return { number: 2, trend: "down" };
} else {
return {
number: prevCount.trend === "up" ? 3 : 1,
trend: "",
};
}
});
}, 1000);

return () => clearInterval(intervalId);
}, []);

return (
<div className={styles.waitingMessage}>
{`${message}${".".repeat(numberOfDots.number)}`}
<span style={{ color: "transparent" }}>{".".repeat(3 - numberOfDots.number)}</span>
</div>
);
};

export default AnimatedMessage;
84 changes: 84 additions & 0 deletions web/src/components/account/Account.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
.loginButton {
display: flex;
padding: 5px 10px;
justify-content: center;
align-items: center;
gap: 10px;
border-radius: 20px;
background: #353535;
color: #FFF;
font-family: Space Grotesk, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 1;
white-space: nowrap;
}

.signUpButton {
display: flex;
padding: 5px 10px;
justify-content: center;
align-items: center;
gap: 10px;
border-radius: 20px;
background: #F56646;
color: #FFF;
font-family: Space Grotesk, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: 700;
line-height: 100%;
white-space: nowrap;
}

.portalButton {
display: flex;
padding: 4px 9px;
align-items: center;
gap: 10px;
border-radius: 30px;
border: 1px solid #FFF;
background-color: transparent;
color: #FFF;
text-align: center;
font-family: Space Grotesk, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 100%; /* 12px */
}

.divider {
background-color: #8F8F8F;
height: 3px;
width: 3px;
border-radius: 50%;
}

@media (min-width: 768px) {
.portalButton {
padding: 9px 14px;
height: 36px;
font-size: 16px;
}

.loginButton, .signUpButton {
padding: 5px 15px;
font-size: 16px;
height: 36px;

}
}

.portalButton:hover {
background-color: #FFF;
color: black;
}


.portalButtonText:hover {
background: -webkit-linear-gradient(0deg, #F56646, #f89a85);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
70 changes: 70 additions & 0 deletions web/src/components/account/Account.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import RouterLink from "next/link";

import React, { useState } from "react";
import {
Flex,
Menu,
MenuButton,
MenuList,
MenuItem,
Divider,
Spinner,
useMediaQuery,
} from "@chakra-ui/react";

import LoginButton from "./LoginButton";
import { BsPerson } from "react-icons/bs";
import useUser from "../../contexts/UserContext";
import useLogout from "../../hooks/useLogout";
import SignUp from "./SignUp";
import { useRouter } from "next/router";
import globalStyles from "../GlobalStyles.module.css";

const Account = ({ ...props }: { [x: string]: any }) => {
const { user } = useUser();
const { logout, isLoading: isLoggingOut } = useLogout();
const [isSignUpOpen, setIsSignUpOpen] = useState(false);
const [isBaseView] = useMediaQuery(["(max-width: 767px)"]);

const router = useRouter();

return (
<>
<Flex gap={{ base: "5px", sm: "10px" }} alignItems={"center"}>
{!user && (
<>
<LoginButton>
<button className={globalStyles.button}>Log&nbsp;in</button>
</LoginButton>
{!isBaseView && (
<>
<SignUp isOpen={isSignUpOpen} onClose={() => setIsSignUpOpen(false)} />
<button className={globalStyles.button} onClick={() => setIsSignUpOpen(true)}>
Sign&nbsp;up
</button>
</>
)}
</>
)}
</Flex>
{isLoggingOut && <Spinner />}
{user && !isLoggingOut && (
<Menu>
<MenuButton {...props} bg={"transparent"}>
<Flex gap="5px" alignItems="center">
<BsPerson />
{user.username.length > 13 ? user.username.slice(0, 11) + "..." : user.username}
</Flex>
</MenuButton>
<MenuList borderRadius="10px" border="1px solid white" minW="fit-content" p="20px">
<MenuItem p="0px" onClick={() => logout()}>
Log out
</MenuItem>
</MenuList>
</Menu>
)}
</>
);
};

export default Account;
81 changes: 81 additions & 0 deletions web/src/components/account/ForgotPassword.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import React, { useState } from "react";

import {
FormControl,
InputGroup,
Button,
Input,
Modal,
ModalOverlay,
ModalContent,
ModalBody,
Flex,
Text,
} from "@chakra-ui/react";
import useForgotPassword from "../../hooks/useForgotPassword";
import { CloseIcon } from "@chakra-ui/icons";

const ForgotPassword = ({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }) => {
const [email, setEmail] = useState("");
const { forgotPassword, isLoading } = useForgotPassword();

const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();

forgotPassword({ email });
};

return (
<Modal isOpen={isOpen} onClose={onClose}>
<ModalOverlay />
<form onSubmit={handleSubmit}>
<ModalContent p="0" borderRadius="20px" bg="transparent">
<ModalBody bg="transparent">
<Flex
direction="column"
bgColor="#1A1D22"
borderRadius="20px"
gap="30px"
p="30px"
alignItems="center"
border="1px solid white"
>
<Flex justifyContent="space-between" w="100%">
<Text>Forgot Password</Text>
<CloseIcon
cursor="pointer"
onClick={() => {
onClose();
}}
/>
</Flex>
<FormControl my={4}>
<InputGroup>
<Input
type="text"
placeholder="Enter your email"
name="email"
value={email}
onChange={(event) => setEmail(event.target.value)}
/>
</InputGroup>
</FormControl>
<Button
fontSize="lg"
h="46px"
type="submit"
width="100%"
variant="plainOrange"
isLoading={isLoading}
>
Send
</Button>
</Flex>
</ModalBody>
</ModalContent>
</form>
</Modal>
);
};

export default ForgotPassword;
39 changes: 39 additions & 0 deletions web/src/components/account/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { useState } from "react";
import { Box } from "@chakra-ui/react";
import SignIn from "./SignIn";
import SignUp from "./SignUp";
import ForgotPassword from "./ForgotPassword";

interface LoginButtonProps {
children: React.ReactNode;
}

const LoginButton: React.FC<LoginButtonProps> = ({ children }) => {
const [isOpen, setIsOpen] = useState(false);
const [isSignUpOpen, setIsSignUpOpen] = useState(false);
const [isForgotPassOpen, setIsForgotPassOpen] = useState(false);

const handleOpen = () => {
setIsOpen(true);
};

const handleClose = () => {
setIsOpen(false);
};

return (
<div onClick={() => handleOpen()} style={{ cursor: "pointer", display: "inline" }}>
<SignIn
isOpen={isOpen}
onClose={handleClose}
onSignUp={() => setIsSignUpOpen(true)}
onForgotPassword={() => setIsForgotPassOpen(true)}
/>
<SignUp isOpen={isSignUpOpen} onClose={() => setIsSignUpOpen(false)} />
<ForgotPassword isOpen={isForgotPassOpen} onClose={() => setIsForgotPassOpen(false)} />
{children}
</div>
);
};

export default LoginButton;
Loading
Loading