1- import React from 'react' ;
2- import JoinLinen from './JoinLinen' ;
31import JoinDiscord from './JoinDiscord' ;
42import JoinSlack from './JoinSlack' ;
5- import { ChatType , SerializedAccount , Settings } from '@linen/types' ;
6- import type { ApiClient } from '@linen/api-client' ;
3+ import { SerializedAccount , Settings } from '@linen/types' ;
74
85interface WrapperProps {
96 status : 'authenticated' | 'loading' | 'unauthenticated' ;
10- startSignUp ?: ( props : any ) => Promise < void > ;
11- api : ApiClient ;
12- reload ( ) : void ;
137}
148
159interface Props {
@@ -19,47 +13,25 @@ interface Props {
1913 settings : Settings ;
2014}
2115
22- export default function JoinButton ( {
23- status,
24- startSignUp,
25- api,
26- reload,
27- } : WrapperProps ) {
28- return ( { brandColor, fontColor, currentCommunity, settings } : Props ) => {
16+ export default function JoinButton ( { status } : WrapperProps ) {
17+ const fn = ( { brandColor, fontColor, currentCommunity, settings } : Props ) => {
2918 if ( status === 'loading' ) {
3019 return < div /> ;
3120 }
3221
33- if (
34- currentCommunity . premium &&
35- settings . communityInviteUrl &&
36- settings . chat !== ChatType . MEMBERS
37- ) {
38- return settings . communityType === 'discord' ? (
39- < JoinDiscord
40- brandColor = { brandColor }
41- fontColor = { fontColor }
42- href = { settings . communityInviteUrl }
43- />
44- ) : (
45- < JoinSlack
46- brandColor = { brandColor }
47- fontColor = { fontColor }
48- href = { settings . communityInviteUrl }
49- />
50- ) ;
51- } else {
52- return (
53- < JoinLinen
54- brandColor = { brandColor }
55- fontColor = { fontColor }
56- accountId = { settings . communityId }
57- status = { status }
58- startSignUp = { startSignUp }
59- api = { api }
60- reload = { reload }
61- />
62- ) ;
63- }
22+ return settings . communityType === 'discord' ? (
23+ < JoinDiscord
24+ brandColor = { brandColor }
25+ fontColor = { fontColor }
26+ href = { settings . communityInviteUrl }
27+ />
28+ ) : (
29+ < JoinSlack
30+ brandColor = { brandColor }
31+ fontColor = { fontColor }
32+ href = { settings . communityInviteUrl }
33+ />
34+ ) ;
6435 } ;
36+ return fn ;
6537}
0 commit comments