Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

FAQ Component - React | TailwindCSS | MaterialUI

#react#tailwind-css#material-ui
elliezubā€¢ 80

@elliezub

Desktop design screenshot for the FAQ accordion card coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Creating this project I decided to try out materialUI to make the accordion, it turned out to be pretty useful!

Feedback is welcome.

Community feedback

Yazdunā€¢ 1,310

@Yazdun

Posted

This is looking great, well done!

I have a suggestion for you, instead of hardcoding accordion data, you can store all the accordion data inside an array and map through the array inside your react component.

This way you won't need to repeat the same code with different title and description, it also will be so much easier to update the data or change the JSX since the pattern is repeated only once.

I've already opened a PR which resolves this issue, make sure to check it out.

Other than that, it's looking fantastic, keep up the incredible work!

Marked as helpful

1

elliezubā€¢ 80

@elliezub

Posted

@Yazdun wow !! Thank you so much for the feedback, I thought it was a bit repetitive but I wasn't sure how to fix that. I'll go check out your PR now :)

1
Yazdunā€¢ 1,310

@Yazdun

Posted

@elliezub You're welcome, Ellie! šŸ‘šŸ‘šŸ‘

1
P
BrunoMoletaā€¢ 520

@brunomoleta

Posted

Hi Ellie,

It's a valuable call to make your React components smaller. From what I checked out you used only an Accordion component (besides the main.jsx)

For example, inside the Accordion you can do

        return (<>
{data.map((item) => (
        <DetailsItem
            ...
        />
      ))}

And put all that code in a separate component. It might seem unnecessary at first glance, but it makes it much easier for someone else to read your code.

The code may be separate so that the app.jsx becomes something similar to:

    <>
      <div className="stack-x-large grid grid-row-1-auto">
        <Container />
      </div>
    </>

I suggest you look at how the files are managed in my solution.

Great effort, and keep up the hustle.

Best regards from Brazil šŸ‡§šŸ‡· :)

Marked as helpful

0

elliezubā€¢ 80

@elliezub

Posted

@brunomoleta That's great advice, I thought it was small enough already, but it's a really good point. I will definitely do this in the future.

Thanks again!

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord