forked from guildxyz/guild.xyz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatforms.ts
85 lines (82 loc) · 2.58 KB
/
platforms.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { ChakraProps } from "@chakra-ui/react"
import useDiscordCardProps, {
DiscordCardMenu,
DiscordCardSettings,
} from "components/[guild]/RolePlatforms/components/PlatformCard/components/useDiscordCardProps"
import useGithubCardProps from "components/[guild]/RolePlatforms/components/PlatformCard/components/useGithubCardProps"
import useGoogleCardProps from "components/[guild]/RolePlatforms/components/PlatformCard/components/useGoogleCardProps"
import GoogleCardSettings from "components/[guild]/RolePlatforms/components/PlatformCard/components/useGoogleCardProps/GoogleCardSettings"
import GoogleCardWarning from "components/[guild]/RolePlatforms/components/PlatformCard/components/useGoogleCardProps/GoogleCardWarning"
import useTelegramCardProps from "components/[guild]/RolePlatforms/components/PlatformCard/components/useTelegramCardProps"
import {
DiscordLogo,
GithubLogo,
GoogleLogo,
IconProps,
TelegramLogo,
TwitterLogo,
} from "phosphor-react"
import { GuildPlatform, PlatformName } from "types"
type PlatformData = {
icon: (props: IconProps) => JSX.Element
name: string
colorScheme: ChakraProps["color"]
gatedEntity: string
paramName: string
cardPropsHook?: (guildPlatform: GuildPlatform) => {
type: PlatformName
name: string
image?: string | JSX.Element
info?: string
link?: string
}
cardSettingsComponent?: () => JSX.Element
cardMenuComponent?: (props) => JSX.Element
cardWarningComponent?: (props) => JSX.Element
}
const platforms: Record<PlatformName, PlatformData> = {
TELEGRAM: {
icon: TelegramLogo,
name: "Telegram",
colorScheme: "TELEGRAM",
gatedEntity: "group",
paramName: "telegramId",
cardPropsHook: useTelegramCardProps,
},
DISCORD: {
icon: DiscordLogo,
name: "Discord",
colorScheme: "DISCORD",
gatedEntity: "server",
paramName: "discordId",
cardPropsHook: useDiscordCardProps,
cardSettingsComponent: DiscordCardSettings,
cardMenuComponent: DiscordCardMenu,
},
GITHUB: {
icon: GithubLogo,
name: "GitHub",
colorScheme: "GITHUB",
gatedEntity: "repo",
paramName: "githubId",
cardPropsHook: useGithubCardProps,
},
TWITTER: {
icon: TwitterLogo,
name: "Twitter",
colorScheme: "TWITTER",
gatedEntity: "account",
paramName: "twitterId",
},
GOOGLE: {
icon: GoogleLogo,
name: "Google Workspace",
colorScheme: "blue",
gatedEntity: "document",
paramName: "googleId",
cardPropsHook: useGoogleCardProps,
cardSettingsComponent: GoogleCardSettings,
cardWarningComponent: GoogleCardWarning,
},
}
export default platforms