mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
tweak(phone/settings): Added a SettingItemIconAction component
Currently used for phone number
This commit is contained in:
1 parent
140a28bef7
commit
eae06b2dc6
2 files changed
+63
-3
No files matched your search
@@ -6,6 +6,9 @@ import {
|
||||
ListItemSecondaryAction,
|
||||
Box,
|
||||
Slider,
|
||||
IconButton,
|
||||
Tooltip,
|
||||
Typography,
|
||||
} from '@material-ui/core';
|
||||
|
||||
interface ISettingItem {
|
||||
@@ -48,3 +51,39 @@ export const SettingItemSlider = ({ icon, label, value, onCommit }: ISettingSlid
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
);
|
||||
|
||||
interface ISettingItemIconAction {
|
||||
icon: JSX.Element;
|
||||
actionIcon: JSX.Element;
|
||||
label: string;
|
||||
labelSecondary: string;
|
||||
handleAction: () => void;
|
||||
actionLabel: string;
|
||||
}
|
||||
|
||||
export const SettingItemIconAction = ({
|
||||
icon,
|
||||
label,
|
||||
handleAction,
|
||||
actionIcon,
|
||||
labelSecondary,
|
||||
actionLabel,
|
||||
}: ISettingItemIconAction) => (
|
||||
<>
|
||||
<ListItem divider>
|
||||
<ListItemIcon>{icon}</ListItemIcon>
|
||||
<ListItemText primary={label} secondary={labelSecondary} />
|
||||
<ListItemSecondaryAction>
|
||||
<Tooltip
|
||||
arrow
|
||||
title={<Typography variant="body2">{actionLabel}</Typography>}
|
||||
placement="top-end"
|
||||
>
|
||||
<IconButton edge="end" onClick={handleAction}>
|
||||
{actionIcon}
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
</>
|
||||
);
|
||||
Reference in new issue
Block a user