added youtube

This commit is contained in:
Sendou
2020-06-02 22:37:22 +03:00
parent 8da776242b
commit 8b441b08af
6 changed files with 26 additions and 1 deletions

View File

@@ -1,6 +1,12 @@
import { Box, Flex, Heading } from "@chakra-ui/core"
import React, { useContext, useState } from "react"
import { FaEdit, FaGamepad, FaTwitch, FaTwitter } from "react-icons/fa"
import {
FaEdit,
FaGamepad,
FaTwitch,
FaTwitter,
FaYoutube,
} from "react-icons/fa"
import MyThemeContext from "../../themeContext"
import { User } from "../../types"
import Flag from "../common/Flag"
@@ -80,6 +86,19 @@ const AvatarWithInfo: React.FC<AvatarWithInfoProps> = ({ user, canEdit }) => {
</a>
</Flex>
)}
{user.youtube_name && (
<Flex
alignItems="center"
mx="0.5em"
my="0.1em"
color={grayWithShade}
>
<Box as={FaYoutube} mr="0.2em" />
<a href={`https://youtube.com/c/${user.youtube_name}`}>
{user.youtube_name}
</a>
</Flex>
)}
{user.sens && (!!user.sens.stick || user.sens.stick === 0) && (
<Flex
alignItems="center"

View File

@@ -19,6 +19,7 @@ export const SEARCH_FOR_USER: DocumentNode = gql`
discord_id
twitch_name
twitter_name
youtube_name
country
weapons
top500

View File

@@ -109,6 +109,7 @@ export interface User {
avatar?: string
twitch_name?: string
twitter_name?: string
youtube_name?: string
country?: CountryCode
weapons?: Weapon[]
top500: boolean

View File

@@ -42,6 +42,7 @@ const typeDef = gql`
discord_id: String!
twitch_name: String
twitter_name: String
youtube_name: String
country: String
sens: Sens
bio: String

View File

@@ -44,6 +44,8 @@ passport.use(
userToSave.twitch_name = connection.name.toLowerCase()
} else if (connection.type === "twitter") {
userToSave.twitter_name = connection.name.toLowerCase()
} else if (connection.type === "youtube") {
userToSave.youtube_name = connection.name.toLowerCase()
}
}
}

View File

@@ -11,6 +11,7 @@ const userSchema = new mongoose.Schema({
},
twitch_name: String,
twitter_name: String,
youtube_name: String,
country: String,
sens: {
stick: { type: Number, min: -5, max: 5 },