Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@ const CONST = {
NEW_DOT_TALK_TO_AI_SALES: 'newDotTalkToAISales',
CUSTOM_RULES: 'customRules',
TABLE_REPORT_VIEW: 'tableReportView',
HELP_SIDE_PANEL: 'newDotHelpSidePanel',
RECEIPT_LINE_ITEMS: 'receiptLineItems',
LEFT_HAND_BAR: 'leftHandBar',
WALLET: 'newdotWallet',
Expand Down
10 changes: 4 additions & 6 deletions src/hooks/useSidePanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {Animated} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import {triggerSidePanel} from '@libs/actions/SidePanel';
import focusComposerWithDelay from '@libs/focusComposerWithDelay';
import Permissions from '@libs/Permissions';
import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager';
import variables from '@styles/variables';
import CONST from '@src/CONST';
Expand All @@ -21,7 +20,6 @@ function useSidePanelDisplayStatus() {
const {isExtraLargeScreenWidth, shouldUseNarrowLayout} = useResponsiveLayout();
const [sidePanelNVP] = useOnyx(ONYXKEYS.NVP_SIDE_PANEL);
const [language] = useOnyx(ONYXKEYS.NVP_PREFERRED_LOCALE);
const [canUseHelpSidePanel = false] = useOnyx(ONYXKEYS.BETAS, {selector: Permissions.canUseHelpSidePanel});
const [isModalCenteredVisible = false] = useOnyx(ONYXKEYS.MODAL, {
selector: (modal) =>
modal?.type === CONST.MODAL.MODAL_TYPE.CENTERED_SWIPABLE_TO_RIGHT ||
Expand All @@ -37,14 +35,14 @@ function useSidePanelDisplayStatus() {
// - NVP is not set or it is false
// - language is unsupported
// - modal centered is visible
const shouldHideSidePanel = !isSidePanelVisible || isLanguageUnsupported || isModalCenteredVisible || !canUseHelpSidePanel;
const isSidePanelHiddenOrLargeScreen = !isSidePanelVisible || isLanguageUnsupported || isExtraLargeScreenWidth || !canUseHelpSidePanel;
const shouldHideSidePanel = !isSidePanelVisible || isLanguageUnsupported || isModalCenteredVisible || !sidePanelNVP;
const isSidePanelHiddenOrLargeScreen = !isSidePanelVisible || isLanguageUnsupported || isExtraLargeScreenWidth || !sidePanelNVP;

// The help button is hidden when:
// - the user is not part of the corresponding beta
// - side pane nvp is not set
// - Side Panel is displayed currently
// - language is unsupported
const shouldHideHelpButton = !canUseHelpSidePanel || !shouldHideSidePanel || isLanguageUnsupported;
const shouldHideHelpButton = !sidePanelNVP || !shouldHideSidePanel || isLanguageUnsupported;
const shouldHideSidePanelBackdrop = shouldHideSidePanel || isExtraLargeScreenWidth || shouldUseNarrowLayout;

return {
Expand Down
5 changes: 0 additions & 5 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ function canUseTableReportView(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.TABLE_REPORT_VIEW) || canUseAllBetas(betas);
}

function canUseHelpSidePanel(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.HELP_SIDE_PANEL) || canUseAllBetas(betas);
}

function canUseTalkToAISales(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.NEW_DOT_TALK_TO_AI_SALES) || canUseAllBetas(betas);
}
Expand Down Expand Up @@ -81,7 +77,6 @@ export default {
canUseManagerMcTest,
canUseCustomRules,
canUseTableReportView,
canUseHelpSidePanel,
canUseTalkToAISales,
canUseProhibitedExpenses,
canUseLeftHandBar,
Expand Down