From 67079d515f47e65cee1d9da31814b3ca5a91162a Mon Sep 17 00:00:00 2001 From: Dimitri Poilane Date: Tue, 6 Sep 2022 11:52:20 +0200 Subject: [PATCH] Use the resetButtonStyle prop to reset or not the styles passed --- src/components/SocialShareButton.tsx | 33 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/components/SocialShareButton.tsx b/src/components/SocialShareButton.tsx index 31b95dc..1cb8721 100644 --- a/src/components/SocialShareButton.tsx +++ b/src/components/SocialShareButton.tsx @@ -118,18 +118,27 @@ export default class SocialShareButton extends Component< }; render() { - const { children, forwardedRef, networkName, style, ...rest } = this.props; - - const newStyle = { - backgroundColor: 'transparent', - border: 'none', - padding: 0, - font: 'inherit', - color: 'inherit', - cursor: 'pointer', - outline: 'none', - ...style, - }; + const { + children, + forwardedRef, + networkName, + style, + resetButtonStyle, + ...rest + } = this.props; + + const newStyle = resetButtonStyle + ? { + backgroundColor: 'transparent', + border: 'none', + padding: 0, + font: 'inherit', + color: 'inherit', + cursor: 'pointer', + outline: 'none', + ...style, + } + : style; return (