-
Notifications
You must be signed in to change notification settings - Fork 9
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
Boda Alexandru #6
base: boda-alexandru
Are you sure you want to change the base?
Conversation
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.
Minor improvements can be added
I like the idea with the markup in javascript
Nice that you used localStorage and fetch
GG ;)
@@ -0,0 +1,88 @@ | |||
<html> |
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 !DOCTYPE html tag should be added
https://developer.mozilla.org/en-US/docs/Glossary/Doctype
https://stackoverflow.com/a/6076465
html/index.html
Outdated
</div> | ||
</div> | ||
<footer> | ||
<div class="footer-left"> |
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 usually is better to name the classes by what they do in the app not by where there are placed (left, right) because the design might change or the view might be changed on mobile
you can put something like '.contact-list', '.contact-links', '.footer-description' or '.footer .description'
const fetchURL = "http://localhost:3000/products"; | ||
|
||
const fetchData = () => { | ||
fetch(fetchURL) |
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.
nice that you use fetch ;)
scripts/script.js
Outdated
let displayData = JSON.parse(localStorage.getItem("fetchedData")); | ||
|
||
const display = () => { | ||
displayData.map((el) => { |
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 can use foreach if we don't do anything with the returning array?
|
||
const display = () => { | ||
displayData.map((el) => { | ||
if (el.id == clickedId) { |
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.
see if you can use strict equality here: https://github.com/airbnb/javascript#user-content-comparison-operators--equality
<div class="product-right"> | ||
<div class="product-right-top"> | ||
<h3> | ||
${el.name} |
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.
nice use of backticks 😁
No description provided.