Skip to content

Commit 5f0f521

Browse files
committed
Updated style
1 parent 4e030b7 commit 5f0f521

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

Diff for: app/components/button.jsx

+39-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
import React, {useState, useRef} from 'react';
22
import { createUseStyles } from 'react-jss';
33

4+
/**
5+
* Button component that is styled using react-jss.
6+
* It supports various states like hover, active, and disabled,
7+
* and can be configured with custom styles, titles, and callbacks.
8+
*
9+
* @param {Object} props - The props for the Button component.
10+
*/
11+
412
function Button(props) {
513

614
const {
7-
className = "",
8-
style = {},
9-
onDone = () => {},
10-
title = "",
11-
disabled = false,
12-
disableOnClick = false,
15+
className = "", // may or may not be passed. Should be applied to the outer most tag, after local classNames
16+
style = {}, // may or may not be passed, Should be applied to the outer most tag
17+
onDone = () => {}, // a function that is called when the button is clicked. - if it exists
18+
title = "", // text to display on hover
19+
disabled = false,
20+
disableOnClick = false, // if true, the button gets disabled after click and stays disabled - prevents resubmission
1321
children
1422
} = props;
1523

@@ -97,6 +105,7 @@ function TextButton(props) {
97105
return <Button {...props} className="textButton" />;
98106
}
99107

108+
100109
const commonButtonStyles = {
101110
width: 'auto',
102111
height: 'auto',
@@ -107,11 +116,6 @@ const commonButtonStyles = {
107116
fontSize: '1rem',
108117
lineHeight: '1.5rem',
109118
textAlign: 'center',
110-
transition: 'all 100ms ease-out',
111-
112-
'&:hover, &.hover': {
113-
textDecoration: 'underline',
114-
}
115119
}
116120

117121
const buttonStyles = createUseStyles(theme => ({
@@ -137,6 +141,12 @@ const buttonStyles = createUseStyles(theme => ({
137141
border: '0.125rem solid #5D5D5C',
138142
textDecoration: 'none',
139143
transition: 'none',
144+
},
145+
146+
'&:hover, &.hover': {
147+
textDecoration: 'underline',
148+
backgroundColor: '#FFFFFF',
149+
borderColor: '#06335C'
140150
}
141151
},
142152

@@ -155,6 +165,12 @@ const buttonStyles = createUseStyles(theme => ({
155165

156166
'&:focus': {
157167
},
168+
169+
'&:hover, &.hover': {
170+
textDecoration: 'underline',
171+
backgroundColor: '#FFFFFF',
172+
borderColor: '#FFC315'
173+
}
158174
},
159175

160176
primaryButton: {
@@ -178,6 +194,12 @@ const buttonStyles = createUseStyles(theme => ({
178194
border: '0.0625rem solid #EBEBEB',
179195
textDecoration: 'none',
180196
transition: 'none',
197+
},
198+
199+
'&:hover, &.hover': {
200+
textDecoration: 'underline',
201+
backgroundColor: '#06335C',
202+
borderColor: '#06335C'
181203
}
182204
},
183205

@@ -192,6 +214,12 @@ const buttonStyles = createUseStyles(theme => ({
192214
'&:active': {
193215
color: '#1A1A1A',
194216
textDecoration: 'none',
217+
},
218+
219+
'&:hover, &.hover': {
220+
textDecoration: 'underline',
221+
backgroundColor: 'transparent',
222+
borderColor: 'none'
195223
}
196224
}
197225
}))

0 commit comments

Comments
 (0)