Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

feat: creating a footer #42

Merged
merged 31 commits into from Oct 25, 2023
Merged

Conversation

CBID2
Copy link
Contributor

@CBID2 CBID2 commented Oct 17, 2023

For an example of how to fill this template out, see this Pull Request in the Wiki.

Description

This PR creates a footer.

Fixes Issue

Closes #16

Acceptance Criteria

  • Under the pages folder, create a folder called components
  • Create a file called Footer.js
  • Create a footer using full with of the device
  • Footer showing on bottom of the page
  • Logo is showing in the footer
  • a copyright section is added below
  • No additional styling needed

Type of Changes

Make sure your code follows the code style of this project.
Make sure your code is up2date.
The title of the PR is the same as the title of the issue.

Type
πŸ› Bug fix
x ✨ New feature
πŸ”¨ Refactoring
πŸ’― Add tests
πŸ”— Update dependencies
πŸ“œ Docs

Updates

Before

Footer(Before)

After

Testing Steps / QA Criteria

@netlify
Copy link

netlify bot commented Oct 17, 2023

βœ… Deploy Preview for accessibility-mentor ready!

Name Link
πŸ”¨ Latest commit 5c82834
πŸ” Latest deploy log https://app.netlify.com/sites/accessibility-mentor/deploys/6538ac31139f1500087008dc
😎 Deploy Preview https://deploy-preview-42--accessibility-mentor.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100
Accessibility: 100
Best Practices: 100
SEO: 92
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@CBID2 CBID2 marked this pull request as ready for review October 18, 2023 01:12
@CBID2 CBID2 marked this pull request as draft October 18, 2023 01:20
@YuriDevAT
Copy link
Member

Nice start so far @CBID2 πŸ™‚

@CBID2
Copy link
Contributor Author

CBID2 commented Oct 18, 2023

Nice start so far @CBID2 πŸ™‚

Thanks @YuriDevAT! 😊 I just need to figure out a way to add the CSS πŸ€”

@CBID2 CBID2 marked this pull request as ready for review October 19, 2023 23:28
@CBID2
Copy link
Contributor Author

CBID2 commented Oct 19, 2023

Hi @YuriDevAT! :) My PR is officially ready for review! :)

@YuriDevAT
Copy link
Member

Nice start so far @CBID2 πŸ™‚

Thanks @YuriDevAT! 😊 I just need to figure out a way to add the CSS πŸ€”

Oh sorry, I missed this comment!

@YuriDevAT
Copy link
Member

Can you share a screenshot with the footer showing on your screen?

I implemented it (since it wasn't already and there were no further instruction on how to implement it) by adding it to the index.js file under the <main>.
Code snippet of the index file

But I get a compile error because the logo was not imported right.
Failed to compile

Copy link
Member

@YuriDevAT YuriDevAT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your contribution to the project πŸ˜ƒ I left some comments. After making some changes I am happy to merge your PR. You are doing such a great job πŸ”₯

Always keep in mind to test your implementation, checking, if everything is working on your side as expected. It makes PR approvals way faster. πŸš€

pages/components/Footer.js Outdated Show resolved Hide resolved
pages/components/Footer.js Outdated Show resolved Hide resolved
pages/components/Footer.js Outdated Show resolved Hide resolved
const Footer = () => {
return (
<footer style={{ width: "100%", position: "relative", bottom: "0"}}>
<Image src={Logo} alt="footer-logo" width={100} height={100}></Image>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice usage of the Image tag πŸ˜„. It can be used as a self closing tag, written as <Image src={Logo} alt="footer-logo" width={100} height={100} />, as tags for images are generally written in HTML.

const Footer = () => {
return (
<footer style={{ width: "100%", position: "relative", bottom: "0"}}>
<Image src={Logo} alt="footer-logo" width={100} height={100}></Image>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image size is reforming the logo.
Logo reformation

Correct implemention of default width and height directly on the component πŸ‘πŸ½ If the ration is not known it can be calculated, or (which is not best practice but would do it for now), use height="auto" to keep the ratio of the logo.


const Footer = () => {
return (
<footer style={{ width: "100%", position: "relative", bottom: "0"}}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the usage of position here? I could not see a difference when not using it. Maybe I oversee something here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @YuriDevAT. I was struggling with moving it to the bottom position: relative; So I found this tutorial to help me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing. The tutorial is good! Is it working as expected on your side? As mentioned in the tutorial, the position attribute for the footer depends on the settings of the main component. Since you did not make any changes there I guess it will not work.

@CBID2
Copy link
Contributor Author

CBID2 commented Oct 22, 2023

Hi @YuriDevAT! :) I revised the file path for the image import component, but for some reason, it does not show up in the deployment. Did I do something wrong? Also, I use height ="auto" like you suggested?

@YuriDevAT
Copy link
Member

Hi @YuriDevAT! :) I revised the file path for the image import component, but for some reason, it does not show up in the deployment. Did I do something wrong? Also, I use height ="auto" like you suggested?

Where did you import the footer? The logo shows up on my side with this path.

@CBID2
Copy link
Contributor Author

CBID2 commented Oct 22, 2023

Hi @YuriDevAT! :) I revised the file path for the image import component, but for some reason, it does not show up in the deployment. Did I do something wrong? Also, I use height ="auto" like you suggested?

Where did you import the footer? The logo shows up on my side with this path.

I didn’t commit that line of yet @YuriDevAT. When I tried it locally, nothing showed up. For context, I did the import like this:
import Footer from β€œ./components/Footer”

@CBID2
Copy link
Contributor Author

CBID2 commented Oct 22, 2023

Hi @YuriDevAT. I managed to get the footer to show. I also added the screenshots in the Before and After section. Do you mind if I add my code to the index.js file? I know it's not required, but it would quicken the website building process. :)

@YuriDevAT
Copy link
Member

YuriDevAT commented Oct 23, 2023

Hi @YuriDevAT. I managed to get the footer to show. I also added the screenshots in the Before and After section. Do you mind if I add my code to the index.js file? I know it's not required, but it would quicken the website building process. :)

Ah, I see now where the miscommunication lies. My apologies πŸ™πŸ½ .

  • Footer showing on bottom of the page

was meant to implement it for everyone to see and to check it for PR, therefore it is needed to import the footer component in the index.js file.

@YuriDevAT
Copy link
Member

Hi @YuriDevAT! :) I revised the file path for the image import component, but for some reason, it does not show up in the deployment. Did I do something wrong? Also, I use height ="auto" like you suggested?

Where did you import the footer? The logo shows up on my side with this path.

I didn’t commit that line of yet @YuriDevAT. When I tried it locally, nothing showed up. For context, I did the import like this: import Footer from β€œ./components/Footer”

It's working now, right? The logo with the original path is showing up in your local environment.

Copy link
Member

@YuriDevAT YuriDevAT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are getting there πŸ˜„ Small adjustments, then there is only the position task left.

Hang in there πŸ™ŒπŸ½

}}
>
<Image src={logo} alt="footer-logo" width={100} height="auto" />
<p className="copyright">
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 class in use? If not, then it can be deleted.

textAlign: "center",
}}
>
<Image src={logo} alt="footer-logo" width={100} height="auto" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerning accessibility, think of a better alt text for the logo, or if alt text is even needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @YuriDevAT! :) I think it's best to keep the alt text so it can be read by screen readers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, alt text is for being read by screen reader users, but that does not necessarily mean you should add one. Especially when it comes to logos (which does not link to anything, yet), the alt text should be left empty like this alt="".
Read this article about alt text decision tree, it is really helpful to understand the need of alt text better https://www.w3.org/WAI/tutorials/images/decision-tree/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A detailed alt text is typical and very good when it comes to images, I never saw it for logos, though. Logos are mostly used as links (like, Go To Homepage, or Go To Website when it is a logo which links to another companies website). But at the current state, the logo does not link anywhere, so no alt text needed (it will be a future issue, though, so keep your eyes open πŸ‘€ )

❗ But I like how detailed you are able to describe even a logo, this is a skill not many people have. Hopefully, you make good use of it in the future, when alt text is needed on descriptive images πŸ™ŒπŸ½

Comment on lines 12 to 13
margin: "auto",
textAlign: "center",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't necessary to fulfill the AC πŸ‘‡πŸ½

  • No additional styling needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted

@CBID2
Copy link
Contributor Author

CBID2 commented Oct 23, 2023

Hi @YuriDevAT! :) I revised the file path for the image import component, but for some reason, it does not show up in the deployment. Did I do something wrong? Also, I use height ="auto" like you suggested?

Where did you import the footer? The logo shows up on my side with this path.

I didn’t commit that line of yet @YuriDevAT. When I tried it locally, nothing showed up. For context, I did the import like this: import Footer from β€œ./components/Footer”

It's working now, right? The logo with the original path is showing up in your local environment.

Yes

@CBID2
Copy link
Contributor Author

CBID2 commented Oct 23, 2023

Hi @YuriDevAT. I forgot to mention this in my Linkedin DM. I decided to make the logo's alt text a bit more detailed. Here's what I wrote:

next to black, yellow, and blue dots is Julia's project, accessibilityfirst, written in lowercase and black and blue colors

pages/index.js Outdated Show resolved Hide resolved
Copy link
Member

@YuriDevAT YuriDevAT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey you πŸ˜„ Last time revising your PR. Small adjustments but then it should be ready to go.

Please read my comments carefully and make sure you understand everything I mentioned as well as the ACs. If not, please ask me. Less code is more in this case. You will get a feeling for it soon, you will see 😎

pages/index.js Show resolved Hide resolved
Comment on lines 10 to 13
display: "flex",
flexDirection: "column",
alignItems: "center",
textAlign: "center",
Copy link
Member

@YuriDevAT YuriDevAT Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed. Please stick to the AC. Also discussed on LinkedIn πŸ‘‡πŸ½

just go without position, just leave the width:100% and we are good to go 😊

Conversation on additional styling

Next steps πŸ‘‰πŸ½ Remove everything except the width. Only do as much as described in the AC to get your PRs merged. The design of the footer will look nothing alike as it is now. So, all this code is going to be removed with the next ticket for the footer already, which is unnecessary work for the next contributor as well as for the maintainer mentioning this step in the ticket.

Expected output

<footer
  style={{
    width: "100%",
  }}
>

Wish πŸ™πŸ½ : Please talk and explain reasoning behind your decisions for me to understand certain things better. If there are things you do not understand, ask me! This prevents unnecessary work for both of us which is very much appreciated to create a smooth work experience.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your input with this @YuriDevAT. I was going back and forth with using Flexbox. I wanted to show of my knowledge a bit more (plus Flexbox is easier to use in my experience), but I wanted to follow the task list. Unfortunately, I went with my slightly more ambitious side. No worries, I'll definitely stick with your suggestions this time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the feeling all to well 😁. But you will be able to show off your skills when we dive deeper into the code base, I promise 🀞🏽

textAlign: "center",
}}
>
<Image src={logo} alt=" " width={100} height="auto" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove space between quotes:
Now: alt=" "
After: alt=""

@CBID2
Copy link
Contributor Author

CBID2 commented Oct 25, 2023

Hi @YuriDevAT! I read your comments carefully like you suggested and made the adjustments

@YuriDevAT YuriDevAT added the hacktoberfest-accepted Hacktoberfest contribution label Oct 25, 2023
@YuriDevAT
Copy link
Member

You did it πŸ₯³ Thank you so much for your contribution, @CBID2 πŸ’Ÿ

I am sooo grateful for this experience. This PR taught me a lot about myself, how I have to improve my communication skills, and that there are so many things I have to consider and work on to be a good maintainer. Thank you. Couldn't have done it without you πŸ™πŸ½

Looking forward to your next contribution, Christine πŸ˜„

@YuriDevAT YuriDevAT merged commit 9eaa45a into YurisCodingClub:main Oct 25, 2023
4 of 5 checks passed
@CBID2 CBID2 deleted the adding-a-footer branch October 25, 2023 14:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hacktoberfest-accepted Hacktoberfest contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add footer
2 participants