make group invite link more prominent

This commit is contained in:
mantikoros 2022-07-20 11:45:53 -05:00
parent 45b883477d
commit d65a60984d

View File

@ -52,6 +52,8 @@ import { useTipTxns } from 'web/hooks/use-tip-txns'
import { JoinOrLeaveGroupButton } from 'web/components/groups/groups-button' import { JoinOrLeaveGroupButton } from 'web/components/groups/groups-button'
import { searchInAny } from 'common/util/parse' import { searchInAny } from 'common/util/parse'
import { useWindowSize } from 'web/hooks/use-window-size' import { useWindowSize } from 'web/hooks/use-window-size'
import { CopyLinkButton } from 'web/components/copy-link-button'
import { ENV_CONFIG } from 'common/envs/constants'
export const getStaticProps = fromPropz(getStaticPropz) export const getStaticProps = fromPropz(getStaticPropz)
export async function getStaticPropz(props: { params: { slugs: string[] } }) { export async function getStaticPropz(props: { params: { slugs: string[] } }) {
@ -328,6 +330,11 @@ function GroupOverview(props: {
}) })
} }
const postFix = user ? '?referrer=' + user.username : ''
const shareUrl = `https://${ENV_CONFIG.domain}${groupPath(
group.slug
)}${postFix}`
return ( return (
<> <>
<Col className="gap-2 rounded-b bg-white p-2"> <Col className="gap-2 rounded-b bg-white p-2">
@ -372,21 +379,26 @@ function GroupOverview(props: {
</span> </span>
)} )}
</Row> </Row>
{anyoneCanJoin && user && ( {anyoneCanJoin && user && (
<Row className={'flex-wrap items-center gap-1'}> <Col className="my-4 px-2">
<span className={'text-gray-500'}>Share</span> <div className="text-lg">Invite</div>
<ShareIconButton <div className={'mb-2 text-gray-500'}>
group={group} Invite a friend to this group and get M${REFERRAL_AMOUNT} if they
username={user.username} sign up!
buttonClassName={'hover:bg-gray-300 mt-1 !text-gray-700'} </div>
>
<span className={'mx-2'}> <CopyLinkButton
Invite a friend and get M${REFERRAL_AMOUNT} if they sign up! url={shareUrl}
</span> tracking="copy group share link"
</ShareIconButton> buttonClassName="btn-md rounded-l-none"
</Row> toastClassName={'-left-28 mt-1'}
/>
</Col>
)} )}
<Col className={'mt-2'}> <Col className={'mt-2'}>
<div className="mb-2 text-lg">Members</div>
<GroupMemberSearch members={members} group={group} /> <GroupMemberSearch members={members} group={group} />
</Col> </Col>
</Col> </Col>