review: make appBar styling use IconButton (fix margins)

This commit is contained in:
Timo K
2026-04-14 17:05:56 +02:00
parent ed83672720
commit a069d28f3a
3 changed files with 21 additions and 18 deletions

View File

@@ -16,7 +16,7 @@ import {
useMemo,
useState,
} from "react";
import { Button, Heading, Tooltip } from "@vector-im/compound-web";
import { Button, Heading, IconButton, Tooltip } from "@vector-im/compound-web";
import { CollapseIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
import { useTranslation } from "react-i18next";
@@ -68,12 +68,9 @@ export const AppBar: FC<Props> = ({ children }) => {
>
<LeftNav>
<Tooltip label={t("common.back")}>
<Button
kind={"tertiary"}
iconOnly
Icon={CollapseIcon}
onClick={onBackClick}
/>
<IconButton onClick={onBackClick}>
<CollapseIcon />
</IconButton>
</Tooltip>
</LeftNav>
{title && (

View File

@@ -8,7 +8,11 @@ Please see LICENSE in the repository root for full details.
import { type ComponentPropsWithoutRef, type FC } from "react";
import classNames from "classnames";
import { useTranslation } from "react-i18next";
import { Button as CpdButton, Tooltip } from "@vector-im/compound-web";
import {
Button as CpdButton,
IconButton,
Tooltip,
} from "@vector-im/compound-web";
import {
MicOnSolidIcon,
MicOffSolidIcon,
@@ -128,20 +132,22 @@ export const EndCallButton: FC<EndCallButtonProps> = ({
interface SettingsButtonProps extends ComponentPropsWithoutRef<"button"> {
size?: "sm" | "lg";
forAppBar?: boolean;
}
export const SettingsButton: FC<SettingsButtonProps> = (props) => {
const { t } = useTranslation();
const Icon =
platform === "android" ? OverflowVerticalIcon : OverflowHorizontalIcon;
return (
<Tooltip label={t("common.settings")}>
<CpdButton
iconOnly
Icon={
platform === "android" ? OverflowVerticalIcon : OverflowHorizontalIcon
}
kind="tertiary"
{...props}
/>
{!props.forAppBar && (
<CpdButton iconOnly Icon={Icon} kind="tertiary" {...props} />
)}
{props.forAppBar && (
<IconButton {...props}>
<Icon />
</IconButton>
)}
</Tooltip>
);
};

View File

@@ -645,7 +645,7 @@ export const InCallView: FC<InCallViewProps> = ({
if (audioOutputButton) buttons.push(audioOutputButton);
useAppBarSecondaryButton(
<SettingsButton key="settings" onClick={openSettings} />,
<SettingsButton forAppBar key="settings" onClick={openSettings} />,
);
buttons.push(