diff --git a/apps/jonogon-web-next/src/app/page.tsx b/apps/jonogon-web-next/src/app/page.tsx index b487b3be..397da596 100644 --- a/apps/jonogon-web-next/src/app/page.tsx +++ b/apps/jonogon-web-next/src/app/page.tsx @@ -20,6 +20,7 @@ import { getSortType, } from './_components/petitionSortUtils'; import {TypeAnimation} from 'react-type-animation'; +import {trpc} from '@/trpc/client'; function SortOption({ sort, @@ -79,6 +80,8 @@ function Tab({ ); } +const DISCORD_COMMUNITY_SIZE = 2500; + export default function Home() { const params = useSearchParams(); @@ -90,6 +93,31 @@ export default function Home() { const sortLabel = getDefaultSortLabelForDabiType(sort, type); + const {data: userCountResponse} = + trpc.users.getTotalNumberOfUsers.useQuery(); + + const defaultTypeSeq = [ + 'Submit.', + 500, + 'Submit. Vote.', + 500, + 'Submit. Vote.\nReform.', + 2000, + `যত বেশি ভোট,\nতত তাড়াতাড়ি জবাব`, + 2000, + ]; + + const userCount = Number(userCountResponse?.data.count?.count ?? 0); + + const typeSeq = + userCount > 0 + ? [ + ...defaultTypeSeq, + `${userCount + DISCORD_COMMUNITY_SIZE} নাগরিক এর সাথে\nগোরে তুলুন নতুন দেশ`, + 2000, + ] + : defaultTypeSeq; + return ( <>
@@ -98,19 +126,11 @@ export default function Home() { 'Your Own দাবিs' ) : ( 0 ? 'tomato' : 'potato'} style={{whiteSpace: 'pre-line', display: 'inline'}} cursor={true} speed={80} - sequence={[ - `যত বেশি ভোট,\nতত তাড়াতাড়ি জবাব`, - 2000, - 'Submit.', - 500, - 'Submit. Vote.', - 500, - 'Submit. Vote.\nReform.', - 2000, - ]} + sequence={typeSeq} omitDeletionAnimation repeat={Infinity} />