I'm a wannabe mid-career changer, looking to move into frontend development professionally.
I’m currently learning...I’m focused on learning on accessible HTML, modern CSS and vanilla JavaScript. I also have experience building sites with static site generators. I'm currently working my way through the Launch School (https://launchschool.com/) JavaScript core curriculum, which is why I'm a bit quiet here.
Latest solutions
- Submitted 5 months ago
Product List with Cart - Angular
#angular#typescript- HTML
- CSS
- JS
I've a couple of questions I'd love feedback on - mostly based on my experience with React:
Am I mutating state and does this matter? In the button component I am increasing/decreasing the quantity within the component rather than destroying and updating the state in DesertsService. Everything seems to work OK, but I'm not sure if this is bad practice?
Reaching into the DOM... I'm reaching into the DOM to remove items from the Cart component. I feel like this is wrong. From working with React I feel like I should be handing this over to Angular to take care of rather than using querySelector.
I am also using the native HTML dialog element and methods for the modal. Again this feels wrong, and being able to dismiss the modal with the escape key knocks state out of sync. I used @viewChild to access the dialog, but honestly, I just pasted this in with little understanding.
- Submitted 5 months ago
Result Component - Angular
#angular#typescript- HTML
- CSS
Any advice on basic aspects of Angular that I may have missed or practices could be improved would be most welcome.
- Submitted 5 months ago
Results Component - Learning Angular
#angular#typescript- HTML
- CSS
Any advice on basic aspects of Angular that I may have missed or practices could be improved would be most welcome.
Latest comments
- P@jormazlopSubmitted 8 months agoP@dwhensonPosted 5 months ago
Hi - I'm also working on learning Angular - what you've done looks amazing to me!
One small suggestion would be to make the button element fit the full width and height of it's container as on the initial button when nothing is added to the cart I have to click right in the centre of the button to make things work.
But overall looks great!
Marked as helpful0 - @Yakobus-MardiSubmitted 8 months agoP@dwhensonPosted 5 months ago
Nice work on this one - looks great to me! I guess I wouldn't think of the items in the summary card as headers in this case, and would rather go for a
ul
with them asli
elements inside them, but I'm really nitpicking here!0 - @CYCHAN00Submitted over 2 years agoP@dwhensonPosted over 2 years ago
Hey @CYCHAN00 👋
Lovely job here, and not much to comment on 🙌, but here's a couple of things to think about:
-
Button vs link? One thing that's worth considering is whether an element is actually a
button
or alink
. The most important thing is what the element will do not what it looks like. This page has a great summary and lots of useful links on this: https://css-tricks.com/buttons-vs-links/ I imagine clicking on 'sign up' would take me to a new page, if you also think that then it should be a link. -
I'd also get rid of all those
br
tags inside the square on the bottom right and just put everything inside aul
and make each item anli
. I think this would be more semantic as they seem to be a list to me. You will need to remove the default list styling, but once that's done things will appear as they are now, but be better for people using assistive tech to access your site.
Otherwise, keep up the good work and great job! 🥳
Cheers Dave
0 -
- @nerdy-guySubmitted over 2 years agoP@dwhensonPosted over 2 years ago
Hello Ahmend, 👋
Nice work here! This is a tricky one, you've got some of the hard details like the top border sorted - that really gave me problems for a long while! Here's a few things you might like to consider:
- You are using
grid
on the main section, which is great, but not really getting the maximum benefit from this property. If you're new to it I'd suggest checking it out as it can be super helpful.
In this case, you are using grid, but then also using margin to position elements, I'd go for one or the other (in this case grid most likely!). I'd suggest trying a grid with 4 rows, and 3 columns. And then have each card span the two rows it needs to (so the top card would be rows 1 and 2, and the middle cards 2 and 3, and the bottom card rows 3 and 4 - you'll also need to specify which column they should go in).
Then if you use the
gap
property, rather thanmargin
you should have a nicely laid out desktop page. You can then change the grid layout with a media query for mobiles (I'd actually probably start with the mobile view and then put the settings above in a media query for desktop, but it doesn't matter really).This is a bit of a tricky one to explain, but I hope you get the gist of what I am trying to say. If not just let me know and I'll try and clarify!
Cheers Dave
Marked as helpful1 - You are using
- @someshwari-rudraSubmitted over 2 years agoP@dwhensonPosted over 2 years ago
Hey @Someshwari - Lovely job here.
The site looks great and responds well. Here's a couple of points to think about:
- You are getting some error messages from the linter about missing heading levels. This is because you should use the <h1> headings as the single, main heading of your web page, followed by the <h2> headings, then the less important <h3> headings, and so on, without skipping a level.
We shouldn’t use headings to make text look BIG or bold. Use them only to set out your document's heading and show the document structure, and then change things up with CSS after that.
I approach this by first laying out the page using only HTML and only thinking about the document structure, not design at all, and then once done, I return to the page and use CSS to make things look how they should.
This is important as many people using assistive tech to access your pages will navigate the site based on the heading structure. At the moment this wouldn’t work with your HTML.
- I wonder whether your
button
should actually be a link. I imagine that it will take me to another page to read more? If so it should be a link. Again, the most important thing is what the element will do not what it looks like. This page has a great summary and lots of useful links on this: https://css-tricks.com/buttons-vs-links/
Hope this helps a bit and gives you something to think about for the next challenge!
Keep up the good work. Dave
1 - P@christopher-adolpheSubmitted over 2 years ago
Coffeeroasters subscription site | React, Unit Tests, End-to-End Tests
#cypress#react#react-testing-library#sass/scss#typescriptP@dwhensonPosted over 2 years agoHi Christopher,
Lovely, lovely job here! I'm also pretty new to React and have been learning it for a few months so it's nice to find a fellow student.
I noticed a couple of problems with the final modal 1) Keyboard focus doesn't move there and 2) The body remains scrollable.
I've been lucky to be an early test on Josh Comeau's Joy of React course and just yesterday did the modal lesson. It can be really hectic, but there's a couple of packages that can basically solve this for you:
- react-focus-lock - moves and locks focus to the modal
- react-remove-scroll - removes scroll from all other elememts
I've not tried them on a project but they seem pretty simple to implement and it might be worth giving them a try?
Cheers Dave
Marked as helpful1