Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Conversation

Deep-Codes
Copy link
Contributor

Checklist

  • Fix linting errors
  • Tests have been added/updated (or snapshots)

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:

Footer

Attempts to Close #502

@codecov
Copy link

codecov bot commented Apr 3, 2021

Codecov Report

Merging #505 (808bf27) into master (18c1afb) will decrease coverage by 0.11%.
The diff coverage is 93.47%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
components/footer/footer-group.tsx 87.50% <87.50%> (ø)
components/footer/footer-link.tsx 90.00% <90.00%> (ø)
components/footer/footer-column.tsx 100.00% <100.00%> (ø)
components/footer/footer-context.tsx 100.00% <100.00%> (ø)
components/footer/footer.tsx 100.00% <100.00%> (ø)
components/footer/index.tsx 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18c1afb...808bf27. Read the comment docs.

@Deep-Codes
Copy link
Contributor Author

the components/footer/__tests__/__snapshots__/index.test.tsx.snap files seems very huge gotta look into it.

@Deep-Codes
Copy link
Contributor Author

@unix @ofekashery any review?

Copy link
Member

@unix unix left a 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;
Copy link
Member

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.

Copy link
Contributor Author

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()
Copy link
Member

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>
Copy link
Member

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.

li:before {
content: '' !important;
}
li :global(a) {
Copy link
Member

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
}) => {
Copy link
Member

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
Copy link
Member

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={[]} />

Copy link
Contributor Author

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,
Copy link
Member

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.

@unix
Copy link
Member

unix commented Apr 6, 2021

the components/footer/__tests__/__snapshots__/index.test.tsx.snap files seems very huge gotta look into it.

As a side note, if you render all DOM nodes in a test, the snapshot becomes very large.

@ofekashery
Copy link
Member

ofekashery commented Jun 17, 2021

Hi @Deep-Codes, we really appreciate your contribution!!
We're going to wait a bit with this component.
Following the much customization required for this component, we plan to use this PR for the Geist Components Catalog, not as a unique component. We will update soon!

See also: #262.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Footer component
3 participants