Skip to content

Commit bff0ae6

Browse files
authored
chore: fix header background color (#886)
1 parent 4b89e0d commit bff0ae6

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

packages/components/src/DesktopDragZoneBox/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React, { ComponentPropsWithoutRef, FC } from 'react';
22

3-
import { View } from 'react-native';
3+
import { Pressable } from 'react-native';
44

55
import platformEnv from '@onekeyhq/shared/src/platformEnv';
66

77
let lastTime: Date | undefined;
88
let num = 0;
99

10-
const DesktopDragZoneBox: FC<ComponentPropsWithoutRef<typeof View>> = ({
10+
const DesktopDragZoneBox: FC<ComponentPropsWithoutRef<typeof Pressable>> = ({
1111
children,
1212
...rest
1313
}) => {
@@ -25,13 +25,15 @@ const DesktopDragZoneBox: FC<ComponentPropsWithoutRef<typeof View>> = ({
2525
}
2626
if (num === 1) {
2727
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
28-
if (platformEnv.isDesktop) window?.desktopApi?.toggleMaximizeWindow();
28+
if (platformEnv.isDesktop) {
29+
window?.desktopApi?.toggleMaximizeWindow();
30+
}
2931
}
3032
};
3133

3234
const { style = {} } = rest;
3335
return (
34-
<View
36+
<Pressable
3537
{...rest}
3638
onPress={toggleMaxWindow}
3739
style={{
@@ -43,7 +45,7 @@ const DesktopDragZoneBox: FC<ComponentPropsWithoutRef<typeof View>> = ({
4345
}}
4446
>
4547
{children}
46-
</View>
48+
</Pressable>
4749
);
4850
};
4951

packages/desktop/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ const App: FC = function () {
99
<>
1010
<DesktopDragZoneBox
1111
style={{
12-
height: '32px',
12+
height: '16px',
1313
position: 'absolute',
1414
top: 0,
1515
left: 0,
1616
right: 0,
17+
zIndex: 9999,
1718
}}
1819
/>
1920
<Provider />

packages/kit/src/provider/NavigationProvider.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ if (platformEnv.isExtensionUiPopup && platformEnv.isRuntimeFirefox) {
4040
}
4141

4242
const NavigationApp = () => {
43-
const [bgColor, textColor] = useThemeValue([
43+
const [bgColor, textColor, dividerColor] = useThemeValue([
4444
'surface-subdued',
4545
'text-default',
46-
'background-default',
46+
'divider',
4747
]);
4848

4949
const navigationTheme = useMemo(
@@ -54,9 +54,10 @@ const NavigationApp = () => {
5454
background: platformEnv.isNativeAndroid ? bgColor : 'transparent',
5555
card: bgColor,
5656
text: textColor,
57+
border: dividerColor,
5758
},
5859
}),
59-
[bgColor, textColor],
60+
[bgColor, textColor, dividerColor],
6061
);
6162

6263
const { instanceId } = useSettings();

packages/kit/src/routes/Stack/index.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,25 @@ const Dashboard = () => {
7474

7575
return stackScreenList.map((stack) => (
7676
<StackNavigator.Screen
77+
options={{
78+
headerBackTitle: '',
79+
headerTitleAlign: 'center',
80+
headerStyle: {
81+
backgroundColor: bgColor,
82+
// @ts-expect-error
83+
borderBottomWidth: 0,
84+
shadowColor: borderBottomColor,
85+
},
86+
header:
87+
Platform.OS === 'ios' ? renderCustomSubStackHeader : undefined,
88+
headerTintColor: textColor,
89+
}}
7790
key={stack.name}
7891
name={stack.name}
7992
component={stack.component}
8093
/>
8194
));
82-
}, [isVerticalLayout]);
95+
}, [isVerticalLayout, bgColor, borderBottomColor, textColor]);
8396

8497
return (
8598
<StackNavigator.Navigator>

0 commit comments

Comments
 (0)