Skip to content

Commit

Permalink
fix url and add form settings
Browse files Browse the repository at this point in the history
  • Loading branch information
corlard3y committed Dec 17, 2024
1 parent 3be37ea commit 776b079
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
11 changes: 10 additions & 1 deletion src/components/UserProfileSettings/AddTelegram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { appConfig } from 'config';
import { Box, Link, Modal, Telegram, Text, TextInput } from 'blocks';
import { shortenText } from 'helpers/UtilityHelper';
import { useTelegramFormik } from './AddTelegram.form';
import { css } from 'styled-components';

type AddTelegramProps = {
modalControl: ModalResponse;
Expand Down Expand Up @@ -232,7 +233,10 @@ const AddTelegram: FC<AddTelegramProps> = ({
Step 2: Visit the link and paste the code
</Text>

<Box margin="spacing-xs spacing-none">
<Box
margin="spacing-xs spacing-none"
width="100%"
>
<Link
to={appConfig?.telegramExternalURL}
target="_blank"
Expand All @@ -242,6 +246,11 @@ const AddTelegram: FC<AddTelegramProps> = ({
textAlign: 'center',
color: 'text-brand-medium',
}}
css={css`
overflow: auto;
word-wrap: break-word;
width: 100%;
`}
>
{appConfig?.telegramExternalURL}
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getRequiredFieldMessage } from 'common';

// Define Formik initial values type
type FormValues = {
displayName: string | null;
displayName: string;
picture: string | null;
desc: string | null;
};
Expand Down
14 changes: 12 additions & 2 deletions src/components/UserProfileSettings/UserProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,18 @@ const UserProfileSettings: FC<UserProfileSettingsType> = ({ setErrorMessage, set
label="Display Name"
value={userFormik.values.displayName as string}
onChange={userFormik.handleChange('displayName')}
error={userFormik.touched.displayName && Boolean(userFormik.errors.displayName)}
errorMessage={userFormik.touched.displayName ? userFormik.errors.displayName : ''}
error={
userFormik.submitCount > 0 && !userFormik.values.displayName
? true // Required error on submit
: userFormik.values.displayName.length > 50 // Length error during typing
}
errorMessage={
userFormik.submitCount > 0 && !userFormik.values.displayName
? 'Display Name is required'
: userFormik.values.displayName.length > 50
? 'Display Name cannot exceed 50 characters'
: ''
}
totalCount={50}
/>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/config/config-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const config = {
},

// social media integration
telegramExternalURL: 'https://t.me/PushCommDevBot',
telegramExternalURL: 'https://web.telegram.org/k/#@PushCommDevBot',
discordExternalURL: null,
};

Expand Down
2 changes: 1 addition & 1 deletion src/config/config-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const config = {
},

// social media integration
telegramExternalURL: 'https://t.me/PushCommBot',
telegramExternalURL: 'https://web.telegram.org/k/#@PushCommBot',
discordExternalURL: null,
};

Expand Down

0 comments on commit 776b079

Please sign in to comment.