mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2026-01-27 05:12:10 +00:00
chore: lint with tabwidth: 2
This commit is contained in:
@@ -4,62 +4,62 @@ import { Button, Card, Typography } from '../../ui'
|
||||
import s from './personal-information.module.scss'
|
||||
|
||||
type Props = {
|
||||
avatar: string
|
||||
email: string
|
||||
name: string
|
||||
onAvatarChange: (newAvatar: string) => void
|
||||
onLogout: () => void
|
||||
onNameChange: (newName: string) => void
|
||||
avatar: string
|
||||
email: string
|
||||
name: string
|
||||
onAvatarChange: (newAvatar: string) => void
|
||||
onLogout: () => void
|
||||
onNameChange: (newName: string) => void
|
||||
}
|
||||
export const PersonalInformation = ({
|
||||
avatar,
|
||||
email,
|
||||
name,
|
||||
onAvatarChange,
|
||||
onLogout,
|
||||
onNameChange,
|
||||
avatar,
|
||||
email,
|
||||
name,
|
||||
onAvatarChange,
|
||||
onLogout,
|
||||
onNameChange,
|
||||
}: Props) => {
|
||||
const handleAvatarChanged = () => {
|
||||
onAvatarChange('new Avatar')
|
||||
}
|
||||
const handleNameChanged = () => {
|
||||
onNameChange('New name')
|
||||
}
|
||||
const handleLogout = () => {
|
||||
onLogout()
|
||||
}
|
||||
const handleAvatarChanged = () => {
|
||||
onAvatarChange('new Avatar')
|
||||
}
|
||||
const handleNameChanged = () => {
|
||||
onNameChange('New name')
|
||||
}
|
||||
const handleLogout = () => {
|
||||
onLogout()
|
||||
}
|
||||
|
||||
return (
|
||||
<Card className={s.card}>
|
||||
<Typography className={s.title} variant={'large'}>
|
||||
Personal Information
|
||||
</Typography>
|
||||
<div className={s.photoContainer}>
|
||||
<div>
|
||||
<img alt={'avatar'} src={avatar} />
|
||||
<button className={s.editAvatarButton} onClick={handleAvatarChanged}>
|
||||
<Camera />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className={s.nameWithEditButton}>
|
||||
<Typography className={s.name} variant={'h1'}>
|
||||
{name}
|
||||
</Typography>
|
||||
<button className={s.editNameButton} onClick={handleNameChanged}>
|
||||
<Edit />
|
||||
</button>
|
||||
</div>
|
||||
<Typography className={s.email} variant={'body2'}>
|
||||
{/* eslint-disable-next-line react/no-unescaped-entities */}
|
||||
{email}
|
||||
</Typography>
|
||||
<div className={s.buttonContainer}>
|
||||
<Button onClick={handleLogout} variant={'secondary'}>
|
||||
<Logout />
|
||||
Sign Out
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
)
|
||||
return (
|
||||
<Card className={s.card}>
|
||||
<Typography className={s.title} variant={'large'}>
|
||||
Personal Information
|
||||
</Typography>
|
||||
<div className={s.photoContainer}>
|
||||
<div>
|
||||
<img alt={'avatar'} src={avatar} />
|
||||
<button className={s.editAvatarButton} onClick={handleAvatarChanged}>
|
||||
<Camera />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className={s.nameWithEditButton}>
|
||||
<Typography className={s.name} variant={'h1'}>
|
||||
{name}
|
||||
</Typography>
|
||||
<button className={s.editNameButton} onClick={handleNameChanged}>
|
||||
<Edit />
|
||||
</button>
|
||||
</div>
|
||||
<Typography className={s.email} variant={'body2'}>
|
||||
{/* eslint-disable-next-line react/no-unescaped-entities */}
|
||||
{email}
|
||||
</Typography>
|
||||
<div className={s.buttonContainer}>
|
||||
<Button onClick={handleLogout} variant={'secondary'}>
|
||||
<Logout />
|
||||
Sign Out
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user