Skip to content

Commit

Permalink
Merge pull request #889 from BinaryStudioAcademy/fix/bt-887-chat-layo…
Browse files Browse the repository at this point in the history
…ut-fix

bt-887: * layout-fixes
  • Loading branch information
nikita-remeslov authored Sep 30, 2023
2 parents 5f6771a + 19d935a commit 1e609bc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

& .forgot {
width: unset;
color: var(--st-tropaz);
font-size: var(--font-size-body);
text-decoration: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ const CompanyEmployer: React.FC<Properties> = ({
<FormControl className={styles.hireCandidates}>
{!talentIsHired && (
<>
<Typography variant="label">
Have the company hired you?
<Typography
variant="label"
className={styles.hireRadioLabel}
>
Has the company hired you?
</Typography>
<RadioGroup
control={control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,16 @@
padding: 5px;
text-align: center;
}

.radio {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-bottom: 10px;
}

.hireRadioLabel {
margin-top: 20px;
text-align: center;
}
6 changes: 5 additions & 1 deletion frontend/src/helpers/parse-messages.helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ import { Tooltip } from '~/bundles/common/components/components.js';
const URL_REGEX =
/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/|www\.|localhost:)?(localhost|[\da-z]+([.-][\da-z]+)*\.[a-z]{2,5}(:\d{1,5})?(\/.*)?)$/gm;

const GENERAL_LINK_REGEX = /^http:\/\/.*$/gm;

const parseMessage = (message: string): JSX.Element => {
const words = message.split(' ');
return (
<span>
{words.map((word) => {
const [link, specialPrefix] = word.split('_&_').reverse();
const isLink = URL_REGEX.test(link);
const isLink =
URL_REGEX.test(link) || GENERAL_LINK_REGEX.test(link);

const isCVLink = isLink && specialPrefix === 'CV';
const isProfileLink = isLink && specialPrefix === 'Profile';
const isVacancyPosition =
Expand Down

0 comments on commit 1e609bc

Please sign in to comment.