fix: align mobile workspace header icons with desktop
Use same explorer toggle icons (SourceControlPanelIcon/PanelRight) on mobile as desktop, use vertical kebab icon for mobile header menu.
This commit is contained in:
@@ -3,11 +3,13 @@ import Svg, { Rect, Line } from "react-native-svg";
|
|||||||
interface SourceControlPanelIconProps {
|
interface SourceControlPanelIconProps {
|
||||||
size?: number;
|
size?: number;
|
||||||
color?: string;
|
color?: string;
|
||||||
|
strokeWidth?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SourceControlPanelIcon({
|
export function SourceControlPanelIcon({
|
||||||
size = 16,
|
size = 16,
|
||||||
color = "currentColor",
|
color = "currentColor",
|
||||||
|
strokeWidth = 2,
|
||||||
}: SourceControlPanelIconProps) {
|
}: SourceControlPanelIconProps) {
|
||||||
return (
|
return (
|
||||||
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
||||||
@@ -18,15 +20,15 @@ export function SourceControlPanelIcon({
|
|||||||
height={18}
|
height={18}
|
||||||
rx={2}
|
rx={2}
|
||||||
stroke={color}
|
stroke={color}
|
||||||
strokeWidth={2}
|
strokeWidth={strokeWidth}
|
||||||
strokeLinecap="round"
|
strokeLinecap="round"
|
||||||
strokeLinejoin="round"
|
strokeLinejoin="round"
|
||||||
/>
|
/>
|
||||||
{/* Plus */}
|
{/* Plus */}
|
||||||
<Line x1={9} y1={9.5} x2={15} y2={9.5} stroke={color} strokeWidth={2} strokeLinecap="round" />
|
<Line x1={9} y1={9.5} x2={15} y2={9.5} stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" />
|
||||||
<Line x1={12} y1={6.5} x2={12} y2={12.5} stroke={color} strokeWidth={2} strokeLinecap="round" />
|
<Line x1={12} y1={6.5} x2={12} y2={12.5} stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" />
|
||||||
{/* Minus */}
|
{/* Minus */}
|
||||||
<Line x1={9} y1={16} x2={15} y2={16} stroke={color} strokeWidth={2} strokeLinecap="round" />
|
<Line x1={9} y1={16} x2={15} y2={16} stroke={color} strokeWidth={strokeWidth} strokeLinecap="round" />
|
||||||
</Svg>
|
</Svg>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ import * as Clipboard from "expo-clipboard";
|
|||||||
import {
|
import {
|
||||||
ChevronDown,
|
ChevronDown,
|
||||||
Copy,
|
Copy,
|
||||||
Folder,
|
|
||||||
GitBranch,
|
|
||||||
Ellipsis,
|
Ellipsis,
|
||||||
|
EllipsisVertical,
|
||||||
PanelRight,
|
PanelRight,
|
||||||
Plus,
|
Plus,
|
||||||
SquareTerminal,
|
SquareTerminal,
|
||||||
@@ -1560,12 +1559,15 @@ function WorkspaceScreenContent({
|
|||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
accessibilityLabel="Workspace actions"
|
accessibilityLabel="Workspace actions"
|
||||||
>
|
>
|
||||||
{({ hovered, open }) => (
|
{({ hovered, open }) => {
|
||||||
<Ellipsis
|
const Icon = isMobile ? EllipsisVertical : Ellipsis;
|
||||||
size={theme.iconSize.md}
|
return (
|
||||||
color={hovered || open ? theme.colors.foreground : theme.colors.foregroundMuted}
|
<Icon
|
||||||
/>
|
size={theme.iconSize.md}
|
||||||
)}
|
color={hovered || open ? theme.colors.foreground : theme.colors.foregroundMuted}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}}
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent
|
<DropdownMenuContent
|
||||||
align="start"
|
align="start"
|
||||||
@@ -1690,8 +1692,8 @@ function WorkspaceScreenContent({
|
|||||||
{({ hovered }) => {
|
{({ hovered }) => {
|
||||||
const color = isExplorerOpen || hovered ? theme.colors.foreground : theme.colors.foregroundMuted;
|
const color = isExplorerOpen || hovered ? theme.colors.foreground : theme.colors.foregroundMuted;
|
||||||
return isGitCheckout
|
return isGitCheckout
|
||||||
? <GitBranch size={theme.iconSize.lg} color={color} />
|
? <SourceControlPanelIcon size={theme.iconSize.lg} color={color} strokeWidth={1.5} />
|
||||||
: <Folder size={theme.iconSize.lg} color={color} />;
|
: <PanelRight size={theme.iconSize.lg} color={color} />;
|
||||||
}}
|
}}
|
||||||
</HeaderToggleButton>
|
</HeaderToggleButton>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user