Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/components/User-info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { getAuditorRating } from '../redux/actions/auditorAction.js';
import RatingDetails from './RatingDetails.jsx';
import UserFeedbacks from './UserFeedbacks.jsx';
import ArrowBackIcon from '@mui/icons-material/ArrowBack.js';
import dayjs from 'dayjs';

const UserInfo = ({ role, linkId }) => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -209,6 +210,14 @@ const UserInfo = ({ role, linkId }) => {
<span>E-mail</span>
<Typography noWrap={true}>{data.contacts?.email}</Typography>
</Box>
{data.free_at && role === AUDITOR && (
<Box sx={infoWrapper}>
<span>Free at</span>
<Typography noWrap={true}>
{data.free_at ? dayjs(data.free_at).format('MM.DD.YYYY') : ''}
</Typography>
</Box>
)}
</Box>
<Box sx={[infoWrapper, aboutWrapper]}>
<span>About</span>
Expand Down
28 changes: 26 additions & 2 deletions src/components/forms/edit-profile-form/edit-profile-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import { history } from '../../../services/history.js';
import { ASSET_URL } from '../../../services/urls.js';
import CustomSnackbar from '../../custom/CustomSnackbar.jsx';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { LocalizationProvider } from '@mui/x-date-pickers';
import dayjs from 'dayjs';

const GoBack = ({ role, newLinkId }) => {
const navigate = useNavigate();
Expand Down Expand Up @@ -151,7 +155,7 @@ const EditProfileForm = ({ role, newLinkId }) => {
initialValues={{
userId: data.user_id || '',
avatar: data.avatar || '',
free_at: '',
free_at: data?.free_at || dayjs(),
first_name: data?.first_name || user?.name?.split(' ')[0] || '',
last_name: data?.last_name || getPrefilledLastName(),
contacts: {
Expand Down Expand Up @@ -356,9 +360,29 @@ const EditProfileForm = ({ role, newLinkId }) => {
/>
</Box>
)}
{role === AUDITOR && (
<Box>
<Typography sx={rateLabel}>Free at</Typography>
<LocalizationProvider dateAdapter={AdapterDayjs}>
<Field
component={DatePicker}
name="free_at"
defaultValue={new Date()}
value={dayjs(values.free_at)}
sx={{ width: '100%' }}
inputFormat="DD-MM-YYYY"
onChange={e => {
const value = new Date(e);
setFieldValue('free_at', value.toString());
}}
disablePast
/>
</LocalizationProvider>
</Box>
)}
{matchSm && (
<TagsField
name="tags"
name="tags"
label="Tags"
size={matchXs ? 'small' : 'medium'}
/>
Expand Down
10 changes: 10 additions & 0 deletions src/pages/Public-profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import UserFeedbacks from '../components/UserFeedbacks.jsx';
import WalletConnectIcon from '../components/icons/WalletConnectIcon.jsx';
import { getPublicAuditsAuditor } from '../redux/actions/auditAction.js';
import ProjectCardList from '../components/Project-card-list.jsx';
import dayjs from 'dayjs';

const PublicProfile = ({ notFoundRedirect = true }) => {
const navigate = useNavigate();
Expand Down Expand Up @@ -211,6 +212,7 @@ const PublicProfile = ({ notFoundRedirect = true }) => {
}
}, [data, user]);


if (!data) {
return (
<Layout>
Expand Down Expand Up @@ -384,6 +386,14 @@ const PublicProfile = ({ notFoundRedirect = true }) => {
: 'Hidden'}
</Typography>
</Box>
{data.free_at && data?.kind?.toLowerCase() === AUDITOR?.toLowerCase() && (
<Box sx={infoWrapper}>
<span>Free at</span>
<Typography noWrap={true}>
{data.free_at ? dayjs(data.free_at).format('MM.DD.YYYY') : ''}
</Typography>
</Box>
)}
</Box>
</Box>

Expand Down