import React, { useState } from 'react'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { Avatar, Button, FormControl, InputLabel, Paper, Select, Typography, SelectChangeEvent, } from '@mui/material'; import classnames from 'classnames'; import { useStyles } from 'component/user/UserProfile/UserProfileContent/UserProfileContent.styles'; import { useThemeStyles } from 'themes/themeStyles'; import { Alert } from '@mui/material'; import EditProfile from '../EditProfile/EditProfile'; import legacyStyles from '../../user.module.scss'; import { getBasePath } from 'utils/formatPath'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { IUser } from 'interfaces/user'; import { ILocationSettings } from 'hooks/useLocationSettings'; interface IUserProfileContentProps { id: string; showProfile: boolean; profile: IUser; possibleLocales: string[]; imageUrl: string; currentLocale?: string; setCurrentLocale: (value: string) => void; setLocationSettings: React.Dispatch< React.SetStateAction >; } const UserProfileContent = ({ id, showProfile, profile, possibleLocales, imageUrl, currentLocale, setCurrentLocale, setLocationSettings, }: IUserProfileContentProps) => { const { classes: themeStyles } = useThemeStyles(); const { uiConfig } = useUiConfig(); const [updatedPassword, setUpdatedPassword] = useState(false); const [editingProfile, setEditingProfile] = useState(false); const { classes: styles } = useStyles(); const profileAvatarClasses = classnames(styles.avatar, { [styles.editingAvatar]: editingProfile, }); const profileEmailClasses = classnames(styles.profileEmail, { [styles.editingEmail]: editingProfile, }); const handleChange = (e: SelectChangeEvent) => { const locale = e.target.value; setCurrentLocale(locale); setLocationSettings({ locale }); }; return ( {profile?.email} setUpdatedPassword(false)}> Successfully updated password. } /> setEditingProfile(true) } > Update password } />
Date/Time formatting
Privacy policy
} elseShow={ } /> } /> ); }; export default UserProfileContent;