Skip to content
New issue

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

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

Already on GitHub? # to your account

MVC/cleaning, fixing and debugging 🧹⚙️' #47

Merged
merged 1 commit into from
Dec 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
84 changes: 84 additions & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Copyright Tippers 🎲🃏 2022
// 17 U.S.C §§ 101-1511

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import Document, { DocumentContext, Head, Html, Main, NextScript } from 'next/document';
import React from 'react';
import { ServerStyleSheet } from 'styled-components';

export default class MyDocument extends Document {
static async getInitialProps(
ctx: DocumentContext
): Promise<{
styles: JSX.Element;
html: string;
head?: JSX.Element[];
}> {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
// console.log(originalRenderPage);

try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) =>
sheet.collectStyles(
<>
<App {...props} />
</>
)
});

const initialProps = await Document.getInitialProps(ctx);

// @ts-ignore
return {
...initialProps,
styles: (
<>
{initialProps.styles}
{sheet.getStyleElement()}
</>
)
};
} finally {
sheet.seal();
}
}
render() {
return (
<Html>
<Head>
<link rel="icon" href="/assets/svg-logo.svg" type="image/jpg" sizes="16x16" />
<title> Tippers 🎲🃏</title>
<meta
name="description"
content="Tippers is a gaming platform on the Polygon blockchain."
/>
<meta property="og:type" content="website" />
<meta
property="og:title"
content="Tippers 🎲🃏"
/>
<meta property="og:image" content="/assets/svg-logo.svg" />
<meta
property="og:description"
content="Tippers is a gaming platform on the Polygon blockchain."
/>
<meta
name="twitter:title"
content="Tippers is a gaming platform on the Polygon blockchain."
/>
<meta
name="twitter:description"
content="Tippers is a gaming platform on the Polygon blockchain.."
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
18 changes: 0 additions & 18 deletions public/assets/logo.svg

This file was deleted.

18 changes: 0 additions & 18 deletions public/assets/text-logo.svg

This file was deleted.

Binary file removed public/favicon.ico
Binary file not shown.
8 changes: 4 additions & 4 deletions ui/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ const Footer = () => {
return (
<FooterContainer>
<FooterItem>Sponsored by </FooterItem>
<SocialLink href="/">
<SocialLink href="https://polygon.technology/" target='_blank'>
<img src='/assets/matic_logo.png' alt='polygon'/>
</SocialLink>
<SocialLink href='/'>
<SocialLink href='https://chain.link/' target='_blank'>
<img src='/assets/chainlink.png' alt='alchemy' style={{
width: "2rem"
}}/>
</SocialLink>
<SocialLink href='/'>
<SocialLink href='https://www.alchemy.com/' target='_blank'>
<img src='/assets/alchemy.png' alt='alchemy' style={{
width: "2rem"
}}/>
</SocialLink>
<SocialLink href="/">
<SocialLink href="https://xend.finance/" target='_blank'>
<img src='/assets/xend_finance.png' alt='xend finance'/>
</SocialLink>
</FooterContainer>
Expand Down
2 changes: 1 addition & 1 deletion ui/components/StakeCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const StakeCard = (props: StakeCardProps): JSX.Element => {
marginLeft: "-5px"
// marginTop: "1rem"
}}/>
<a href={`https://mumbai.polygonscan.com/tx/${txHash}`}>(Polygonscan)</a>
<a href={`https://mumbai.polygonscan.com/tx/${txHash}`} target='_blank'>(Polygonscan)</a>
</span>
</Typography>
) : (
Expand Down
1 change: 0 additions & 1 deletion utils/interact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ const transactionParameters = {
from: address, // must match user's active address.
value: ethers.utils.parseUnits(stake.toString(), "ether")._hex,
data: WheelSpinContract.methods.spin().encodeABI(),

};
// sign the transaction
try {
Expand Down