From a84a14d0843daa52b11576bb41cc38b2f15a0656 Mon Sep 17 00:00:00 2001
From: Hailey <me@haileyok.com>
Date: Thu, 16 May 2024 14:23:02 -0700
Subject: [🐴] Input hover and focus styles (#4064)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* styles for native input

* web focus/hover

* nit
---
 .../Messages/Conversation/MessageInput.web.tsx     | 26 +++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

(limited to 'src/screens/Messages/Conversation/MessageInput.web.tsx')

diff --git a/src/screens/Messages/Conversation/MessageInput.web.tsx b/src/screens/Messages/Conversation/MessageInput.web.tsx
index 335322fac..ba41cc23c 100644
--- a/src/screens/Messages/Conversation/MessageInput.web.tsx
+++ b/src/screens/Messages/Conversation/MessageInput.web.tsx
@@ -12,6 +12,7 @@ import {
 } from '#/state/messages/message-drafts'
 import * as Toast from '#/view/com/util/Toast'
 import {atoms as a, useTheme} from '#/alf'
+import {useSharedInputStyles} from '#/components/forms/TextField'
 import {PaperPlane_Stroke2_Corner0_Rounded as PaperPlane} from '#/components/icons/PaperPlane'
 
 export function MessageInput({
@@ -25,6 +26,10 @@ export function MessageInput({
   const {getDraft, clearDraft} = useMessageDraft()
   const [message, setMessage] = React.useState(getDraft)
 
+  const inputStyles = useSharedInputStyles()
+  const [isFocused, setIsFocused] = React.useState(false)
+  const [isHovered, setIsHovered] = React.useState(false)
+
   const onSubmit = React.useCallback(() => {
     if (message.trim() === '') {
       return
@@ -63,11 +68,20 @@ export function MessageInput({
       <View
         style={[
           a.flex_row,
-          a.px_sm,
-          a.pl_md,
           t.atoms.bg_contrast_25,
-          {borderRadius: 23},
-        ]}>
+          {
+            paddingHorizontal: a.p_sm.padding - 2,
+            paddingLeft: a.p_md.padding - 2,
+            borderWidth: 2,
+            borderRadius: 23,
+            borderColor: 'transparent',
+          },
+          isHovered && inputStyles.chromeHover,
+          isFocused && inputStyles.chromeFocus,
+        ]}
+        // @ts-expect-error web only
+        onMouseEnter={() => setIsHovered(true)}
+        onMouseLeave={() => setIsHovered(false)}>
         <TextareaAutosize
           style={StyleSheet.flatten([
             a.flex_1,
@@ -87,6 +101,8 @@ export function MessageInput({
           value={message}
           dirName="ltr"
           autoFocus={true}
+          onFocus={() => setIsFocused(true)}
+          onBlur={() => setIsFocused(false)}
           onChange={onChange}
           onKeyDown={onKeyDown}
         />
@@ -101,7 +117,7 @@ export function MessageInput({
             {
               height: 30,
               width: 30,
-              marginTop: 6,
+              marginTop: 5,
               backgroundColor: t.palette.primary_500,
             },
           ]}
-- 
cgit 1.4.1

