From 0944d2d9ed82cf479ea4546019e706a3343b112c Mon Sep 17 00:00:00 2001
From: dan <dan.abramov@gmail.com>
Date: Thu, 8 Feb 2024 19:50:57 +0000
Subject: Add composer button to Notifications (#2806)

---
 src/view/screens/Notifications.tsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'src/view/screens/Notifications.tsx')

diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx
index 03f0a8f61..48c834a28 100644
--- a/src/view/screens/Notifications.tsx
+++ b/src/view/screens/Notifications.tsx
@@ -29,6 +29,9 @@ import {listenSoftReset, emitSoftReset} from '#/state/events'
 import {truncateAndInvalidate} from '#/state/queries/util'
 import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
 import {isNative} from '#/platform/detection'
+import {FAB} from '../com/util/fab/FAB'
+import {ComposeIcon2} from 'lib/icons'
+import {useComposerControls} from '#/state/shell/composer'
 
 type Props = NativeStackScreenProps<
   NotificationsTabNavigatorParams,
@@ -47,6 +50,7 @@ export function NotificationsScreen({}: Props) {
   const unreadApi = useUnreadNotificationsApi()
   const hasNew = !!unreadNotifs
   const isScreenFocused = useIsFocused()
+  const {openComposer} = useComposerControls()
 
   // event handlers
   // =
@@ -156,6 +160,14 @@ export function NotificationsScreen({}: Props) {
           showIndicator={hasNew}
         />
       )}
+      <FAB
+        testID="composeFAB"
+        onPress={() => openComposer({})}
+        icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />}
+        accessibilityRole="button"
+        accessibilityLabel={_(msg`New post`)}
+        accessibilityHint=""
+      />
     </View>
   )
 }
-- 
cgit 1.4.1

