Skip to content

Commit

Permalink
refactor(Saturation): Optimize the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 12, 2021
1 parent 1570772 commit 2737ff6
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions packages/color-saturation/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,17 @@ export default React.forwardRef<HTMLDivElement, SaturationProps>((props, ref) =>
style={{
position: 'absolute',
inset: 0,
backgroundImage: 'linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsla(0,0%,100%,0))',
...containerStyle,
}}
ref={ref}
onMove={handleChange}
onDown={handleChange}
>
<div
style={{
inset: 0,
background: 'linear-gradient(to right, rgb(255, 255, 255), rgba(255, 255, 255, 0))',
position: 'absolute',
borderRadius: radius,
}}
>
<div
style={{
inset: 0,
background: 'linear-gradient(to top, rgb(0, 0, 0), rgba(0, 0, 0, 0))',
position: 'absolute',
borderRadius: radius,
}}
>
{React.createElement(pointer || Pointer, {
prefixCls,
...comProps,
})}
</div>
</div>
{React.createElement(pointer || Pointer, {
prefixCls,
...comProps,
})}
</Interactive>
);
});

0 comments on commit 2737ff6

Please sign in to comment.