-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68ed405
commit 654f47f
Showing
124 changed files
with
8,363 additions
and
4,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,34 @@ | ||
import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react' | ||
import { WalletModalProvider } from '@solana/wallet-adapter-react-ui' | ||
import { GambaUi } from 'gamba-react-ui' | ||
import { Gamba } from 'gamba/react' | ||
import { GambaProvider } from 'gamba/react' | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import { ToastContainer, toast } from 'react-toastify' | ||
import 'react-toastify/dist/ReactToastify.css' | ||
import { App } from './App' | ||
|
||
import '@solana/wallet-adapter-react-ui/styles.css' | ||
import 'react-toastify/dist/ReactToastify.css' | ||
import './styles.css' | ||
|
||
const root = ReactDOM.createRoot(document.getElementById('root')!) | ||
|
||
root.render( | ||
<Gamba | ||
creator="DwRFGbjKbsEhUMe5at3qWvH7i8dAJyhhwdnFoZMnLVRV" | ||
connection={{ | ||
endpoint: import.meta.env.GAMBA_SOLANA_RPC, | ||
config: { | ||
wsEndpoint: import.meta.env.GAMBA_SOLANA_RPC_WS, | ||
commitment: 'processed', | ||
}, | ||
}} | ||
<ConnectionProvider | ||
endpoint={import.meta.env.GAMBA_SOLANA_RPC} | ||
config={{ wsEndpoint: import.meta.env.GAMBA_SOLANA_RPC_WS, commitment: 'processed' }} | ||
> | ||
<GambaUi | ||
onError={(err) => toast(err.message, { type: 'error' })} | ||
> | ||
<ToastContainer /> | ||
<App /> | ||
</GambaUi> | ||
</Gamba>, | ||
<WalletProvider autoConnect wallets={[]}> | ||
<WalletModalProvider> | ||
<ToastContainer /> | ||
<GambaProvider creator="DwRFGbjKbsEhUMe5at3qWvH7i8dAJyhhwdnFoZMnLVRV"> | ||
<GambaUi | ||
onError={(err) => toast(err.message, { type: 'error' })} | ||
> | ||
<App /> | ||
</GambaUi> | ||
</GambaProvider> | ||
</WalletModalProvider> | ||
</WalletProvider> | ||
</ConnectionProvider>, | ||
) | ||
|
||
// IF YOU NEED TO USE YOUR OWN PROVIDERS FOR CONNECTION / WALLET: | ||
// root.render( | ||
// <ConnectionProvider | ||
// endpoint={import.meta.env.GAMBA_SOLANA_RPC} | ||
// config={{ wsEndpoint: import.meta.env.GAMBA_SOLANA_RPC_WS, commitment: 'processed' }} | ||
// > | ||
// <WalletProvider autoConnect wallets={[]}> | ||
// <WalletModalProvider> | ||
// <ToastContainer /> | ||
// <GambaProvider creator="DwRFGbjKbsEhUMe5at3qWvH7i8dAJyhhwdnFoZMnLVRV"> | ||
// <GambaUi | ||
// onError={(err) => toast(err.message, { type: 'error' })} | ||
// > | ||
// <App /> | ||
// </GambaUi> | ||
// </GambaProvider> | ||
// </WalletModalProvider> | ||
// </WalletProvider> | ||
// </ConnectionProvider>, | ||
// ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,73 @@ | ||
import { GameView, RecentPlays } from 'gamba/react-ui' | ||
import { useGamba } from 'gamba/react' | ||
import { GambaConnectButton, GameBundle, GameView } from 'gamba/react-ui' | ||
import React, { useMemo } from 'react' | ||
import QRCode from 'react-qr-code' | ||
import { useParams } from 'react-router-dom' | ||
import { Header } from './components/Header' | ||
import styled from 'styled-components' | ||
import { Card } from './components/Card' | ||
import { Footer } from './components/Footer' | ||
import { ClaimButton, Header, RedeemBonusButton } from './components/Header' | ||
import { RecentPlays } from './components/RecentPlays' | ||
import { Slider } from './components/Slider' | ||
import { GAMES } from './games' | ||
import { Section } from './styles' | ||
|
||
const StyledFrame = styled.div<{$viewHeight: number}>` | ||
height: 100vh; | ||
height: -webkit-fill-available; | ||
@media (min-height: 800px) { | ||
height: ${({ $viewHeight }) => $viewHeight}vh; | ||
} | ||
position: relative; | ||
transition: height .2s ease; | ||
` | ||
|
||
function Frame({ game }: {game?: GameBundle}) { | ||
const gamba = useGamba() | ||
return ( | ||
<StyledFrame $viewHeight={game ? 75 : 50}> | ||
{game && <GameView game={game} />} | ||
{!game && ( | ||
<Section style={{ height: '100%' }}> | ||
<div style={{ textAlign: 'center', display: 'flex', alignItems: 'center', justifyContent: 'center' }}> | ||
<div> | ||
<QRCode value={gamba.wallet.publicKey.toBase58()} /> | ||
<br /> | ||
<RedeemBonusButton /> | ||
<ClaimButton /> | ||
</div> | ||
</div> | ||
</Section> | ||
)} | ||
</StyledFrame> | ||
) | ||
} | ||
|
||
export default function View() { | ||
const { shortName } = useParams() | ||
const game = useMemo(() => GAMES.find((x) => x.short_name === shortName) ?? GAMES[0], [shortName]) | ||
const game = useMemo(() => GAMES.find((x) => x.short_name === shortName), [shortName]) | ||
|
||
return ( | ||
<> | ||
<Header /> | ||
<GameView game={game} /> | ||
<Frame game={game} /> | ||
<Section> | ||
<Slider title={<h2>Casino Games</h2>}> | ||
{GAMES.map((game) => ( | ||
<Card key={game.short_name} to={'/' + game.short_name} logo={game.image} backgroundColor={game.theme_color}> | ||
{game.name} | ||
</Card> | ||
))} | ||
</Slider> | ||
</Section> | ||
<Section> | ||
<h2>Recent Plays</h2> | ||
<RecentPlays /> | ||
</Section> | ||
<Section> | ||
<Footer /> | ||
</Section> | ||
<GambaConnectButton /> | ||
</> | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.