mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 07:12:36 -05:00
added youtube
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -19,6 +19,7 @@ export const SEARCH_FOR_USER: DocumentNode = gql`
|
||||
discord_id
|
||||
twitch_name
|
||||
twitter_name
|
||||
youtube_name
|
||||
country
|
||||
weapons
|
||||
top500
|
||||
|
||||
@@ -109,6 +109,7 @@ export interface User {
|
||||
avatar?: string
|
||||
twitch_name?: string
|
||||
twitter_name?: string
|
||||
youtube_name?: string
|
||||
country?: CountryCode
|
||||
weapons?: Weapon[]
|
||||
top500: boolean
|
||||
|
||||
@@ -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
|
||||
|
||||
2
index.js
2
index.js
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user