Skip to content

Commit

Permalink
feat: add style for Handler
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Aug 15, 2023
1 parent a90ebe7 commit df0eeb6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/gi-common-components/src/Handler/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ const textStyleMap = {
};

export interface HandlerProps {
style?: React.CSSProperties;
handleClick: () => void;
type: 'left' | 'right' | 'bottom';
}

const Handler: React.FC<HandlerProps> = props => {
const { handleClick, type } = props;
const { handleClick, type, style = {} } = props;

const handerBackStyles = {
position: 'absolute',
Expand All @@ -92,8 +93,8 @@ const Handler: React.FC<HandlerProps> = props => {

return (
<>
<div style={handerBackStyles as any}></div>
<div onClick={handleClick} style={handlerStyles as any}>
<div style={{ ...handerBackStyles, ...style } as any}></div>
<div onClick={handleClick} style={{ ...handlerStyles, ...style } as any}>
<span style={handlerTextStyles as any}>{type === 'bottom' ? '=' : '||'}</span>
</div>
</>
Expand Down

0 comments on commit df0eeb6

Please sign in to comment.