Skip to content

Commit fec7bc5

Browse files
committed
Hide file preview fullscreen button while in search
1 parent 132eae2 commit fec7bc5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/screens/FileDetail.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ type Props = NativeStackScreenProps<FileStackParams, 'FileDetail'>;
4242
const FileDetail: React.FC<Props> = ({ route, navigation }) => {
4343
const { disableAnimation, ...file } = route.params;
4444

45+
const isSearch = navigation.getState().routeNames.includes('Search' as any);
46+
4547
const theme = useTheme();
4648
const toast = useToast();
4749
const { showDetail, showMaster, toggleMaster } = useContext(SplitViewContext);
@@ -126,7 +128,7 @@ const FileDetail: React.FC<Props> = ({ route, navigation }) => {
126128
DeviceInfo.isTablet() || DeviceInfo.isMac() ? showMaster : undefined,
127129
headerRight: () => (
128130
<View style={[Styles.flexRow, { justifyContent: 'flex-end' }]}>
129-
{(DeviceInfo.isTablet() || DeviceInfo.isMac()) && (
131+
{(DeviceInfo.isTablet() || DeviceInfo.isMac()) && !isSearch && (
130132
<IconButton
131133
onPress={() => toggleMaster(!showMaster)}
132134
icon={props => (
@@ -173,7 +175,7 @@ const FileDetail: React.FC<Props> = ({ route, navigation }) => {
173175
</View>
174176
),
175177
unstable_headerRightItems: () => [
176-
...(DeviceInfo.isTablet() || DeviceInfo.isMac()
178+
...((DeviceInfo.isTablet() || DeviceInfo.isMac()) && !isSearch
177179
? [
178180
{
179181
type: 'button',

0 commit comments

Comments
 (0)