From c0fa1160ae032dccfe41bf695736a8e3efd5cca8 Mon Sep 17 00:00:00 2001 From: Lei Nelissen Date: Tue, 17 May 2022 23:05:45 +0200 Subject: [PATCH] Make padding-left optional on textinput --- src/components/Input.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 85e2794..4efdb95 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -1,10 +1,13 @@ -import styled from 'styled-components/native'; +import styled, { css } from 'styled-components/native'; -const Input = styled.TextInput` +const Input = styled.TextInput<{ icon?: boolean }>` margin: 10px 0; border-radius: 8px; padding: 15px; - padding-left: 40px; + + ${(props) => props.icon && css` + padding-left: 40px; + `} `; export default Input; \ No newline at end of file