Front: Wrap IconButton

This commit is contained in:
Arthur Jamet
2023-03-25 18:52:11 +00:00
committed by Clément Le Bihan
parent f788872f9b
commit 7e463662be
3 changed files with 34 additions and 23 deletions
+12
View File
@@ -0,0 +1,12 @@
import { Box, Button } from "native-base";
type IconButtonProps = {
icon: Parameters<typeof Button>[0]['leftIcon']
} & Omit<Parameters<typeof Button>[0], 'leftIcon' | 'rightIcon'>;
// Wrapper around Button for IconButton as Native's one sucks <3
const IconButton = (props: IconButtonProps) => {
return <Box><Button {...props} leftIcon={props.icon} width='fit-content' rounded='sm'/></Box>
}
export default IconButton;