(
props: {
className?: string;
size?: ButtonProps['size'];
} & Pick<ServerInviteProps, 'server' | 'channel' | 'location'> &
Omit<React.ComponentPropsWithoutRef<typeof LinkButton>, 'href'>,
)
| 88 | }; |
| 89 | |
| 90 | export const ServerInviteJoinButton = ( |
| 91 | props: { |
| 92 | className?: string; |
| 93 | size?: ButtonProps['size']; |
| 94 | } & Pick<ServerInviteProps, 'server' | 'channel' | 'location'> & |
| 95 | Omit<React.ComponentPropsWithoutRef<typeof LinkButton>, 'href'>, |
| 96 | ) => { |
| 97 | const { server, channel, location, className, ...rest } = props; |
| 98 | const inviteCode = channel?.inviteCode || server.vanityInviteCode; |
| 99 | if (!inviteCode) return <></>; |
| 100 | return ( |
| 101 | <TrackLinkButton |
| 102 | href={`https://discord.gg/${inviteCode}`} |
| 103 | variant="default" |
| 104 | className={cn('text-center font-header font-bold', className)} |
| 105 | size={props.size} |
| 106 | eventName={'Server Invite Click'} |
| 107 | eventData={{ |
| 108 | ...(channel && channelToAnalyticsData(channel)), |
| 109 | ...serverToAnalyticsData(server), |
| 110 | 'Button Location': location, |
| 111 | }} |
| 112 | {...rest} |
| 113 | > |
| 114 | <ServerInviteJoinText id={server.id} /> |
| 115 | </TrackLinkButton> |
| 116 | ); |
| 117 | }; |
| 118 | |
| 119 | export const ServerInvite = ( |
| 120 | props: ServerInviteProps & { |
nothing calls this directly
no test coverage detected