-
Notifications
You must be signed in to change notification settings - Fork 6
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
Port details page to ts 2 #2680
Conversation
30cca47
to
6ae7c3e
Compare
@@ -5,11 +5,9 @@ import memoize from 'lodash/memoize'; | |||
export function bookToc(slug: string) { | |||
return cmsFetch(slug) | |||
.then((bi) => { | |||
const isRex = true; |
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.
All books are Rex now, so I removed the CNX fetching stuff.
} | ||
|
||
export default function AuthorsSection() { | ||
const {authors, title} = useDetailsContext(); |
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.
had been passing model
around, but it's just the info from the Context. polish
is derived from it.
const title = model.title; | ||
const blurb = model.errataContent; | ||
export function ErrataContents() { | ||
const {title, errataContent: blurb, bookState} = useDetailsContext(); |
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.
Again, model
and polish
didn't need to be parameters.
|
||
type LeftContentModelType = { |
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.
This was a different definition of what should have been ResourceModel
|
||
const settings = window.SETTINGS; | ||
|
||
export default function ResourceBox({model}) { |
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.
I split the components out into resource-box.tsx, and left the utilities in here, renaming it resource-box-utils.js It will go to TS in the next PR.
@@ -16,12 +17,10 @@ type VideoResourceBoxModelType = { | |||
resourceCategory: string; | |||
}; | |||
|
|||
type BoxModel = { heading: string }; |
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.
Another that should have just been ResourceModel
onClick={() => toggle()} | ||
onKeyDown={treatSpaceOrEnterAsClick} | ||
aria-controls="toc-drawer" |
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.
A little accessibility
{viewsUsed.desktop && <JITLoad importFn={importDesktopView} />} | ||
</div> | ||
{ | ||
viewsUsed.phone && |
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.
Moved the condition to the outside to control the entire view.
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.
Minor concern about the deleted test and some questions.
a0c23a1
to
a72bef4
Compare
CORE-592
This builds on #2679 which should be merged first.