From 091e1ec3191ce2d596b6ad265bb0aafed02c99eb Mon Sep 17 00:00:00 2001 From: Pete Givens Date: Thu, 15 Mar 2018 11:18:45 -0500 Subject: [PATCH] fix(Divider): remove marginLeft from DOM element - fixes console warnings that Divider was throwing - removes invalid 'marginLeft' attribute - moves inset spacing logic into css --- src/components/Divider.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/Divider.js b/src/components/Divider.js index a9d5d0d0..9c69a1f9 100644 --- a/src/components/Divider.js +++ b/src/components/Divider.js @@ -2,18 +2,17 @@ import styled from 'styled-components'; export const Divider = styled.hr.attrs({ 'data-smc': 'Divider', - marginLeft: ({ inset }) => { - let realInset = inset; - if (typeof realInset === 'number') realInset = `${inset}px`; - if (!realInset) return '0px'; - return typeof realInset === 'string' ? realInset : '16px'; - }, })` border: none; - background-color: rgba(0, 0, 0, .12); + background-color: rgba(0, 0, 0, 0.12); height: 1px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px; - margin-left: ${props => props.marginLeft}; -`; + margin-left: ${({ inset }) => { + let realInset = inset; + if (typeof realInset === 'number') realInset = `${inset}px`; + if (!realInset) return '0px'; + return typeof realInset === 'string' ? realInset : '16px'; + }}; + `;