Skip to content

Commit 617260a

Browse files
committed
refactor new text styles
1 parent 8c6a985 commit 617260a

3 files changed

Lines changed: 34 additions & 65 deletions

File tree

‎front/src/pods/trainer/components/new-text.component.tsx‎

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,30 @@ export const NewTextComponent: React.FC<Props> = props => {
3838
}, []);
3939

4040
return (
41-
<div className={cx(innerClasses.newTextContainer, className)}>
42-
<form>
43-
<label className={innerClasses.labelTextarea} htmlFor="new-text">
44-
New text
45-
</label>
46-
<TextareaAutosize
47-
rowsMax={10}
48-
rowsMin={10}
49-
className={innerClasses.editTextArea}
50-
onChange={e => handleOnChange(e)}
51-
value={trainerText}
52-
/>
53-
<Button
54-
variant="contained"
55-
color="primary"
56-
className={
57-
trainerText ? innerClasses.sendBtn : innerClasses.sendBtnDisabled
58-
}
59-
onClick={() => trainerText && handleAppendTrainerTextInternal()}
60-
aria-disabled={!trainerText}
61-
disableRipple={!trainerText}
62-
disableElevation
63-
>
64-
Send
65-
<ArrowForwardRoundedIcon className={innerClasses.sendIcon} />
66-
</Button>
67-
</form>
68-
</div>
41+
<form className={cx(innerClasses.root, className)}>
42+
<label className={innerClasses.label} htmlFor="new-text">
43+
New text
44+
</label>
45+
<TextareaAutosize
46+
rowsMax={10}
47+
rowsMin={10}
48+
className={innerClasses.textarea}
49+
onChange={e => handleOnChange(e)}
50+
value={trainerText}
51+
/>
52+
<Button
53+
variant="contained"
54+
color="primary"
55+
className={innerClasses.button}
56+
onClick={() => trainerText && handleAppendTrainerTextInternal()}
57+
disabled={!trainerText}
58+
aria-disabled={!trainerText}
59+
disableRipple={!trainerText}
60+
disableElevation
61+
>
62+
Send
63+
<ArrowForwardRoundedIcon className={innerClasses.buttonIcon} />
64+
</Button>
65+
</form>
6966
);
7067
};

‎front/src/pods/trainer/components/new-text.styles.ts‎

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@ import { theme } from 'core/theme';
44
const { palette, typography, spacing } = theme;
55
const color = palette.customPalette;
66

7-
export const newTextContainer = css`
8-
width: 100%;
9-
margin-top: ${spacing(7.5)};
10-
margin-bottom: ${spacing(5)};
11-
margin-bottom: ${spacing(10)};
7+
export const root = css`
8+
display: grid;
9+
grid-row-gap: 1rem;
10+
grid-column-gap: 1rem;
1211
`;
1312

14-
export const labelTextarea = css`
13+
export const label = css`
1514
font-family: ${typography.fontFamily};
1615
font-size: 1.125rem;
1716
`;
1817

19-
export const editTextArea = css`
18+
export const textarea = css`
2019
box-sizing: border-box;
21-
width: 100%;
22-
margin-top: ${spacing(1.25)};
23-
margin-bottom: ${spacing(2.5)};
2420
padding: ${spacing(2)};
2521
font-family: ${typography.fontFamily};
2622
font-size: 1rem;
@@ -34,8 +30,7 @@ export const editTextArea = css`
3430
}
3531
`;
3632

37-
export const sendBtn = css`
38-
width: 100%;
33+
export const button = css`
3934
padding: ${spacing(1.25)} 0;
4035
font-size: 1.188rem;
4136
font-weight: 400;
@@ -51,31 +46,7 @@ export const sendBtn = css`
5146
}
5247
`;
5348

54-
export const sendBtnDisabled = css`
55-
width: 100%;
56-
padding: ${spacing(1.25)} 0;
57-
font-size: 1.188rem;
58-
font-weight: 400;
59-
text-transform: capitalize;
60-
border-radius: 0;
61-
color: ${palette.grey[700]};
62-
background-color: ${palette.grey[300]};
63-
cursor: default;
64-
opacity: 0.5;
65-
box-shadow: none;
66-
&:hover {
67-
color: ${palette.grey[700]};
68-
background-color: ${palette.grey[300]};
69-
box-shadow: none;
70-
}
71-
&:active {
72-
color: ${palette.grey[700]};
73-
background-color: ${palette.grey[300]};
74-
box-shadow: none;
75-
}
76-
`;
77-
78-
export const sendIcon = css`
49+
export const buttonIcon = css`
7950
margin-left: ${spacing(1.25)};
8051
font-size: 1.25rem;
8152
`;

‎front/src/pods/trainer/trainer.styles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const root = css`
3030

3131
export const divider = css`
3232
&& {
33+
padding: 0;
3334
@media (min-width: ${breakpoints.values.md}px) {
3435
grid-column-start: 1;
3536
grid-column-end: 4;

0 commit comments

Comments
 (0)