blob: bf4700f28a43e27e069613c01df10e4470393bb4 [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";
idillonb3788bf2022-08-29 15:57:57 -04004import { ArrowIcon, CameraIcon, CancelIcon, CrossedEyeIcon, CrossIcon, 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
idillonb3788bf2022-08-29 15:57:57 -040097export const BackButton = styled(
98 (props) => {
99 return (
100 <IconButton {...props} disableRipple={true}>
101 <ArrowIcon fontSize="inherit"/>
102 </IconButton>
103 )
104 }
105)(({theme}) => ({
106 color: theme.palette.primary.dark,
107 fontSize: "15px",
108 height: "30px",
109 width: "51px",
110 borderRadius: "5px",
111 "&:hover": {
112 background: theme.palette.primary.light,
113 },
114}))
115
116export const CloseButton = styled(
117 (props) => {
118 return (
119 <IconButton {...props} disableRipple={true}>
120 <CrossIcon fontSize="inherit"/>
121 </IconButton>
122 )
123 }
124)(({theme}) => ({
125 color: theme.palette.primary.dark,
126 fontSize: "15px",
127 height: "30px",
128 width: "30px",
129 borderRadius: "5px",
130 "&:hover": {
131 background: theme.palette.primary.light,
132 },
133}))
134
idillon-sfl37c18df2022-08-26 18:44:27 -0400135export const ToggleVisibilityButton = styled(
136 ({visible, ...props}) => {
137 const Icon = visible ? CrossedEyeIcon : EyeIcon
138 return (
139 <IconButton {...props} disableRipple={true}>
140 <Icon fontSize="inherit"/>
141 </IconButton>
142 )
143 }
144)(({theme}) => ({
145 color: theme.palette.primary.dark,
146 fontSize: "15px",
147 height: "15px",
148 width: "15px",
149 "&:hover": {
150 background: theme.palette.primary.light,
151 },
idillonb3788bf2022-08-29 15:57:57 -0400152}))