Skip to content

Commit

Permalink
Update master (#1052)
Browse files Browse the repository at this point in the history
* 868 search the "no results" message always appears (#1023)

* fixed popover styles

* fixed the No results message styles

* hide the No results message during the query execution

* Fixed partner modal save button for editing (#1051)

* fix news title height and add more lines to main text on the news card (#1050)

* fix third card(for connections) on streetcode page (#1015)

fix third card(for connections) on streetcode page

* Changed streetcode datestring length to 100 (#1036)

---------

Co-authored-by: BohdanBybliv <[email protected]>
Co-authored-by: mykola-krai <[email protected]>
Co-authored-by: Oleh-Kril <[email protected]>
Co-authored-by: Kateryna Yatsiuk <[email protected]>
  • Loading branch information
5 people authored Dec 7, 2023
1 parent cba4178 commit fae8657
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const DatePickerPart = React.memo(({ setFirstDate, setSecondDate, form, onChange
<Input
disabled={disableInput}
showCount
maxLength={50}
maxLength={100}
onChange={(e) => setDateString(e.target.value)}
value={dateString}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const PartnerModal: React.FC< {
isStreetcodeVisible = true,
afterSubmit,
}) => {
// eslint-disable-next-line max-len
const URL_REGEX_VALIDATION_PATTERN = /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,256}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/;
const [form] = Form.useForm();
const [urlTitleEnabled, setUrlTitleEnabled] = useState<string>('');
Expand Down Expand Up @@ -85,6 +86,16 @@ const PartnerModal: React.FC< {
useEffect(() => {
if (partnerItem && open) {
imageId.current = partnerItem.logoId;
setFileList([{
name: '',
thumbUrl: base64ToUrl(
partnerItem.logo?.base64,
partnerItem.logo?.mimeType,
),
uid: partnerItem.logoId.toString(),
status: 'done',
}]);

form.setFieldsValue({
title: partnerItem.title,
isKeyPartner: partnerItem.isKeyPartner,
Expand Down Expand Up @@ -125,7 +136,7 @@ const PartnerModal: React.FC< {
try {
const values = await form.validateFields();
form.submit();
message.success("Партнера успішно додано!", 2)
message.success('Партнера успішно додано!', 2);
} catch (error) {
message.config({
top: 100,
Expand All @@ -151,9 +162,9 @@ const PartnerModal: React.FC< {
setFileList([]);
};

const closeModal =() => {
const closeModal = () => {
setIsModalOpen(false);
}
};

const onSuccesfulSubmitLinks = (formValues: any) => {
const url = formValues.url as string;
Expand Down Expand Up @@ -283,9 +294,11 @@ const PartnerModal: React.FC< {
onCancel={closeModal}
className="modalContainer"
footer={null}
closeIcon={<Popover content="Внесені зміни не будуть збережені!" trigger='hover'>
<CancelBtn className='iconSize' onClick={closeAndCleanData} />
</Popover>}
closeIcon={(
<Popover content="Внесені зміни не будуть збережені!" trigger="hover">
<CancelBtn className="iconSize" onClick={closeAndCleanData} />
</Popover>
)}
>
<div className="modalContainer-content">
<Form
Expand Down Expand Up @@ -333,7 +346,7 @@ const PartnerModal: React.FC< {
label="Посилання: "
rules={[
{
pattern: URL_REGEX_VALIDATION_PATTERN ,
pattern: URL_REGEX_VALIDATION_PATTERN,
message: 'Введіть правильне посилання',
},
]}
Expand Down Expand Up @@ -386,21 +399,6 @@ const PartnerModal: React.FC< {
onSuccessUpload={(image: Image | Audio) => {
imageId.current = image.id;
}}
defaultFileList={
partnerItem
? [
{
name: '',
thumbUrl: base64ToUrl(
partnerItem.logo?.base64,
partnerItem.logo?.mimeType,
),
uid: partnerItem.logoId.toString(),
status: 'done',
},
]
: []
}
>
<p>Виберіть чи перетягніть файл</p>
</FileUploader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
height: 100%;

@include textCard.cardText(
$title-max-lines: 2,
$text-max-lines: 3);
$title-max-lines: 1,
$text-max-lines: 4);

.cardTextContainer{
padding: 0;
Expand All @@ -121,7 +121,11 @@

&Title{
@include mut.with-font(ft.$closer-text-font, $font-weight: 500, $font-size: 36px);
line-height: f.pxToRem(38px);
line-height: f.pxToRem(47.5px);

@media (min-width: 360px) and (max-width: 767px) {
@include mut.truncated(2);
}

@media (max-width: 1024px) {
font-size: f.pxToRem(20px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,42 +107,30 @@ const StreetcodeCard = ({ streetcode, setActiveTagId, setActiveBlock }: Props) =
swipeOnClick
infinite
>
{images.map((image, index) => {
if (images.length > 1 && index === 0) {
return (
<div>
<img
key={images[index].id}
src={base64ToUrl(images[index].base64, images[index].mimeType)}
className="streetcodeImgColored"
style={{ objectFit: 'contain' }}
alt={images[index].imageDetails?.alt}
/>
<img
key={images[index + 1].id}
src={base64ToUrl(
images[index + 1].base64,
images[index + 1].mimeType,
)}
className="streetcodeImgGrey"
style={{ objectFit: 'contain' }}
alt={images[index].imageDetails?.alt}
/>
</div>
);
}

return (
<img
key={image.id}
src={base64ToUrl(image.base64, image.mimeType)}
className="streetcodeImg"
style={{ objectFit: 'contain' }}
alt={image.imageDetails?.alt}
/>
);
})}

<div>
<img
key={images[0].id}
src={base64ToUrl(images[0].base64, images[0].mimeType)}
className="streetcodeImgColored"
style={{ objectFit: 'contain' }}
alt={images[0].imageDetails?.alt}
/>
<img
key={images[1].id}
src={base64ToUrl(images[1].base64, images[1].mimeType)}
className="streetcodeImgGrey"
style={{ objectFit: 'contain' }}
alt={images[1].imageDetails?.alt}
/>
</div>

<img
key={images[1].id}
src={base64ToUrl(images[1].base64, images[1].mimeType)}
className="streetcodeImg"
style={{ objectFit: 'contain' }}
alt={images[1].imageDetails?.alt}
/>
</BlockSlider>
</div>
</div>
Expand Down

0 comments on commit fae8657

Please sign in to comment.