diff --git a/src/bubble-input.tsx b/src/bubble-input.tsx index f1fb629..df827e7 100644 --- a/src/bubble-input.tsx +++ b/src/bubble-input.tsx @@ -15,7 +15,13 @@ interface BubbleInputProps { strokeColour: string } -const BubbleInput = ({ onChange, onSubmit, value, fillColour, strokeColour }: BubbleInputProps) => { +const BubbleInput = ({ + onChange, + onSubmit, + value, + fillColour, + strokeColour +}: BubbleInputProps) => { const refEditable = useRef(null) const refContainer = useRef(null) const [submitted, setSubmitted] = useState(false) @@ -48,22 +54,24 @@ const BubbleInput = ({ onChange, onSubmit, value, fillColour, strokeColour }: Bu useEffect(handleBlur, [handleBlur]) return ( -
+
onChange(e.currentTarget.innerText)} - /> + ref={refContainer} + className={`bubble input ${value.length === 0 ? 'empty' : ''} ${ + submitted ? 'submitted' : '' + }`} + > +
onChange(e.currentTarget.innerText)} + /> +
) } diff --git a/src/bubble.css b/src/bubble.css index b7a4f9a..71523aa 100644 --- a/src/bubble.css +++ b/src/bubble.css @@ -2,7 +2,10 @@ width: 100%; color: var(--bubble-color); } - +.bubble-container { + height: 200px; + width: 100%; +} .bubble-content { background-color: var(--background-color); border-radius: 30px; @@ -34,10 +37,10 @@ .bubble:last-child .bubble-content:after, .bubble:nth-last-child(2) .bubble-content:after { - background: #00a000!important; + background: #00a000 !important; border-bottom-right-radius: 15px; bottom: 0; - content: ""; + content: ''; height: 27px; left: -15px; position: absolute; diff --git a/src/chat.css b/src/chat.css index f39d36e..e4d602c 100644 --- a/src/chat.css +++ b/src/chat.css @@ -1,6 +1,6 @@ .chat { padding-left: 86px; - padding-bottom: 200px; + padding-bottom: 50px; display: flex; flex-flow: column wrap;