Skip to content

Instantly share code, notes, and snippets.

@Daltonic
Created August 31, 2023 20:12
Show Gist options
  • Save Daltonic/429601d79d9d3bda5a6ec3533aa6e929 to your computer and use it in GitHub Desktop.
Save Daltonic/429601d79d9d3bda5a6ec3533aa6e929 to your computer and use it in GitHub Desktop.
Dapp Votes
import { globalActions } from '@/store/globalSlices'
import { RootState } from '@/utils/types'
import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { toast } from 'react-toastify'
const Banner = () => {
const dispatch = useDispatch()
const { setCreateModal } = globalActions
const { wallet } = useSelector((states: RootState) => states.globalStates)
const onPressCreate = () => {
if (wallet === '') return toast.warning('Connect wallet first!')
dispatch(setCreateModal('scale-100'))
}
return (
<main className="mx-auto text-center space-y-8">
<h1 className="text-[45px] font-[600px] text-center leading-none">Vote Without Rigging</h1>
<p className="text-[16px] font-[500px] text-center">
A beauty pageantry is a competition that has traditionally focused on judging and ranking
the physical...
</p>
<button
className="text-black h-[45px] w-[148px] rounded-full transition-all duration-300
border border-gray-400 bg-white hover:bg-opacity-20 hover:text-white"
onClick={onPressCreate}
>
Create poll
</button>
</main>
)
}
export default Banner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment