Skip to content

Commit db309c1

Browse files
Merge pull request #643 from sudhanshutech/fix/feedback
Fix feedback component to use standard style
2 parents 60d5bfc + 9104167 commit db309c1

File tree

4 files changed

+31
-46
lines changed

4 files changed

+31
-46
lines changed

src/custom/Feedback/FeedbackButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from '../../icons';
1111
import { CULTURED } from '../../theme';
1212
import { CustomTooltip } from '../CustomTooltip';
13+
import { ModalButtonPrimary } from '../Modal';
1314
import { ModalCard } from '../ModalCard';
1415
import {
1516
ActionWrapper,
@@ -21,7 +22,6 @@ import {
2122
FeedbackMiniIcon,
2223
FeedbackOptionButton,
2324
FeedbackOptions,
24-
FeedbackSubmitButton,
2525
FeedbackTextArea,
2626
HelperWrapper,
2727
InnerComponentWrapper,
@@ -166,14 +166,14 @@ const FeedbackComponent: React.FC<FeedbackComponentProps> = ({
166166
We may email you for more information or updates
167167
</Typography>
168168
</ActionWrapper>
169-
<FeedbackSubmitButton
169+
<ModalButtonPrimary
170170
type="submit"
171171
disabled={!(messageValue && isChecked)}
172172
isOpen={!(messageValue && isChecked)}
173173
onClick={handleSubmit}
174174
>
175175
Send
176-
</FeedbackSubmitButton>
176+
</ModalButtonPrimary>
177177
</div>
178178
}
179179
leftHeaderIcon={<FeedbackIcon />}

src/custom/Feedback/style.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export const FeedbackMessage = styled(Box)<FeedbackMessageProps>(({ isOpen, them
218218
position: 'relative',
219219
bottom: isOpen ? '0px' : '-240px',
220220
right: '0',
221-
color: BLACK,
221+
color: theme.palette.text.default,
222222
backgroundColor: theme.palette.mode === 'dark' ? DARK_JUNGLE_GREEN : WHITE,
223223
border: `1px solid ${MEDIUM_GREY}`,
224224
padding: '20px',

src/custom/Modal/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DialogProps, styled } from '@mui/material';
1+
import { ButtonProps, DialogProps, styled } from '@mui/material';
22
import React, { useRef, useState } from 'react';
33
import { Box, Dialog, IconButton, Paper, Typography } from '../../base';
44
import { ContainedButton, OutlinedButton, TextButton } from '../../base/Button/Button';
@@ -171,8 +171,12 @@ export const ModalFooter: React.FC<ModalFooterProps> = ({ helpText, children, va
171171
);
172172
};
173173

174+
interface ModalButtonPrimaryProps extends ButtonProps {
175+
isOpen?: boolean;
176+
}
177+
174178
// ModalButtonPrimary
175-
export const ModalButtonPrimary = styled(ContainedButton)(({ theme }) => ({
179+
export const ModalButtonPrimary = styled(ContainedButton)<ModalButtonPrimaryProps>(({ theme }) => ({
176180
backgroundColor: theme.palette.background.brand?.default,
177181
color: theme.palette.text.constant?.white,
178182
'&:hover': {

src/custom/ModalCard/style.tsx

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,37 @@
11
import { styled } from '@mui/material';
22
import { Typography } from '../../base';
3-
import {
4-
BLACK,
5-
BUTTON_MODAL,
6-
BUTTON_MODAL_DARK,
7-
SLIGHT_BLACK_2,
8-
SLIGHT_BLUE,
9-
WHITE
10-
} from '../../theme/colors/colors';
3+
import { WHITE } from '../../theme/colors/colors';
114

125
export const ContentContainer = styled('div')(({ theme }) => ({
13-
backgroundColor: theme.palette.background.default
6+
backgroundColor: theme.palette.background.surfaces
147
}));
158

169
export const ModalWrapper = styled('div')(() => ({
1710
zIndex: '100',
1811
borderRadius: '5px'
1912
}));
2013

21-
export const ButtonContainer = styled('div')(({ theme }) => {
22-
const startColor = theme.palette.mode === 'light' ? BUTTON_MODAL : BLACK;
23-
const endColor = theme.palette.mode === 'light' ? SLIGHT_BLUE : SLIGHT_BLACK_2;
14+
export const ButtonContainer = styled('div')(() => ({
15+
padding: '1.25rem 1rem',
16+
display: 'flex',
17+
justifyContent: 'flex-end',
2418

25-
return {
26-
padding: '1.25rem 1rem',
27-
display: 'flex',
28-
justifyContent: 'flex-end',
19+
background: 'linear-gradient(90deg, #3B687B 0%, #507D90 100%)',
20+
boxShadow: 'inset 0px 3px 5px 0px rgba(0,0,0,0.25)',
21+
position: 'relative',
22+
zIndex: '100'
23+
}));
2924

30-
background: `linear-gradient(90deg, ${startColor}, ${endColor})`,
31-
boxShadow: 'inset 0px 3px 5px 0px rgba(0,0,0,0.25)',
32-
position: 'relative',
33-
zIndex: '100'
34-
};
35-
});
3625
export const HeaderTypography = styled(Typography)({
3726
fontSize: '18px'
3827
});
39-
export const HeaderModal = styled('div')(({ theme }) => {
40-
const startColor = theme.palette.mode === 'light' ? BUTTON_MODAL : BLACK;
41-
const endColor = theme.palette.mode === 'light' ? SLIGHT_BLUE : SLIGHT_BLACK_2;
42-
return {
43-
display: 'flex',
44-
borderRadius: '5px 5px 0px 0px',
45-
justifyContent: 'space-between',
46-
padding: '11px 16px',
47-
height: '52px',
48-
fill: WHITE,
49-
boxShadow: 'inset 0px -1px 3px 0px rgba(0,0,0,0.2)',
50-
background: `linear-gradient(90deg, ${startColor}, ${endColor})`,
51-
filter:
52-
theme.palette.mode === 'light'
53-
? `progid:DXImageTransform.Microsoft.gradient(startColorstr='${BUTTON_MODAL}',endColorstr='${SLIGHT_BLUE}',GradientType=1)`
54-
: `progid:DXImageTransform.Microsoft.gradient(startColorstr='${BUTTON_MODAL_DARK}',GradientType=1)`
55-
};
56-
});
28+
export const HeaderModal = styled('div')(() => ({
29+
display: 'flex',
30+
borderRadius: '5px 5px 0px 0px',
31+
justifyContent: 'space-between',
32+
padding: '11px 16px',
33+
height: '52px',
34+
fill: WHITE,
35+
boxShadow: 'inset 0px -1px 3px 0px rgba(0,0,0,0.2)',
36+
background: 'linear-gradient(90deg, #3B687B 0%, #507D90 100%)'
37+
}));

0 commit comments

Comments
 (0)