11import React from 'react'
22import Toggle from 'react-toggle'
33import 'react-toggle/style.css'
4- import { ChipsSet } from 'src/components/Elements'
4+ import { Button , ChipsSet } from 'src/components/Elements'
55import { Footer } from 'src/components/Layout'
66import { SettingsContentLayout } from 'src/components/Layout/SettingsContentLayout'
7+ import { useAuth , User } from 'src/features/auth'
78import {
89 identifyUserLinksInNewTab ,
910 identifyUserListingMode ,
@@ -19,6 +20,27 @@ import { Option } from 'src/types'
1920import { DNDSettings } from './DNDSettings'
2021import './generalSettings.css'
2122
23+ interface UserInfoProps {
24+ user : User
25+ }
26+
27+ const UserInfo = ( { user } : UserInfoProps ) => {
28+ const { logout, providerId } = useAuth ( )
29+
30+ return (
31+ < div className = "userContent" >
32+ { user ?. imageURL && < img src = { user . imageURL } className = "userImage" > </ img > }
33+ < div className = "userInfos" >
34+ < div className = "userName" > { user . name } </ div >
35+ < div className = "providerId" > Logged using { providerId } </ div >
36+ </ div >
37+ < Button onClick = { logout } size = "small" >
38+ Logout
39+ </ Button >
40+ </ div >
41+ )
42+ }
43+
2244export const GeneralSettings = ( ) => {
2345 const {
2446 openLinksNewTab,
@@ -62,13 +84,16 @@ export const GeneralSettings = () => {
6284 }
6385 }
6486
87+ const { user } = useAuth ( )
88+
6589 return (
6690 < SettingsContentLayout
6791 title = "General Settings"
6892 description = {
6993 'Customize your experience by selecting the number of cards you want to see, the search engine you want to use and more.'
7094 } >
7195 < div >
96+ { user != null && < UserInfo user = { user } /> }
7297 < div className = "settingRow" >
7398 < p className = "settingTitle" > Max number of cards to display</ p >
7499 < div className = "settingContent" >
0 commit comments