-
Notifications
You must be signed in to change notification settings - Fork 227
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
feat(top-app-bar): typescript #548
Conversation
This reverts commit d486cef.
Codecov Report
@@ Coverage Diff @@
## feat/two-typescript #548 +/- ##
=======================================================
+ Coverage 96.6% 96.64% +0.03%
=======================================================
Files 60 60
Lines 2208 2233 +25
Branches 145 162 +17
=======================================================
+ Hits 2133 2158 +25
Misses 44 44
Partials 31 31
Continue to review full report at Codecov.
|
packages/top-app-bar/FixedAdjust.tsx
Outdated
className?: string; | ||
dense?: boolean; | ||
prominent?: boolean; | ||
short?: boolean |
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.
;
export default class TopAppBar extends React.Component { | ||
foundation_ = null; | ||
export interface TopAppBarProps { | ||
actionItems?: React.ReactElement<any>[]; |
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.
Usually any is not allowed when using --noImplicitAny, which google3 uses. Is there any reason the generic type cannot be specified ahead of time?
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.
> { | ||
topAppBarElement: React.RefObject<HTMLElement> = React.createRef(); | ||
foundation_?: MDCFixedTopAppBarFoundation | MDCTopAppBarFoundation | MDCShortTopAppBarFoundation; | ||
|
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.
Is this union useful for a 3p developer? If so, consider making a type for MDCTopAppBarFoundation which is the union of these 3
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.
ya that makes sense
@@ -12,7 +21,7 @@ class TopAppBarProminentToShortCollapsedScreenshotTest extends React.Component { | |||
window.addEventListener('resize', this.updateTopAppBarVariant); | |||
} | |||
|
|||
shouldComponentUpdate(_, nextState) { | |||
shouldComponentUpdate(_: {}, nextState: TopAppBarProminentToShortCollapsedScreenshotTestState) { |
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.
Consider @OverRide annotations (for readability)
} from '../../../packages/top-app-bar'; | ||
|
||
const MainTopAppBarContent: React.FunctionComponent<TopAppbarFixedAdjustProps> = (props) => { | ||
return ( |
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.
nit: dont need parens
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.
LGTM, one nit
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
related #48