mirror of
https://github.com/fergalmoran/onearmy-community-platform.git
synced 2025-12-22 09:37:54 +00:00
feat: add (disabled) username field
This commit is contained in:
@@ -6,6 +6,10 @@ export const commonStyles = {
|
||||
outline: 'none',
|
||||
boxShadow: 'none',
|
||||
},
|
||||
'&:disabled': {
|
||||
color: 'lightgrey',
|
||||
cursor: 'not-allowed',
|
||||
},
|
||||
},
|
||||
colors: {
|
||||
white: 'white',
|
||||
|
||||
@@ -100,6 +100,7 @@ export const SettingsPageUserProfile = () => {
|
||||
const initialValues = {
|
||||
profileType: user?.profileType || ProfileType.MEMBER,
|
||||
displayName: user?.displayName || null,
|
||||
userName: user?.userName,
|
||||
links,
|
||||
location: user?.location || null,
|
||||
about: user?.about || null,
|
||||
|
||||
@@ -25,7 +25,7 @@ interface IProps {
|
||||
export const UserInfosSection = ({ formValues }: IProps) => {
|
||||
const { profileType, links, location } = formValues
|
||||
const isMemberProfile = profileType === ProfileType.MEMBER
|
||||
const { about, country, displayName } = fields
|
||||
const { about, country, displayName, userName } = fields
|
||||
|
||||
const noMapPin = !location?.latlng
|
||||
|
||||
@@ -36,6 +36,21 @@ export const UserInfosSection = ({ formValues }: IProps) => {
|
||||
sx={{ flexDirection: 'column', gap: [3, 5] }}
|
||||
>
|
||||
<Heading as="h2">{headings.infos}</Heading>
|
||||
<Flex sx={{ flexDirection: 'column', gap: 1 }}>
|
||||
<Text>{`${userName.title} *`}</Text>
|
||||
<Text variant="quiet" sx={{ fontSize: 2 }}>
|
||||
{userName.description}
|
||||
</Text>
|
||||
<Field
|
||||
data-cy="userName"
|
||||
name="userName"
|
||||
component={FieldInput}
|
||||
validate={required}
|
||||
validateFields={[]}
|
||||
disabled
|
||||
/>
|
||||
</Flex>
|
||||
|
||||
<Flex sx={{ flexDirection: 'column', gap: 1 }}>
|
||||
<Text>{`${displayName.title} *`}</Text>
|
||||
<Text variant="quiet" sx={{ fontSize: 2 }}>
|
||||
|
||||
@@ -126,6 +126,11 @@ export const fields: ILabels = {
|
||||
repeatNewPassword: {
|
||||
title: 'Repeat new password',
|
||||
},
|
||||
userName: {
|
||||
title: 'Username',
|
||||
description:
|
||||
"You set this when you signed up and it can't be changed now. Sorry.",
|
||||
},
|
||||
workspaceType: {
|
||||
description: 'What kind of Precious Plastic workspace do you run?',
|
||||
error: 'Please select your workspace type',
|
||||
|
||||
Reference in New Issue
Block a user