Skip to content

Commit c786e04

Browse files
committed
replace join linen by join slack/discord
1 parent 2275551 commit c786e04

File tree

2 files changed

+20
-48
lines changed

2 files changed

+20
-48
lines changed

apps/web/components/layout/PageLayout/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ function PageLayout({
185185
api={api}
186186
InternalLink={InternalLink}
187187
JoinButton={JoinButton({
188-
startSignUp,
188+
// startSignUp,
189189
status,
190-
api,
191-
reload: router.reload,
190+
// api,
191+
// reload: router.reload,
192192
})}
193193
Link={Link}
194194
signOut={signOut}

apps/web/ui/JoinButton/index.tsx

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
import React from 'react';
2-
import JoinLinen from './JoinLinen';
31
import JoinDiscord from './JoinDiscord';
42
import 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

85
interface WrapperProps {
96
status: 'authenticated' | 'loading' | 'unauthenticated';
10-
startSignUp?: (props: any) => Promise<void>;
11-
api: ApiClient;
12-
reload(): void;
137
}
148

159
interface 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

Comments
 (0)