-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Chore]: Technical: fix linting errors of @types/styled-components plugin #1834
Changes from 1 commit
6213ef2
733606a
e1c0420
47380f3
8c19e46
8870f53
2ca12b9
49df563
8c805fd
5213eeb
0952e85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,11 +25,9 @@ import {TruncatedTitleText} from 'components/common/styled-components'; | |
import {getError} from 'utils/utils'; | ||
import {FileLoadingProgress} from 'reducers/vis-state-updaters'; | ||
|
||
/** @typedef {import('./file-upload-progress').FileUploadProgressProps} FileUploadProgressProps*/ | ||
|
||
const StyledFileProgress = styled.div.attrs({ | ||
className: 'file-upload__progress' | ||
})` | ||
const StyledFileProgress = styled.div.attrs(props => ({ | ||
className: `file-upload__progress${props.className ? ` ${props.className}` : ''}` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
}))` | ||
color: ${props => props.theme.textColorLT}; | ||
font-size: 12px; | ||
margin-top: 12px; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,11 +51,11 @@ const addEventListeners = () => { | |
}; | ||
|
||
interface GetChildPosProps { | ||
offsets: { | ||
offsets: Partial<{ | ||
topOffset: number; | ||
leftOffset: number; | ||
rightOffset: number; | ||
}; | ||
}>; | ||
rect: DOMRect; | ||
childRect: DOMRect; | ||
pageOffset: { | ||
|
@@ -72,7 +72,7 @@ export const getChildPos = ({offsets, rect, childRect, pageOffset, padding}: Get | |
const pos = { | ||
top: pageOffset.y + rect.top + (topOffset || 0), | ||
...(anchorLeft | ||
? {left: pageOffset.x + rect.left + leftOffset} | ||
? {left: pageOffset.x + rect.left + leftOffset!} | ||
: {right: window.innerWidth - rect.right - pageOffset.x + (rightOffset || 0)}) | ||
}; | ||
|
||
|
@@ -140,10 +140,11 @@ interface PortaledProps { | |
isOpened?: boolean; | ||
top: number; | ||
left?: number; | ||
right: number; | ||
right?: number; | ||
overlayZIndex?: number; | ||
modalProps?: Partial<ReactModal.Props>; | ||
modalStyle?: Partial<typeof defaultModalStyle>; | ||
children: React.ReactNode; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't need to add children here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
} | ||
|
||
interface PortaledState { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,9 +27,9 @@ interface StyledDivProps { | |
active?: boolean; | ||
} | ||
|
||
const StyledDiv = styled.div.attrs({ | ||
className: 'toolbar-item' | ||
})<StyledDivProps>` | ||
const StyledDiv = styled.div.attrs(props => ({ | ||
className: `toolbar-item${props.className ? ` ${props.className}` : ''}` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
}))<StyledDivProps>` | ||
color: ${props => | ||
props.active ? props.theme.toolbarItemIconHover : props.theme.panelHeaderIcon}; | ||
padding: 12px 20px; | ||
|
@@ -71,7 +71,6 @@ export type ToolbarItemProps = { | |
icon?: ComponentType<any>; | ||
}; | ||
|
||
/** @type {typeof import('./toolbar-item').ToolbarItem} */ | ||
const ToolbarItem = React.memo((props: ToolbarItemProps) => ( | ||
<StyledDiv | ||
id={props.id} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep the original minified type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we can. Fixed