Skip to content

Commit

Permalink
IBX-8722: Added Bookmarsk to Image Picker (#1323)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti authored Sep 17, 2024
1 parent d01569c commit 2dc387b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 41 deletions.
1 change: 1 addition & 0 deletions src/bundle/Resources/public/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import 'mixins/containers';
@import 'mixins/drag-and-drop';
@import 'mixins/spinner';
@import 'mixins/tab-selector';

@mixin datetime-field() {
&.is-invalid {
Expand Down
43 changes: 43 additions & 0 deletions src/bundle/Resources/public/scss/mixins/_tab-selector.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@mixin tab-selector {
&__item {
height: calculateRem(48px);
width: calculateRem(48px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-radius: $ibexa-border-radius;
margin: calculateRem(12px) calculateRem(8px) calculateRem(24px);
position: relative;

.ibexa-icon {
fill: $ibexa-color-black;
}

&--selected {
background-color: $ibexa-color-light-400;

.ibexa-icon {
fill: $ibexa-color-black;
}
}

&:not(:first-of-type) {
&::before {
content: '';
position: absolute;
top: calculateRem(-12px);
left: calculateRem(12px);
height: calculateRem(1.5px);
width: calculateRem(24px);
background-color: $ibexa-color-dark-200;
}
}

&:hover {
.ibexa-icon {
fill: $ibexa-color-primary;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
.c-tab-selector {
&__item {
height: calculateRem(48px);
width: calculateRem(48px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-radius: $ibexa-border-radius;
margin: calculateRem(12px) calculateRem(8px) calculateRem(24px);
position: relative;

.ibexa-icon {
fill: $ibexa-color-black;
}

&--selected {
background-color: $ibexa-color-light-400;

.ibexa-icon {
fill: $ibexa-color-black;
}
}

&:not(:first-of-type) {
&:before {
content: '';
position: absolute;
top: calculateRem(-12px);
left: calculateRem(12px);
height: calculateRem(1.5px);
width: calculateRem(24px);
background-color: $ibexa-color-dark-200;
}
}

&:hover {
.ibexa-icon {
fill: $ibexa-color-primary;
}
}
}
@include tab-selector();
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const useSearchByQueryFetch = () => {
contentNameCriterion = null,
dateCriterion = null,
useAlwaysAvailable = true,
isBookmarked = null,
) => {
const handleFetch = (response) => {
dispatchLoadedLocationsAction({ type: 'CLEAR_LOCATIONS' });
Expand Down Expand Up @@ -81,6 +82,10 @@ export const useSearchByQueryFetch = () => {
query.DateMetadataCriterion = dateCriterion;
}

if (isBookmarked) {
query.IsBookmarkedCriterion = true;
}

const isImageCriterionDataEmpty = !imageCriterionData || Object.keys(imageCriterionData).length === 0;

if (!isImageCriterionDataEmpty) {
Expand Down

0 comments on commit 2dc387b

Please sign in to comment.