Removed legacy Twitch controls from user profile.

This commit is contained in:
Phil 2022-09-16 13:46:05 +01:00
parent 0fc346fda8
commit be4b0441f0

View File

@ -1,24 +1,22 @@
import React, { useState } from 'react'
import { RefreshIcon } from '@heroicons/react/outline' import { RefreshIcon } from '@heroicons/react/outline'
import { useRouter } from 'next/router' import { PrivateUser, User } from 'common/user'
import { AddFundsButton } from 'web/components/add-funds-button'
import { Page } from 'web/components/page'
import { SEO } from 'web/components/SEO'
import { Title } from 'web/components/title'
import { formatMoney } from 'common/util/format'
import { cleanDisplayName, cleanUsername } from 'common/util/clean-username' import { cleanDisplayName, cleanUsername } from 'common/util/clean-username'
import { changeUserInfo } from 'web/lib/firebase/api' import { formatMoney } from 'common/util/format'
import { uploadImage } from 'web/lib/firebase/storage' import React, { useState } from 'react'
import Textarea from 'react-expanding-textarea'
import { AddFundsButton } from 'web/components/add-funds-button'
import { Col } from 'web/components/layout/col' import { Col } from 'web/components/layout/col'
import { Row } from 'web/components/layout/row' import { Row } from 'web/components/layout/row'
import { User, PrivateUser } from 'common/user' import { Page } from 'web/components/page'
import { getUserAndPrivateUser, updateUser } from 'web/lib/firebase/users' import { SEO } from 'web/components/SEO'
import { defaultBannerUrl } from 'web/components/user-page'
import { SiteLink } from 'web/components/site-link' import { SiteLink } from 'web/components/site-link'
import Textarea from 'react-expanding-textarea' import { Title } from 'web/components/title'
import { redirectIfLoggedOut } from 'web/lib/firebase/server-auth' import { defaultBannerUrl } from 'web/components/user-page'
import { generateNewApiKey } from 'web/lib/api/api-key' import { generateNewApiKey } from 'web/lib/api/api-key'
import { TwitchPanel } from 'web/components/profile/twitch-panel' import { changeUserInfo } from 'web/lib/firebase/api'
import { redirectIfLoggedOut } from 'web/lib/firebase/server-auth'
import { uploadImage } from 'web/lib/firebase/storage'
import { getUserAndPrivateUser, updateUser } from 'web/lib/firebase/users'
export const getServerSideProps = redirectIfLoggedOut('/', async (_, creds) => { export const getServerSideProps = redirectIfLoggedOut('/', async (_, creds) => {
return { props: { auth: await getUserAndPrivateUser(creds.uid) } } return { props: { auth: await getUserAndPrivateUser(creds.uid) } }
@ -64,7 +62,6 @@ function EditUserField(props: {
export default function ProfilePage(props: { export default function ProfilePage(props: {
auth: { user: User; privateUser: PrivateUser } auth: { user: User; privateUser: PrivateUser }
}) { }) {
const router = useRouter()
const { user, privateUser } = props.auth const { user, privateUser } = props.auth
const [avatarUrl, setAvatarUrl] = useState(user.avatarUrl || '') const [avatarUrl, setAvatarUrl] = useState(user.avatarUrl || '')
const [avatarLoading, setAvatarLoading] = useState(false) const [avatarLoading, setAvatarLoading] = useState(false)
@ -238,7 +235,6 @@ export default function ProfilePage(props: {
</button> </button>
</div> </div>
</div> </div>
{router.query.twitch && <TwitchPanel />}
</Col> </Col>
</Col> </Col>
</Page> </Page>