From bbf049d477817f745b26887612ed68e0ae00daf3 Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Mon, 12 Feb 2024 21:13:42 -0600
Subject: Remove invites code UI (#2851)

* Hide invite codes UI, comment in settings

* Just comment out
---
 src/view/shell/Drawer.tsx | 55 +----------------------------------------------
 1 file changed, 1 insertion(+), 54 deletions(-)

(limited to 'src/view/shell/Drawer.tsx')

diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx
index 62a6b9040..2a37d1fe9 100644
--- a/src/view/shell/Drawer.tsx
+++ b/src/view/shell/Drawer.tsx
@@ -44,12 +44,10 @@ import {formatCountShortOnly} from 'view/com/util/numeric/format'
 import {Trans, msg} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
 import {useSetDrawerOpen} from '#/state/shell'
-import {useModalControls} from '#/state/modals'
 import {useSession, SessionAccount} from '#/state/session'
 import {useProfileQuery} from '#/state/queries/profile'
 import {useUnreadNotifications} from '#/state/queries/notifications/unread'
 import {emitSoftReset} from '#/state/events'
-import {useInviteCodesQuery} from '#/state/queries/invites'
 import {NavSignupCard} from '#/view/shell/NavSignupCard'
 import {TextLink} from '../com/util/Link'
 
@@ -228,8 +226,7 @@ let DrawerContent = ({}: {}): React.ReactNode => {
 
           {hasSession ? (
             <>
-              <InviteCodes />
-              <View style={{height: 10}} />
+              <View style={{height: 16}} />
               <SearchMenuItem isActive={isAtSearch} onPress={onPressSearch} />
               <HomeMenuItem isActive={isAtHome} onPress={onPressHome} />
               <NotificationsMenuItem
@@ -621,56 +618,6 @@ function MenuItem({
   )
 }
 
-let InviteCodes = ({}: {}): React.ReactNode => {
-  const {track} = useAnalytics()
-  const setDrawerOpen = useSetDrawerOpen()
-  const pal = usePalette('default')
-  const {data: invites} = useInviteCodesQuery()
-  const invitesAvailable = invites?.available?.length ?? 0
-  const {openModal} = useModalControls()
-  const {_} = useLingui()
-
-  const onPress = React.useCallback(() => {
-    track('Menu:ItemClicked', {url: '#invite-codes'})
-    setDrawerOpen(false)
-    openModal({name: 'invite-codes'})
-  }, [openModal, track, setDrawerOpen])
-
-  return (
-    <TouchableOpacity
-      testID="menuItemInviteCodes"
-      style={styles.inviteCodes}
-      onPress={onPress}
-      accessibilityRole="button"
-      accessibilityLabel={_(msg`Invite codes: ${invitesAvailable} available`)}
-      accessibilityHint={_(msg`Opens list of invite codes`)}
-      disabled={invites?.disabled}>
-      <FontAwesomeIcon
-        icon="ticket"
-        style={[
-          styles.inviteCodesIcon,
-          invitesAvailable > 0 ? pal.link : pal.textLight,
-        ]}
-        size={18}
-      />
-      <Text
-        type="lg-medium"
-        style={invitesAvailable > 0 ? pal.link : pal.textLight}>
-        {invites?.disabled ? (
-          <Trans>
-            Your invite codes are hidden when logged in using an App Password
-          </Trans>
-        ) : invitesAvailable === 1 ? (
-          <Trans>{invitesAvailable} invite code available</Trans>
-        ) : (
-          <Trans>{invitesAvailable} invite codes available</Trans>
-        )}
-      </Text>
-    </TouchableOpacity>
-  )
-}
-InviteCodes = React.memo(InviteCodes)
-
 const styles = StyleSheet.create({
   view: {
     flex: 1,
-- 
cgit 1.4.1

