-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
apps/meteor/client/components/FeaturePreviewSidePanelNavigation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { FeaturePreview } from '@rocket.chat/ui-client'; | ||
import type { ReactElement } from 'react'; | ||
import React from 'react'; | ||
|
||
import { useSidePanelNavigationScreenSize } from '../hooks/useSidePanelNavigation'; | ||
|
||
export const FeaturePreviewSidePanelNavigation = ({ children }: { children: ReactElement[] }) => { | ||
const disabled = !useSidePanelNavigationScreenSize(); | ||
return <FeaturePreview feature='sidepanelNavigation' disabled={disabled} children={children} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useBreakpoints } from '@rocket.chat/fuselage-hooks'; | ||
import { useFeaturePreview } from '@rocket.chat/ui-client'; | ||
|
||
export const useSidePanelNavigation = () => { | ||
const isSidepanelFeatureEnabled = useFeaturePreview('sidepanelNavigation'); | ||
// ["xs", "sm", "md", "lg", "xl", xxl"] | ||
return useSidePanelNavigationScreenSize() && isSidepanelFeatureEnabled; | ||
}; | ||
|
||
export const useSidePanelNavigationScreenSize = () => { | ||
const breakpoints = useBreakpoints(); | ||
// ["xs", "sm", "md", "lg", "xl", xxl"] | ||
return breakpoints.includes('lg'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters