Skip to content

Commit

Permalink
Merge pull request #813 from ita-social-projects/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MementoMorj authored Sep 24, 2023
2 parents 79f60a7 + eae0b41 commit 0812e96
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 225 deletions.
2 changes: 0 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" />

<script src="https://cdn.tiny.cloud/1/52o10bl0rwinf56ixjw1xrn873s4l89vuqogn3l69p3lbr1p/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
<!-- Google map API -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCr5712Z86_z29W9biaPj8DcaggjbUAy7M&libraries=places"></script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2RHY04JKG0"></script>
Expand Down
2 changes: 1 addition & 1 deletion src/app/common/components/TagList/TagList.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
.tagContainer {
@include mut.rem-margined(13px, 0, 0px, 0px);
@include mut.flexed($align-items: flex-start, $wrap: wrap, $gap: 5px);
max-height: f.pxToRem(82px);
overflow: hidden;
max-height: f.pxToRem(100px);

.tagItem {
height: f.pxToRem(38px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
padding: f.pxToRem(112px) f.pxToRem(10px) f.pxToRem(110px) f.pxToRem(10px);

@include mut.bg-image('@assets/images/partners/background.webp');
background-attachment: fixed;
background-size: contain;
background-position:bottom;

.wrapper{
max-width: f.pxToRem(1200px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,6 @@ const NewStreetcode = () => {
/>
<InterestingFactsBlock onChange={handleFieldChange} />
<TimelineBlockAdmin onChange={handleFieldChange} />

<MapBlockAdmin />
<ArtGalleryBlock arts={arts} setArts={setArts} onChange={handleFieldChange} />
<RelatedFiguresBlock currentStreetcodeId={parseId} figures={figures} setFigures={setFigures} onChange={handleFieldChange} />
<ForFansBlock onChange={handleFieldChange} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,43 +226,6 @@ const TextEditor = ({
setSelected(editor.selection.getContent());
}}
/>
<Button
className="streetcode-custom-button button-margin-vertical"
onClick={() => setModal('addTerm')}
>
Додати новий термін
</Button>
<FormItem label="Оберіть пов'язаний термін">
<AutoComplete
filterOption
onSelect={(value, option) => {
setTerm({ id: option.key, title: value });
}}
disabled={selected === ''}
onChange={onChange}
>
{getTermArray.map(
(t) => <Select.Option key={t.id} value={t.title}>{t.title}</Select.Option>,
)}
</AutoComplete>
</FormItem>
<div className="display-flex-row">
<Button
className="streetcode-custom-button button-margin-vertical button-margin-right"
onClick={handleAddRelatedWord}
disabled={selected === '' || term === undefined}
>
Пов&#39;язати
</Button>
<Button
onClick={handleDeleteRelatedWord}
disabled={selected === '' || term === undefined}
className="streetcode-custom-button button-margin-vertical"
>
Видалити пов&#39;язаний термін
</Button>
</div>
<AddTermModal handleAdd={handleAddSimple} term={term} setTerm={setTerm} />
</FormItem>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ const TextPreview = ({ inputInfo }: Props) => {
let buffer = inputInfo?.textContent?.replaceAll('\n', '').replaceAll('"', '`');
const content: TextPreviewContent = {
textContent: buffer ?? '',
};
TextsApi.updateParsed(content).then((x) => {
buffer = x?.replaceAll('`', '"').toString();
setText(buffer);
}).catch()
.finally(() => setLoading(false));
};
setText(buffer);
setLoading(false);
}
}, [disabled]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,26 @@ const NewTimelineModal: React.FC<NewTimelineModalProps> = observer(({ timelineIt
historicalContextStore.fetchHistoricalContextAll();
}, []);

const GetLocalHoursOffset = (date: Date) => -1 * date.getTimezoneOffset() / 60;
const GetLocalMinutesOffset = (date: Date) => -1 * date.getTimezoneOffset();

const GetDateBasedOnFormat = (date: Date) => {
let seconds = 0;
// specific GMT+202 Ukraine timezone before 1/5/1924, where seconds are truncated by browser
if(GetLocalMinutesOffset(date) == 122)
{
seconds = 4;
}
date.setHours(0, GetLocalMinutesOffset(date), seconds, 0);
switch (dateTimePickerType) {
case 'date':
date.setHours(GetLocalHoursOffset(date), 0, 0, 0);
return date.toISOString();
case 'month':
case 'season-year':
date.setDate(1);
date.setHours(GetLocalHoursOffset(date), 0, 0, 0);
return date.toISOString();
case 'year':
date.setMonth(0);
date.setDate(1);
date.setHours(GetLocalHoursOffset(date), 0, 0, 0);
return date.toISOString();
default:
throw new Error('Invalid date.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,65 +100,65 @@ const StreetcodeCard = ({ streetcode, setActiveTagId, setActiveBlock }: Props) =
</div>
</div>
<div className="rightSider">
<div className="headerContainer">
<div className="upper-info">
<div className="streetcodeIndex">
Стріткод #
{streetcode?.index ?? 0 <= 9999 ? `000${streetcode?.index}`.slice(-4)
: streetcode?.index}
</div>
<h2 className="streetcodeTitle">
{streetcode?.title}
</h2>
<div className="streetcodeDate">
{streetcode?.dateString}
</div>
<TagList
tags={streetcode?.tags.filter((tag: StreetcodeTag) => tag.isVisible)}
setActiveTagId={setActiveTagId}
setActiveTagBlock={setActiveBlock}
/>
<p className="teaserBlock">
{streetcode?.teaser}
</p>
</div>

<div className="cardFooter">
{audio?.base64 && audioIsLoaded
? (
<Button
type="primary"
className= {"audioBtn audioBtnActive"}
onClick={() => {
setModal('audio');
audioClickEvent(streetcode?.id ?? 0);
}}
>
<PlayCircleFilled className="playCircle" />
<span>Прослухати текст</span>
</Button>
)
: (
<Button
disabled
type="primary"
className="audioBtn"
>
<span>Аудіо на підході</span>
</Button>
)}

{arlink
? (
<Button
className="animateFigureBtn"
onClick={() => personLiveEvent(streetcode?.id ?? 0)}
>
<a href="#QRBlock">Оживити картинку</a>
</Button>
)
: <></>}
</div>
<div className="streetcodeIndex">
Стріткод #
{streetcode?.index ?? 0 <= 9999 ? `000${streetcode?.index}`.slice(-4)
: streetcode?.index}
</div>
<h2 className="streetcodeTitle">
{streetcode?.title}
</h2>
<div className="streetcodeDate">
{streetcode?.dateString}
</div>
<div className="tagListWrapper">
<TagList
tags={streetcode?.tags.filter((tag: StreetcodeTag) => tag.isVisible)}
setActiveTagId={setActiveTagId}
setActiveTagBlock={setActiveBlock}
/>
</div>
<p className="teaserBlock">
{streetcode?.teaser}
{streetcode?.teaser}
{streetcode?.teaser}
</p>

<div className="cardFooter">
{audio?.base64 && audioIsLoaded
? (
<Button
type="primary"
className={"audioBtn audioBtnActive"}
onClick={() => {
setModal('audio');
audioClickEvent(streetcode?.id ?? 0);
}}
>
<PlayCircleFilled className="playCircle" />
<span>Прослухати текст</span>
</Button>
)
: (
<Button
disabled
type="primary"
className="audioBtn"
>
<span>Аудіо на підході</span>
</Button>
)}

{arlink
? (
<Button
className="animateFigureBtn"
onClick={() => personLiveEvent(streetcode?.id ?? 0)}
>
<a href="#QRBlock">Оживити картинку</a>
</Button>
)
: <></>}
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 0812e96

Please sign in to comment.