feat: homepage ads

This commit is contained in:
TrèsAbhi committed 2024-06-15 14:01:51 -05:00
1 parent 9f38f16d2b
commit bcabb65857
2 files changed
+64 -23

No files matched your search

+7 -6
View File
@@ -11,8 +11,6 @@ export function PatreonPlug() {
const patreon = useApp((state) => state.logins.patreon); const patreon = useApp((state) => state.logins.patreon);
const exempt = useAdExempt(); const exempt = useAdExempt();
if (exempt) return null;
return ( return (
<Flex <Flex
gap="2" gap="2"
@@ -24,18 +22,21 @@ export function PatreonPlug() {
> >
<Flex gap="1" align="center"> <Flex gap="1" align="center">
<Text size="4" align="center"> <Text size="4" align="center">
Active Patreon supports go ad-free {exempt
? 'You are supporting BlitzKit, thank you!'
: 'Active Patreon supports go ad-free'}
</Text> </Text>
<CheckIcon width="1em" height="1em" /> {!exempt && <CheckIcon width="1em" height="1em" />}
</Flex> </Flex>
<Flex gap="2" wrap="wrap" justify="center"> <Flex gap="2" wrap="wrap" justify="center">
<Link href="https://www.patreon.com/tresabhi" target="_blank"> <Link href="https://www.patreon.com/tresabhi" target="_blank">
<Button> <Button>
<PatreonIcon width={15} height={15} /> Support on Patreon <PatreonIcon width={15} height={15} />{' '}
{exempt ? 'Manage membership' : 'Support on Patreon'}
</Button> </Button>
</Link> </Link>
{!patreon && ( {!patreon && !exempt && (
<Link href={patreonLoginUrl()}> <Link href={patreonLoginUrl()}>
<Button variant="outline">Log in with Patreon</Button> <Button variant="outline">Log in with Patreon</Button>
</Link> </Link>
+57 -17
View File
@@ -11,30 +11,56 @@ import {
sessionTool, sessionTool,
tankopediaTool, tankopediaTool,
} from '../constants/tools'; } from '../constants/tools';
import { useAdExempt } from '../hooks/useAdExempt';
import { Hero } from './components/Hero'; import { Hero } from './components/Hero';
import { PatreonPlug } from './components/PatreonPlug'; import { PatreonPlug } from './components/PatreonPlug';
import { ToolCard } from './components/ToolCard'; import { ToolCard } from './components/ToolCard';
export default function Page() { export default function Page() {
const exempt = useAdExempt();
return ( return (
<> <>
<Hero /> <Hero />
<PatreonPlug /> <PatreonPlug />
<Flex p="4" justify="between" gap="4"> <Flex
<Ad p="4"
type={AdType.WideSkyscraperVerticalPurple} justify={
display={{ exempt
initial: 'none', ? 'center'
lg: 'block', : {
}} initial: 'center',
/> lg: 'between',
}
}
gap="4"
>
{!exempt && (
<Ad
type={AdType.WideSkyscraperVerticalPurple}
display={{
initial: 'none',
lg: 'block',
}}
/>
)}
<Flex maxWidth="1024px" flexGrow="1" gap="4" direction="column"> <Flex maxWidth="1024px" flexGrow="1" gap="4" direction="column">
<ToolCard tool={tankopediaTool} /> <ToolCard tool={tankopediaTool} />
<AdMidSectionResponsive /> {!exempt && (
<Flex
justify="center"
display={{
initial: 'flex',
lg: 'none',
}}
>
<AdMidSectionResponsive />
</Flex>
)}
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}> <Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
<ToolCard tool={compareTool} /> <ToolCard tool={compareTool} />
@@ -46,22 +72,36 @@ export default function Page() {
<ToolCard tool={discordTool} /> <ToolCard tool={discordTool} />
</Flex> </Flex>
{!exempt && (
<Flex
justify="center"
display={{
initial: 'flex',
md: 'none',
}}
>
<AdMidSectionResponsive />
</Flex>
)}
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}> <Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
<ToolCard tool={moreTool} /> <ToolCard tool={moreTool} />
<Box flexGrow="1" flexBasis="0" /> <Box flexGrow="1" flexBasis="0" />
</Flex> </Flex>
</Flex> </Flex>
<Ad {!exempt && (
type={AdType.WideSkyscraperVerticalPurple} <Ad
display={{ type={AdType.WideSkyscraperVerticalPurple}
initial: 'none', display={{
md: 'block', initial: 'none',
}} lg: 'block',
/> }}
/>
)}
</Flex> </Flex>
<AdMidSectionResponsive /> {!exempt && <AdMidSectionResponsive />}
<div style={{ flex: 1 }} /> <div style={{ flex: 1 }} />
</> </>