@@ -18,12 +18,9 @@ import { display } from 'styled-system';
1818import { expenseSubmissionAllowed , getContributeRoute , isIndividualAccount } from '../../lib/collective' ;
1919import { getFilteredSectionsForCollective , isSectionEnabled } from '../../lib/collective-sections' ;
2020import { CollectiveType } from '../../lib/constants/collectives' ;
21- import { isSupportedExpenseType } from '../../lib/expenses' ;
2221import { gql } from '../../lib/graphql/helpers' ;
23- import { ExpenseType } from '../../lib/graphql/types/v2/graphql' ;
2422import useGlobalBlur from '../../lib/hooks/useGlobalBlur' ;
2523import useLoggedInUser from '../../lib/hooks/useLoggedInUser' ;
26- import { PREVIEW_FEATURE_KEYS } from '../../lib/preview-features' ;
2724import { getCollectivePageRoute , getDashboardRoute } from '../../lib/url-helpers' ;
2825import theme from '@/lib/theme' ;
2926
@@ -326,14 +323,7 @@ const getDefaultCallsToActions = (collective, sections, isAdmin, LoggedInUser, i
326323/**
327324 * Returns the main CTA that should be displayed as a button outside of the action menu in this component.
328325 */
329- const getMainAction = (
330- collective ,
331- callsToAction ,
332- LoggedInUser ,
333- isNewExpenseFlowEnabled = false ,
334- isNewGrantFlowEnabled = false ,
335- onOpenSubmitExpenseModalClick = ( ) => { } ,
336- ) => {
326+ const getMainAction = ( collective , callsToAction , LoggedInUser , onOpenSubmitExpenseModalClick = ( ) => { } ) => {
337327 if ( ! collective || ! callsToAction ) {
338328 return null ;
339329 }
@@ -362,7 +352,7 @@ const getMainAction = (
362352 return {
363353 type : NAVBAR_ACTION_TYPE . REQUEST_GRANT ,
364354 component : (
365- < Link href = { `${ getCollectivePageRoute ( collective ) } /${ isNewGrantFlowEnabled ? ' grants' : 'expenses' } /new` } >
355+ < Link href = { `${ getCollectivePageRoute ( collective ) } /grants/new` } >
366356 < ActionButton tabIndex = "-1" >
367357 < MoneyCheckAlt size = "1em" />
368358 < Span ml = { 2 } >
@@ -375,22 +365,13 @@ const getMainAction = (
375365 } else if ( callsToAction . includes ( 'hasSubmitExpense' ) ) {
376366 return {
377367 type : NAVBAR_ACTION_TYPE . SUBMIT_EXPENSE ,
378- component : isNewExpenseFlowEnabled ? (
368+ component : (
379369 < ActionButton tabIndex = "-1" onClick = { onOpenSubmitExpenseModalClick } >
380370 < Receipt size = "1em" />
381371 < Span ml = { 2 } >
382372 < FormattedMessage id = "menu.submitExpense" defaultMessage = "Submit Expense" />
383373 </ Span >
384374 </ ActionButton >
385- ) : (
386- < Link href = { `${ getCollectivePageRoute ( collective ) } /expenses/new` } data-cy = "submit-expense-dropdown" >
387- < ActionButton tabIndex = "-1" >
388- < Receipt size = "1em" />
389- < Span ml = { 2 } >
390- < FormattedMessage id = "menu.submitExpense" defaultMessage = "Submit Expense" />
391- </ Span >
392- </ ActionButton >
393- </ Link >
394375 ) ,
395376 } ;
396377 } else if ( callsToAction . includes ( 'hasManageSubscriptions' ) ) {
@@ -482,12 +463,6 @@ const CollectiveNavbar = ({
482463
483464 const loading = isLoading || dataLoading ;
484465
485- const isNewGrantFlowEnabled = LoggedInUser ?. hasPreviewFeatureEnabled ( PREVIEW_FEATURE_KEYS . NEW_EXPENSE_FLOW ) ;
486-
487- const isNewExpenseFlowEnabled =
488- LoggedInUser ?. hasPreviewFeatureEnabled ( PREVIEW_FEATURE_KEYS . NEW_EXPENSE_FLOW ) &&
489- ( ! isSupportedExpenseType ( collective , ExpenseType . GRANT ) || isNewGrantFlowEnabled ) ;
490-
491466 const isAllowedAddFunds = Boolean ( data ?. account ?. permissions ?. addFunds ?. allowed ) ;
492467 const sections = React . useMemo ( ( ) => {
493468 return sectionsFromParent || getFilteredSectionsForCollective ( collective , isAdmin , isHostAdmin ) ;
@@ -497,23 +472,11 @@ const CollectiveNavbar = ({
497472 ...callsToAction ,
498473 } ;
499474 const actionsArray = Object . keys ( pickBy ( callsToAction , Boolean ) ) ;
500- const mainAction = getMainAction (
501- collective ,
502- actionsArray ,
503- LoggedInUser ,
504- isNewExpenseFlowEnabled ,
505- isNewGrantFlowEnabled ,
506- ( ) => setIsSubmitExpenseModalOpen ( true ) ,
507- ) ;
475+ const mainAction = getMainAction ( collective , actionsArray , LoggedInUser , ( ) => setIsSubmitExpenseModalOpen ( true ) ) ;
508476 const secondAction =
509477 actionsArray . length === 2 &&
510- getMainAction (
511- collective ,
512- without ( actionsArray , mainAction ?. type ) ,
513- LoggedInUser ,
514- isNewExpenseFlowEnabled ,
515- isNewGrantFlowEnabled ,
516- ( ) => setIsSubmitExpenseModalOpen ( true ) ,
478+ getMainAction ( collective , without ( actionsArray , mainAction ?. type ) , LoggedInUser , ( ) =>
479+ setIsSubmitExpenseModalOpen ( true ) ,
517480 ) ;
518481 const navbarRef = useRef ( undefined ) ;
519482 const mainContainerRef = useRef ( undefined ) ;
0 commit comments