Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Link Sharing App, Firebase, React Hook Form, Radix-UI, dnd-kit

firebase, next, react, tailwind-css, typescript
Kamil Szymon•700
@kamiliano1
A solution to the Link-sharing app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


React Hooks Form

The first time I was using it with the useFieldArray hook to generate a dynamic form I depended on the user links. It was useful for adding and removing links. It was quite challenging was connect the React Hooks Form with the Radix UI Select element. Finally, I managed to solve the problem using the Controller from React Hooks Form.

React Recoil

To manage the state I've used

userAccountAtom.ts;

It keeps all the users' information he provided. It's updating on every user change.

  firstName?: string;
  lastName?: string;
  email?: string;
  picture?: string;
  userLink: UserLink[];
  isLoaded: boolean;
  isAvatarChanged: boolean;

isLoaded is preventing from loading data from the firebase more than one time. userLink array takes care of all links created by the user

type UserLink = {
  platform: PlatformsType;
  link: string;
  id: string;
  order: number;
};

order was created to have the correct position on the application and on the firebase. When the user uses drag and drop it also updates the order and the Firebase collection

const snippetQuery = query(
  collection(firestore, `users/${userId}/userLinks`),
  orderBy("order", "asc")
);

React-loading skeleton

Improve the user experience when the web is loading.

Profile Details Skeleton

react-icons

Instead of the SVG icons I've used react-icons.

react-spinners

Was used to show the loading state on the buttons when the changes are updated to the firebase.

Firebase

Was used to save user details to the Firebase. It keeps all provided by user credentials. Links are stored in the userLinks collection:

type UserLink = {
  id: string;
  link: string;
  order: number;
  platform: PlatformsType;
};

Avatars are stored in the Firebase storage in the folder:

`avatars/${userId}/image`;

dnd-kit

Was used for drag and drop links features.

Radix-UI

To improve accessibility:

  • radix-ui/react-dialog was used to log in and Register Modal
  • radix-ui/react-navigation-menu to the Navbar
  • radix-ui/react-select displays a list of all platforms that the user can choose
  • radix-ui/react-toast for the popUp when using save changes or copy the user link to the clipboard

Continued development

  • Right now all links have unique backgrounds and font colors. Improve user options to have a way to change the color of each platform.
  • Give users a way to add additional platforms.
Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Dan Marius•1,275
    @danmlarsen
    Posted 2 months ago

    Hello, Kamil! 👋

    Congratulations on finishing the challenge! The result looks fantastic, responds well, and it works just as expected.

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub