functioning profiles
This commit is contained in:
1 parent
8985312dd2
commit
d890c1aa64
17 files changed
+136
-78
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import "./ButtonIcons.css";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import { FC, ReactNode } from "react";
|
||||
import MuiIconButton, { IconButtonTypeMap } from "@mui/material/IconButton";
|
||||
import IconButton, { IconButtonTypeMap } from "@mui/material/IconButton";
|
||||
import { useLang } from "lang";
|
||||
|
||||
export type ButtonIconProps = {
|
||||
icon: ReactNode;
|
||||
@@ -10,21 +12,31 @@ export type ButtonIconProps = {
|
||||
disabled?: boolean;
|
||||
color?: IconButtonTypeMap["props"]["color"];
|
||||
borderless?: boolean;
|
||||
titleSlug?: string;
|
||||
titleParams?: Record<string, string>;
|
||||
};
|
||||
export const ButtonIcon: FC<ButtonIconProps> = (props) => {
|
||||
const langStore = useLang();
|
||||
return (
|
||||
<MuiIconButton
|
||||
className={[
|
||||
"icon-button",
|
||||
props.className ?? "",
|
||||
props.borderless ? "borderless" : "",
|
||||
].join(" ")}
|
||||
onClick={props.onClick}
|
||||
title={props.title}
|
||||
color={props.color}
|
||||
disabled={props.disabled}
|
||||
<Tooltip
|
||||
title={
|
||||
props.titleSlug ? langStore.get(props.titleSlug, props.titleParams) : ""
|
||||
}
|
||||
describeChild
|
||||
>
|
||||
{props.icon}
|
||||
</MuiIconButton>
|
||||
<IconButton
|
||||
className={[
|
||||
"icon-button",
|
||||
props.className ?? "",
|
||||
props.borderless ? "borderless" : "",
|
||||
].join(" ")}
|
||||
onClick={props.onClick}
|
||||
title={props.title}
|
||||
color={props.color}
|
||||
disabled={props.disabled}
|
||||
>
|
||||
{props.icon}
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user