File tree 2 files changed +5
-11
lines changed
packages/sanity/src/core/form/inputs/files/ImageInput
2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,8 @@ export const RatioBox = styled(Card)`
18
18
`
19
19
20
20
export const Overlay = styled ( Flex ) < {
21
- $drag : boolean
22
21
$tone : Exclude < CardTone , 'inherit' >
23
- } > ( ( { $drag , $ tone} ) => {
22
+ } > ( ( { $tone} ) => {
24
23
const textColor = studioTheme . color . light [ $tone ] . card . enabled . fg
25
24
const backgroundColor = rgba ( studioTheme . color . light [ $tone ] . card . enabled . bg , 0.8 )
26
25
@@ -30,9 +29,9 @@ export const Overlay = styled(Flex)<{
30
29
left : 0 ;
31
30
right : 0 ;
32
31
bottom : 0 ;
33
- backdrop-filter : ${ $drag ? ' blur(10px)' : '' } ;
32
+ backdrop-filter : blur (10px );
34
33
color : ${ $tone ? textColor : '' } ;
35
- background-color : ${ $drag ? backgroundColor : 'transparent' } ;
34
+ background-color : ${ backgroundColor } ;
36
35
`
37
36
} )
38
37
Original file line number Diff line number Diff line change @@ -34,9 +34,7 @@ export function ImagePreview(props: ComponentProps<typeof Card> & Props) {
34
34
35
35
return (
36
36
< RatioBox { ...rest } tone = "transparent" >
37
- { ! isLoaded && (
38
- < OverlayComponent cardTone = "transparent" drag content = { < LoadingBlock showText /> } />
39
- ) }
37
+ { ! isLoaded && < OverlayComponent cardTone = "transparent" content = { < LoadingBlock showText /> } /> }
40
38
< img
41
39
src = { src }
42
40
data-testid = "hotspot-image-input"
@@ -47,7 +45,6 @@ export function ImagePreview(props: ComponentProps<typeof Card> & Props) {
47
45
{ drag && (
48
46
< OverlayComponent
49
47
cardTone = { tone }
50
- drag = { drag }
51
48
content = {
52
49
< >
53
50
< Box marginBottom = { 3 } >
@@ -91,15 +88,13 @@ function getHoverTextTranslationKey({
91
88
92
89
function OverlayComponent ( {
93
90
cardTone,
94
- drag,
95
91
content,
96
92
} : {
97
93
cardTone : Exclude < CardTone , 'inherit' >
98
- drag : boolean
99
94
content : ReactNode
100
95
} ) {
101
96
return (
102
- < Overlay justify = "flex-end" padding = { 3 } $drag = { drag } $ tone= { cardTone } >
97
+ < Overlay justify = "flex-end" padding = { 3 } $tone = { cardTone } >
103
98
< FlexOverlay direction = "column" align = "center" justify = "center" >
104
99
{ content }
105
100
</ FlexOverlay >
You can’t perform that action at this time.
0 commit comments