-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
refactor: migrate components/Callout.js to ts #6540
Conversation
Gatsby Cloud Build Reportethereum-org-website-dev 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 28m PerformanceLighthouse report
|
4cd417d
to
994c084
Compare
text: string | ||
} | ||
|
||
// const StyledTweomoji: React.FC<Twemoji> | ||
|
||
const StyledEmoji = styled(Twemoji)` | ||
& > img { |
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.
Twemoji's prop has no .size
property. In order to pass it in, it seems like it needs to be a way to override its FC signature
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.
You can extend the styled component by doing something like this:
const StyledEmoji = styled(Twemoji)<{ size: number }>`
...
`
src/components/Callout.tsx
Outdated
@@ -46,7 +46,16 @@ const Content = styled.div` | |||
height: 100%; | |||
` | |||
|
|||
const Callout = ({ | |||
interface IProps { | |||
image: 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.
image: string | |
image?: 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.
Thanks, updated
text: string | ||
} | ||
|
||
// const StyledTweomoji: React.FC<Twemoji> | ||
|
||
const StyledEmoji = styled(Twemoji)` | ||
& > img { |
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.
You can extend the styled component by doing something like this:
const StyledEmoji = styled(Twemoji)<{ size: number }>`
...
`
src/components/Emoji.tsx
Outdated
text: string | ||
} | ||
|
||
// const StyledTweomoji: React.FC<Twemoji> |
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.
✂️
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.
ah good catch! updated
20c42ae
to
ff1622e
Compare
ah, gatsby cloud says I don't have permission to view the failed build. might need someone else to take a preliminary look |
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.
Looking good @byhow 💪🏼 left a couple of minor comments there to be done.
src/components/Emoji.tsx
Outdated
|
||
const StyledEmoji = styled(Twemoji)` | ||
interface IProp extends MarginProps { |
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.
interface IProp extends MarginProps { | |
export interface IProps extends MarginProps { |
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.
cool, updated
src/components/Emoji.tsx
Outdated
@@ -13,7 +18,7 @@ const StyledEmoji = styled(Twemoji)` | |||
${margin} | |||
` | |||
|
|||
const Emoji = ({ size = 1.5, text, ...props }) => { | |||
const Emoji: React.FC<IProp> = ({ size = 1.5, text, ...props }) => { |
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.
const Emoji: React.FC<IProp> = ({ size = 1.5, text, ...props }) => { | |
const Emoji: React.FC<IProps> = ({ size = 1.5, text, ...props }) => { |
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.
ditto
src/components/Callout.tsx
Outdated
@@ -46,7 +46,16 @@ const Content = styled.div` | |||
height: 100%; | |||
` | |||
|
|||
const Callout = ({ | |||
interface IProps { |
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.
Just for convention
interface IProps { | |
export interface IProps { |
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.
base props exported
@pettinarip Thanks for the detailed suggestion! Changes are resolved |
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.
Great! Thanks @byhow looks good 💪🏼
@byhow be sure to join the discord if you are interested in contributing further to the project or have any questions for the team. And we've just released our 2022 POAPs so remember to claim yours also 🥳! |
@all-contributors please add @byhow for code |
I've put up a pull request to add @byhow! 🎉 |
@pettinarip @byhow : I am sorry but I noticed that a bit late. → The |
Good catch @Mousticke! yes, we should fix that 👍🏼 |
Description
Migrate
Callout.js
, which also includes its imports ofTranslation.js
andEmoji.js
Related Issue
#6392