Skip to content

Commit 0945384

Browse files
Merge pull request #997 from topcoder-platform/PM-579-copilot-form
PM-579 Make buttons in form responsive
2 parents 3d05b30 + 823e866 commit 0945384

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/apps/copilots/src/pages/copilot-request-form/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ const CopilotRequestForm: FC<{}> = () => {
303303
customRadius
304304
noCaps
305305
leftAlignText
306+
textWrap
306307
/>
307308
<Button
308309
secondary
@@ -316,6 +317,7 @@ const CopilotRequestForm: FC<{}> = () => {
316317
customRadius
317318
noCaps
318319
leftAlignText
320+
textWrap
319321
/>
320322
<Button
321323
secondary
@@ -329,6 +331,7 @@ const CopilotRequestForm: FC<{}> = () => {
329331
customRadius
330332
noCaps
331333
leftAlignText
334+
textWrap
332335
/>
333336
{formErrors.complexity && (
334337
<p className={styles.error}>

src/libs/ui/lib/components/button/base-button/BaseButton.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ $btn-secondary-border-width: $border;
6060
justify-content: left;
6161
}
6262

63+
&:global(.btn-text-wrap) {
64+
white-space: normal;
65+
word-wrap: break-word;
66+
text-align: left;
67+
}
68+
6369
// Define variants
6470
&:global(.btn-variant-danger) {
6571
--btn-variant: #{$red-120};

src/libs/ui/lib/components/button/base-button/BaseButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface BaseButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>
2727
customRadius?: boolean
2828
noCaps?: boolean
2929
leftAlignText?: boolean
30+
textWrap?: boolean
3031
}
3132

3233
const BaseButton: FC<BaseButtonProps> = props => {
@@ -47,6 +48,7 @@ const BaseButton: FC<BaseButtonProps> = props => {
4748
'btn-style-primary': props.primary,
4849
'btn-style-secondary': props.secondary,
4950
[`btn-variant-${props.variant}`]: !!props.variant,
51+
'btn-text-wrap': props.textWrap,
5052
})
5153

5254
return (

0 commit comments

Comments
 (0)