Skip to content

Commit 94faa53

Browse files
committed
refactor: FileUpload - delete button scss update
1 parent 2d55bd4 commit 94faa53

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

src/Shared/Components/FileUpload/FileUpload.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ import { ReactComponent as ICCross } from '@Icons/ic-cross.svg'
55
import { Tooltip } from '@Common/Tooltip'
66

77
import { Progressing } from '@Common/Progressing'
8+
import { ComponentSizeType } from '@Shared/constants'
9+
10+
import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
811
import { FileUploadProps } from './types'
912

13+
import './styles.scss'
14+
1015
export const FileUpload = ({
1116
isLoading,
1217
label,
@@ -31,7 +36,7 @@ export const FileUpload = ({
3136
}
3237

3338
return (
34-
<div className="mw-none">
39+
<div className="file-upload mw-none">
3540
{isLoading || fileName ? (
3641
<div className="dc__border br-4 dc__overflow-hidden flexbox">
3742
<div className="flexbox dc__align-items-center dc__gap-8 px-8 py-4 mw-none">
@@ -50,13 +55,18 @@ export const FileUpload = ({
5055
)}
5156
</div>
5257
{!isLoading && (
53-
<button
54-
type="button"
55-
className="dc__transparent flex p-6 dc__hover-n50"
56-
onClick={onClearUpload}
57-
>
58-
<ICCross className="icon-dim-16 fcn-6" />
59-
</button>
58+
<div className="file-upload__remove-file">
59+
<Button
60+
dataTestId="file-upload-remove-file-button"
61+
ariaLabel="Remove File"
62+
showAriaLabelInTippy={false}
63+
icon={<ICCross />}
64+
onClick={onClearUpload}
65+
variant={ButtonVariantType.borderLess}
66+
style={ButtonStyleType.negativeGrey}
67+
size={ComponentSizeType.small}
68+
/>
69+
</div>
6070
)}
6171
</div>
6272
) : (
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.file-upload {
2+
&__remove-file {
3+
button {
4+
border-radius: 0;
5+
}
6+
}
7+
}

src/Shared/Components/SelectPicker/type.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
141141
IsMulti,
142142
GroupBase<SelectPickerOptionType<OptionValue>>
143143
>,
144-
'onCreateOption'
144+
'onCreateOption' | 'formatCreateLabel'
145145
>
146146
> & {
147147
/**
@@ -238,11 +238,6 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
238238
* @default true
239239
*/
240240
shouldShowNoOptionsMessage?: boolean
241-
/**
242-
* Gets the label for the "create new ..." option in the menu.
243-
* @param inputValue the current input value.
244-
*/
245-
formatCreateLabel?: (inputValue: string) => ReactNode
246241
} & (IsMulti extends true
247242
? {
248243
isMulti: IsMulti | boolean

0 commit comments

Comments
 (0)