-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to change the cart trigger color #2220
Allow to change the cart trigger color #2220
Conversation
|
Hey @larsroettig, PRs w/o issues fall outside of our normal process, sorry we missed this. Looping in @awilcoxa so we can get this added to our internal queue and reviewed. |
@tjwiebell no problem maybe I need also to create an issue. Because it was only in slack requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor tweaks and this should be good to go.
const CartTrigger = props => { | ||
const { handleClick, itemCount } = useCartTrigger({ | ||
createCartMutation: CREATE_CART_MUTATION, | ||
getCartDetailsQuery: GET_CART_DETAILS_QUERY | ||
}); | ||
|
||
const iconColor = props.iconColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to destructure here. I can see how you probably just copied the code style from the line below, but that is the one exception to the rule. We like to reserve classes
for use in the component, so we do not destructure it off props.
const iconColor = props.iconColor; | |
const { iconColor } = props; |
const cartIcon = | ||
itemCount > 0 ? ( | ||
<Icon | ||
src={ShoppingCartIcon} | ||
attrs={{ | ||
fill: iconColor, | ||
stroke: iconColor | ||
}} | ||
/> | ||
) : ( | ||
<Icon | ||
src={ShoppingCartIcon} | ||
attrs={{ | ||
stroke: iconColor | ||
}} | ||
/> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're making changes, lets clean this up:
const cartIconAttributes = {
fill: itemCount ? iconColor : 'none',
stroke: iconColor
};
// down in the return
<Icon src={ShoppingCartIcon} attrs={cartIconAttributes} />
Hey @larsroettig, I know we're in some odd times, but wanted to check in on this PR. Happy to help push this across the finish line if need be. |
Hi Tommy, sorry this week is Crazy for me. I will finsh next week sorry
Tommy Wiebell <notifications@github.com> schrieb am Mo. 16. März 2020 um
17:41:
Hey @larsroettig <https://github.com/larsroettig>, I know we're in some
odd times, but wanted to check in on this PR. Happy to help push this
across the finish line if need be.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2220 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABILLGWRXCOQBA4F2EBONLLRHZJE5ANCNFSM4LCQASBA>
.
--
<https://www.techdivision.com>
*TechDivision GmbH*
Spinnereiinsel 3a
83059 Kolbermoor
*Lars Röttig*
Software Engineer
Magento Community Maintainer
Magento 2 Certified Professional Developer
Zend Certified PHP Engineer
Tel +49 8031 2210 55 0
Fax +49 8031 2210 55 22
------------------------------
Geschäftsführer: Josef und Stefan Willkommer, Tim Wagner
Handelsregister Nr. HRB 17123, Amtsgericht Traunstein
UStID gemäß § 27 a Umsatzsteuergesetz: DE249664276
|
@larsroettig - We'll finish this up internally, just keep the feedback in mind for future contributions. Thank you for this PR and helping answer questions in the Community Slack 😀 |
Description
Add property to allow to change checkout trigger icon color.
Related Issue
Acceptance
Verification Stakeholders
Specification
Verification Steps
Screenshots / Screen Captures (if appropriate)
Checklist