MCPcopy Index your code
hub / github.com/AnswerOverflow/AnswerOverflow / ServerInviteJoinButton

Function ServerInviteJoinButton

packages/ui/src/server-invite.tsx:90–117  ·  view source on GitHub ↗
(
	props: {
		className?: string;
		size?: ButtonProps['size'];
	} & Pick<ServerInviteProps, 'server' | 'channel' | 'location'> &
		Omit<React.ComponentPropsWithoutRef<typeof LinkButton>, 'href'>,
)

Source from the content-addressed store, hash-verified

88};
89
90export 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
119export const ServerInvite = (
120 props: ServerInviteProps & {

Callers

nothing calls this directly

Calls 3

cnFunction · 0.90
channelToAnalyticsDataFunction · 0.90
serverToAnalyticsDataFunction · 0.90

Tested by

no test coverage detected