mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-30 19:39:22 +00:00
review: make appBar styling use IconButton (fix margins)
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
|||||||
useMemo,
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} 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 { CollapseIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
@@ -68,12 +68,9 @@ export const AppBar: FC<Props> = ({ children }) => {
|
|||||||
>
|
>
|
||||||
<LeftNav>
|
<LeftNav>
|
||||||
<Tooltip label={t("common.back")}>
|
<Tooltip label={t("common.back")}>
|
||||||
<Button
|
<IconButton onClick={onBackClick}>
|
||||||
kind={"tertiary"}
|
<CollapseIcon />
|
||||||
iconOnly
|
</IconButton>
|
||||||
Icon={CollapseIcon}
|
|
||||||
onClick={onBackClick}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</LeftNav>
|
</LeftNav>
|
||||||
{title && (
|
{title && (
|
||||||
|
|||||||
@@ -8,7 +8,11 @@ Please see LICENSE in the repository root for full details.
|
|||||||
import { type ComponentPropsWithoutRef, type FC } from "react";
|
import { type ComponentPropsWithoutRef, type FC } from "react";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { useTranslation } from "react-i18next";
|
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 {
|
import {
|
||||||
MicOnSolidIcon,
|
MicOnSolidIcon,
|
||||||
MicOffSolidIcon,
|
MicOffSolidIcon,
|
||||||
@@ -128,20 +132,22 @@ export const EndCallButton: FC<EndCallButtonProps> = ({
|
|||||||
|
|
||||||
interface SettingsButtonProps extends ComponentPropsWithoutRef<"button"> {
|
interface SettingsButtonProps extends ComponentPropsWithoutRef<"button"> {
|
||||||
size?: "sm" | "lg";
|
size?: "sm" | "lg";
|
||||||
|
forAppBar?: boolean;
|
||||||
}
|
}
|
||||||
export const SettingsButton: FC<SettingsButtonProps> = (props) => {
|
export const SettingsButton: FC<SettingsButtonProps> = (props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const Icon =
|
||||||
|
platform === "android" ? OverflowVerticalIcon : OverflowHorizontalIcon;
|
||||||
return (
|
return (
|
||||||
<Tooltip label={t("common.settings")}>
|
<Tooltip label={t("common.settings")}>
|
||||||
<CpdButton
|
{!props.forAppBar && (
|
||||||
iconOnly
|
<CpdButton iconOnly Icon={Icon} kind="tertiary" {...props} />
|
||||||
Icon={
|
)}
|
||||||
platform === "android" ? OverflowVerticalIcon : OverflowHorizontalIcon
|
{props.forAppBar && (
|
||||||
}
|
<IconButton {...props}>
|
||||||
kind="tertiary"
|
<Icon />
|
||||||
{...props}
|
</IconButton>
|
||||||
/>
|
)}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -645,7 +645,7 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
if (audioOutputButton) buttons.push(audioOutputButton);
|
if (audioOutputButton) buttons.push(audioOutputButton);
|
||||||
|
|
||||||
useAppBarSecondaryButton(
|
useAppBarSecondaryButton(
|
||||||
<SettingsButton key="settings" onClick={openSettings} />,
|
<SettingsButton forAppBar key="settings" onClick={openSettings} />,
|
||||||
);
|
);
|
||||||
|
|
||||||
buttons.push(
|
buttons.push(
|
||||||
|
|||||||
Reference in New Issue
Block a user