Skip to content

Commit

Permalink
IBX-9274: Context menu does not show up in 'Location' folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Dec 10, 2024
1 parent 81009e5 commit 66dea38
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
22 changes: 16 additions & 6 deletions src/bundle/Resources/public/scss/ui/modules/common/_spinner.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
@use 'sass:list';

.c-spinner {
@include spinner(calculateRem(26px), calculateRem(3px), $ibexa-color-primary);
$color-variants: (
'--primary': $ibexa-color-primary,
'--light': $ibexa-color-white,
);

&--small {
@include spinner(calculateRem(16px), calculateRem(2px), $ibexa-color-primary);
}
$size-variants: (
'--small': calculateRem(16px) calculateRem(2px),
'--large': calculateRem(86px) calculateRem(6px),
);

&--large {
@include spinner(calculateRem(86px), calculateRem(6px), $ibexa-color-primary);
@each $size-modifier, $sizes in $size-variants {
@each $color-modifier, $color in $color-variants {
&#{$size-modifier}.c-spinner#{$color-modifier} {
@include spinner(list.nth($sizes, 1), list.nth($sizes, 2), $color);
}
}
}
}
10 changes: 9 additions & 1 deletion src/bundle/ui-dev/src/modules/common/spinner/spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,29 @@ export const SIZES = {
LARGE: 'large',
};

const Spinner = ({ size }) => {
export const COLOR_VARIATNS = {
PRIMARY: 'primary',
LIGHT: 'light',
};

const Spinner = ({ size, colorVariant }) => {
const className = createCssClassNames({
'c-spinner': true,
[`c-spinner--${size}`]: true,
[`c-spinner--${colorVariant}`]: true,
});

return <div className={className} />;
};

Spinner.propTypes = {
size: PropTypes.oneOf(Object.values(SIZES)),
colorVariant: PropTypes.oneOf(Object.values(COLOR_VARIATNS)),
};

Spinner.defaultProps = {
size: SIZES.MEDIUM,
colorVariant: COLOR_VARIATNS.PRIMARY,
};

export default Spinner;
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,18 @@ final class LocationListDataVisitor extends AbstractLocationDataVisitor
public function visit(Visitor $visitor, Generator $generator, $data): void
{
$generator->startObjectElement('LocationList');
$generator->startList('locations');

foreach ($data->getLocationList() as $locationList) {
$generator->startList('locations');

$generator->startHashElement('locationWithPermissions');

$this->buildLocationNode($locationList['location'], $generator, $visitor);
$this->buildPermissionNode($locationList['permissions'], $generator);

$generator->endHashElement('locationWithPermissions');

$generator->endList('locations');
}

$generator->endList('locations');
$generator->endObjectElement('LocationList');
}
}

0 comments on commit 66dea38

Please sign in to comment.