-
Notifications
You must be signed in to change notification settings - Fork 331
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(footer): add component #505
Conversation
Codecov Report
@@ Coverage Diff @@
## master #505 +/- ##
==========================================
- Coverage 99.91% 99.79% -0.12%
==========================================
Files 183 189 +6
Lines 2453 2499 +46
Branches 604 614 +10
==========================================
+ Hits 2451 2494 +43
- Misses 2 5 +3
Continue to review full report at Codecov.
|
the |
@unix @ofekashery any review? |
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 looks like the Footer
component is too customizable and somewhat difficult to handle, you can try to make some updates and I will work on this feature when I have time.
|
||
<style jsx>{` | ||
div{ | ||
margin-bottom:20px; |
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 is recommended to use layout for layout.
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.
what does this mean exactly?
...props | ||
}) => { | ||
const theme = useTheme() | ||
const { breakPoint } = useFooterContext() |
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.
We have hooks on breakpoints
.
But we can't use the hooks directly internally, this may lead to inconsistent data when rendering on the server-side, please refer here: #258
Referring to the design of the Grid
component, we need to integrate the breakpoints in the style.
children, | ||
...props | ||
}) => { | ||
return <div {...props}>{children}</div> |
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.
We can replace it with Footer.Group
, there is no need to add another component, if the user adds a nested structure, we just parse the structure.
components/footer/footer-link.tsx
Outdated
li:before { | ||
content: '' !important; | ||
} | ||
li :global(a) { |
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.
We need to be compatible with text out of alignment, centered or not, etc.
maxWidth, | ||
breakPoint, | ||
...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.
For Footer, I guess there are also users who might want to hover at the bottom of the page.
subFooter?: string | React.ReactNode | ||
ariaLabel?: string | ||
maxWidth?: string | ||
breakPoint?: 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.
Maybe we also need to be compatible with the imperative API.
<Footer data={[]} />
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.
Would try to work on this!
light, | ||
ariaLabel, | ||
children, | ||
subFooter, |
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 API necessary? the user can get the same result by adding a component directly to children
.
As a side note, if you render all DOM nodes in a test, the snapshot becomes very large. |
Hi @Deep-Codes, we really appreciate your contribution!! See also: #262. |
Checklist
Change information
New Footer Component Added.
Covers all Types from link
Added Docs and Tests
Have followed Compound Component Pattern since it was used in Other Components too.
Needs more Suggestion on what Props should be passed.
Demo:
Attempts to Close #502