-
Notifications
You must be signed in to change notification settings - Fork 6
Port components to ts 5 #2724
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 components to ts 5 #2724
Conversation
6459baf
to
f9bb84d
Compare
@@ -220,7 +220,6 @@ function ShareButtons() { | |||
message={encodeURIComponent( | |||
'Check out this OpenStax blog article!' | |||
)} | |||
minimal={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.
The share component is only being used in in this place, which used the minimal
option, so I made it not an option.
justify-content: center; | ||
margin: 1rem 0; | ||
|
||
&:not(.minimal) { |
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.
The minimal
option is the only way it was being called, so I got rid of the non-minimal configuration
@@ -19,37 +24,39 @@ function RenderItem({item, current, onMouseEnter, onClick}) { | |||
onMouseEnter={onMouseEnter} | |||
onClick={onClick} | |||
> | |||
{item.label || item.text} |
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.
Everything that uses it now has label
, not text
.
f1ec16a
to
7460bbe
Compare
const [listening, setListening] = React.useState(false); | ||
const {webtocaseUrl, debug, oid} = useSalesforceContext(); |
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.
Nothing uses webtocaseUrl anymore (postTo is always supplied)
@@ -1,35 +1,21 @@ | |||
import React from 'react'; | |||
import useSalesforceContext from '~/contexts/salesforce'; | |||
|
|||
export function HiddenFields({leadSource}) { |
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.
Nothing uses HiddenFields anymore
@@ -0,0 +1,21 @@ | |||
import React from 'react'; |
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 moved from being its own component to being part of body-units, since nothing else used it. Also simplified it a bit, since there was an image feature that wasn't being used, and with that gone, the quote-bucket
wrapper wasn't needed.
@@ -1,17 +1,12 @@ | |||
import React from 'react'; | |||
import './progress-ring.scss'; | |||
|
|||
function Circle({basicProps, className, strokeDashoffset=0}) { |
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 wasn't abstracting anything! It was a useless layer of component.
return activeButton.textContent; | ||
} | ||
|
||
describe('paginator', () => { |
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.
Didn't have a describe wrapper on it before, so it updates all the lines. Only had one test before; now two, so not a big file anyway.
7460bbe
to
a72dc4c
Compare
2097359
to
b509866
Compare
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.
Seems good just some small questions
@@ -73,16 +73,13 @@ function GatedContentBody({ | |||
function SubjectSelector() { | |||
const {subjectSnippet: data} = useBlogContext(); | |||
const options = React.useMemo( | |||
() => | |||
camelCaseKeys( |
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 transformation happening somewhere else now?
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 realized that camelCaseKeys has no effect, since the keys are all known here (label
and value
). The value for name
is a string, not an object, so there's no recursive structure.
js.src = '//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8'; | ||
fjs.parentNode.insertBefore(js, fjs); | ||
}(document, 'script', 'facebook-jssdk')); | ||
/* eslint-enable */ |
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 don't see this being used in the PR?
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.
It's imported by the "share" component.
(plus some imports that needlessly specify .js)
b509866
to
77d566c
Compare
CORE-870
This is based on #2723 which should be merged before reviewing this.