blob: 0919c69d900cc516b8b72ced30de4e69c4109cbb [file] [log] [blame]
idillon-sfl37c18df2022-08-26 18:44:27 -04001import { QuestionMark } from "@mui/icons-material";
idillon-sfl44b05342022-08-24 15:46:42 -04002import { IconButton } from "@mui/material";
idillon-sfld5cc7862022-08-25 11:11:34 -04003import { styled } from "@mui/styles";
idillon-sfl37c18df2022-08-26 18:44:27 -04004import { CameraIcon, CancelIcon, CrossedEyeIcon, EyeIcon, FolderIcon, InfoIcon, PenIcon } from "./svgIcons";
idillon-sfl44b05342022-08-24 15:46:42 -04005
idillon-sfl37c18df2022-08-26 18:44:27 -04006const RoundButton = styled(
idillon-sfld5cc7862022-08-25 11:11:34 -04007 ({Icon, ...props}) => (
8 <IconButton {...props} disableRipple={true}>
idillon-sfl44b05342022-08-24 15:46:42 -04009 <Icon fontSize="inherit"/>
10 </IconButton>
11 )
idillon-sfldeabd282022-08-25 22:50:03 -040012)(({theme}) => ({
13 border: `1px solid ${theme.palette.primary.dark}`,
14 color: theme.palette.primary.dark,
idillon-sfld5cc7862022-08-25 11:11:34 -040015 fontSize: "15px",
16 "&:hover": {
idillon-sfldeabd282022-08-25 22:50:03 -040017 background: theme.palette.primary.light,
idillon-sfld5cc7862022-08-25 11:11:34 -040018 },
19 "&:active": {
20 color: "#FFF",
idillon-sfldeabd282022-08-25 22:50:03 -040021 background: theme.palette.primary.dark,
idillon-sfld5cc7862022-08-25 11:11:34 -040022 },
idillon-sfl37c18df2022-08-26 18:44:27 -040023 "&.MuiIconButton-sizeSmall": {
24 height: "15px",
25 width: "15px",
26 },
27 "&.MuiIconButton-sizeMedium": {
28 height: "30px",
29 width: "30px",
30 },
31 "&.MuiIconButton-sizeLarge": {
32 height: "53px",
33 width: "53px",
34 }
idillon-sfld5cc7862022-08-25 11:11:34 -040035}));
idillon-sfl44b05342022-08-24 15:46:42 -040036
idillon-sfl37c18df2022-08-26 18:44:27 -040037export const CancelButton = (props) => {
idillon-sfl44b05342022-08-24 15:46:42 -040038 return (
idillon-sfl37c18df2022-08-26 18:44:27 -040039 <RoundButton {...props}
idillon-sfl44b05342022-08-24 15:46:42 -040040 aria-label="remove picture"
41 Icon={CancelIcon}
idillon-sfl37c18df2022-08-26 18:44:27 -040042 size="large"
idillon-sfl44b05342022-08-24 15:46:42 -040043 />
44 )
45}
46
idillon-sfl37c18df2022-08-26 18:44:27 -040047export const EditButton = (props) => {
idillon-sfl44b05342022-08-24 15:46:42 -040048 return (
idillon-sfl37c18df2022-08-26 18:44:27 -040049 <RoundButton {...props}
idillon-sfl44b05342022-08-24 15:46:42 -040050 aria-label="edit picture"
51 Icon={PenIcon}
idillon-sfl37c18df2022-08-26 18:44:27 -040052 size="large"
idillon-sfl44b05342022-08-24 15:46:42 -040053 />
54 )
55}
56
idillon-sfl37c18df2022-08-26 18:44:27 -040057export const UploadButton = (props) => {
idillon-sfl44b05342022-08-24 15:46:42 -040058 return (
idillon-sfl37c18df2022-08-26 18:44:27 -040059 <RoundButton {...props}
idillon-sfl44b05342022-08-24 15:46:42 -040060 aria-label="upload picture"
61 Icon={FolderIcon}
idillon-sfl37c18df2022-08-26 18:44:27 -040062 size="large"
idillon-sfl44b05342022-08-24 15:46:42 -040063 />
64 )
65}
66
67export const TakePictureButton = (props) => {
68 return (
idillon-sfl37c18df2022-08-26 18:44:27 -040069 <RoundButton {...props}
idillon-sfl44b05342022-08-24 15:46:42 -040070 aria-label="take picture"
71 Icon={CameraIcon}
idillon-sfl37c18df2022-08-26 18:44:27 -040072 size="large"
idillon-sfl44b05342022-08-24 15:46:42 -040073 />
74 )
75}
idillon-sfl37c18df2022-08-26 18:44:27 -040076
77export const InfoButton = (props) => {
78 return (
79 <RoundButton {...props}
80 aria-label="informations"
81 Icon={InfoIcon}
82 size="small"
83 />
84 )
85}
86
87export const TipButton = (props) => {
88 return (
89 <RoundButton {...props}
90 aria-label="informations"
91 Icon={QuestionMark}
92 size="medium"
93 />
94 )
95}
96
97export const ToggleVisibilityButton = styled(
98 ({visible, ...props}) => {
99 const Icon = visible ? CrossedEyeIcon : EyeIcon
100 return (
101 <IconButton {...props} disableRipple={true}>
102 <Icon fontSize="inherit"/>
103 </IconButton>
104 )
105 }
106)(({theme}) => ({
107 color: theme.palette.primary.dark,
108 fontSize: "15px",
109 height: "15px",
110 width: "15px",
111 "&:hover": {
112 background: theme.palette.primary.light,
113 },
114}));