Review changes

This commit is contained in:
Vesa Luusua 2017-08-30 15:58:09 +03:00
parent da90c16fa6
commit 207de46ec6
3 changed files with 24 additions and 43 deletions

View file

@ -1,5 +1,15 @@
@import '../../marketplace.css';
:root {
--coverEverything: {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
.root {
/* Layout */
display: flex;
@ -14,20 +24,12 @@
.menuOverlayWrapper {
/* Positioning */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
@apply --coverEverything;
}
.menuOverlay {
/* Positioning */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
@apply --coverEverything;
/* Overlay */
background-color: var(--matterColorAnti);
@ -37,6 +39,8 @@
}
.menuOverlayContent {
/* Positioning */
@apply --coverEverything;
/* Fonts */
@apply --marketplaceH4FontStyles;
font-weight: var(--fontWeightSemiBold);
@ -50,13 +54,6 @@
margin-bottom: 0;
opacity: 0;
/* Positioning */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
@media (--viewportMedium) {
font-weight: var(--fontWeightSemiBold);
margin-top: 0;
@ -97,11 +94,7 @@
.rootForImage {
/* Layout - image will take space defined by aspect ratio wrapper */
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
@apply --coverEverything;
width: 100%;
border-radius: 2px;
}
@ -285,22 +278,14 @@
.loadingOverlayWrapper,
.closedOverlayWrapper {
/* Position: cover everything */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
/* Positioning */
@apply --coverEverything;
}
.loadingOverlay,
.closedOverlay {
/* Position: cover everything */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
/* Positioning */
@apply --coverEverything;
/* Overlay background style */
background-color: var(--matterColorLight);
@ -312,12 +297,8 @@
@apply --marketplaceTinyFontStyles;
color: var(--matterColor);
/* Position: cover everything */
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
/* Positioning */
@apply --coverEverything;
/* Layout */
display: flex;

View file

@ -40,7 +40,8 @@ class Menu extends Component {
this.state = { isOpen: false };
const { isOpen, onToggleActive } = props;
if ((isOpen !== null || onToggleActive !== null) && !isControlledMenu(isOpen, onToggleActive)) {
const isIndependentMenu = isOpen === null && onToggleActive === null;
if (!(isIndependentMenu || isControlledMenu(isOpen, onToggleActive))) {
throw new Error(
`Menu has invalid props:
Both isOpen and onToggleActive need to be defined (controlled menu),

View file

@ -231,6 +231,7 @@ export const queryListingsError = e => ({
payload: e,
});
// Throwing error for new (loadData may need that info)
export const queryOwnListings = queryParams =>
(dispatch, getState, sdk) => {
dispatch(queryListingsRequest(queryParams));
@ -263,7 +264,6 @@ export const closeListing = listingId =>
})
.catch(e => {
dispatch(closeListingError(e));
throw e;
});
};
@ -279,6 +279,5 @@ export const openListing = listingId =>
})
.catch(e => {
dispatch(openListingError(e));
throw e;
});
};