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

update ads #2149

Merged
merged 1 commit into from
Apr 12, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions ui/packages/db/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
<meta
name="description"
content="gcsim - a team dps simulator for Genshin Impact" />
<meta name="google-adsense-account" content="ca-pub-9129749839418344">
<meta name="google-adsense-account" content="ca-pub-9129749839418344" />
<title>gcsim - simulation impact</title>
<link rel="shortcut icon" href="/images/favicon.ico">
<link rel="shortcut icon" href="/images/favicon.ico" />

<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet" />
<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9129749839418344"
crossorigin="anonymous"></script>
</head>
<body style="scrollbar-gutter: stable" class="bp4-dark">
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
</html>
1 change: 1 addition & 0 deletions ui/packages/db/public/ads.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
google.com, pub-9129749839418344, DIRECT, f08c47fec0942fa0
106 changes: 34 additions & 72 deletions ui/packages/db/src/Pages/Database/DBVIew.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { db } from "@gcsim/types";
import eula from "images/eula.png";
import { Helmet, HelmetProvider } from "react-helmet-async";
import { useTranslation } from "react-i18next";
import InfiniteScroll from "react-infinite-scroll-component";
import { ActionBar } from "SharedComponents/ActionBar";
import { Warning } from "SharedComponents/Warning";
import { ListView } from "../../SharedComponents/ListView";
import {db} from '@gcsim/types';
import eula from 'images/eula.png';
import {useTranslation} from 'react-i18next';
import InfiniteScroll from 'react-infinite-scroll-component';
import {ActionBar} from 'SharedComponents/ActionBar';
import {Warning} from 'SharedComponents/Warning';
import {ListView} from '../../SharedComponents/ListView';

type Props = {
data: db.Entry[];
Expand All @@ -14,71 +13,34 @@ type Props = {
};

export const DBView = (props: Props) => {
const { t } = useTranslation();
const {t} = useTranslation();
return (
<HelmetProvider>
<>
<div
className="hidden min-[1300px]:block fixed w-[150px] h-full max-h-[500px] right-[10px] top-[50%]"
style={{ transform: "translateY(-50%)" }}
>
<ins
className="adsbygoogle"
style={{
display: "block",
width: "150px",
height: "100%",
}}
data-ad-client="ca-pub-9129749839418344"
data-ad-slot="8372128583"
data-ad-format="auto"
data-full-width-responsive="true"
>
<Helmet>
<script>
{"(adsbygoogle = window.adsbygoogle || []).push({});"}
</script>
</Helmet>
</ins>
</div>
<div className="flex flex-col gap-4 m-8 my-4 items-center min-[1300px]:mx-[160px]">
<ActionBar simCount={props.data.length} />
<Warning />
{props.data.length === 0 ? (
<div className="6 flex flex-col justify-center items-center h-screen">
<img
src={eula}
className=" object-contain opacity-50 w-32 h-32"
/>
</div>
) : (
<InfiniteScroll
dataLength={props.data.length} //This is important field to render the next data
next={props.fetchData}
hasMore={props.hasMore}
loader={<h4>{t("sim.loading")}</h4>}
endMessage={
<>
<p className="text-center mt-4">
<b>{t("db.seen_it_all")}</b>
</p>
<p className="text-center">{t("db.not_find")}</p>
</>
}
//TODO: enable pull down functionality for refreshing maybe??
>
<ListView data={props.data} />
</InfiniteScroll>
)}
<div className="flex flex-col gap-4 m-8 my-4 items-center min-[1300px]:mx-[160px]">
<ActionBar simCount={props.data.length} />
<Warning />
{props.data.length === 0 ? (
<div className="6 flex flex-col justify-center items-center h-screen">
<img src={eula} className=" object-contain opacity-50 w-32 h-32" />
</div>
<Helmet>
<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9129749839418344"
crossOrigin="anonymous"
></script>
</Helmet>
</>
</HelmetProvider>
) : (
<InfiniteScroll
dataLength={props.data.length} //This is important field to render the next data
next={props.fetchData}
hasMore={props.hasMore}
loader={<h4>{t('sim.loading')}</h4>}
endMessage={
<>
<p className="text-center mt-4">
<b>{t('db.seen_it_all')}</b>
</p>
<p className="text-center">{t('db.not_find')}</p>
</>
}
//TODO: enable pull down functionality for refreshing maybe??
>
<ListView data={props.data} />
</InfiniteScroll>
)}
</div>
);
};