Skip to content
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

feat: add icons component and improve codebase structure #2318

Merged
merged 8 commits into from
Apr 21, 2024

Conversation

Anmol-Baranwal
Copy link
Collaborator

Fixes Issue

fixes #2317, fixes #2315

Changes proposed

  • Created a new Icons component: components/icons.tsx

icons

Now:

  • We directly avoid any duplicate imports from the same type of category like fa, and fa6.
  • Anyone can easily add it there itself (a custom svg), or any imported one.
  • We can keep track of what icons are used. Plus, the icons are only loaded once so it improves the time.
  • Easier to debug, and this improves the whole structure. Now we can use normal classNames to style the icons.
  • Removed the assets/icons other than logo.svg
  • Fixed linting errors.
  • Added priority for images so that they're loaded faster.

I've properly checked from the original so that there are no visual changes but do check it from your side once.

Note to reviewers

You can see that I've kept assets/logo.svg -> I've included it in the icons component but the viewport of the logo seems to be messy which is causing the issue. So, I used the previous one.

@Anmol-Baranwal Anmol-Baranwal added goal: new-feature New feature or request goal: refactor Refactoring the codebase labels Mar 22, 2024
Copy link

vercel bot commented Mar 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
linkshub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 20, 2024 6:51am

@github-actions github-actions bot added the priority: high Making completely new feature label Mar 22, 2024
Copy link

@github-actions github-actions bot 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, Anmol-Baranwal, for creating this pull request and contributing to LinksHub! 💗

The maintainers will review this Pull Request and provide feedback as soon as possible! 😇
We appreciate your patience and contribution, Keep up the great work! 😀

Copy link
Collaborator

@aftabrehan aftabrehan left a comment

Choose a reason for hiding this comment

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

Excellent PR, @Anmol-Baranwal 💪 🚀 💯

Category content is not taking up full space of the sidebar. Could you please help to check that?

Screenshot 2024-03-23 at 10 11 44 PM

@Anmol-Baranwal
Copy link
Collaborator Author

Anmol-Baranwal commented Mar 23, 2024

@aftabrehan
I can't see that unless I view the page at 65%. I've even checked in inspect.

Please check if the same issue is with the original URL, so we can solve it separately.
The problem seems to be with the fixed viewport height, or maybe the spacing of this report a bug button.

If you could provide the screen size and instructions on how to check it, I'd be able to solve it properly.

image

CBID2
CBID2 previously approved these changes Mar 23, 2024
Copy link
Collaborator

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

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

LGTM

@aftabrehan
Copy link
Collaborator

I can't see that unless I view the page at 65%. I've even checked in inspect.

I'm using large screen and I can see that on 100%. Let me check the code if I can help.

@aftabrehan
Copy link
Collaborator

@Anmol-Baranwal, the issue (sidebar category height) is fixed in this commit.

@Anmol-Baranwal
Copy link
Collaborator Author

@rupali-codes @CBID2 @aftabrehan
If everything is all right, please review and merge this!

CBID2
CBID2 previously approved these changes Mar 27, 2024
Copy link
Collaborator

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Owner

@rupali-codes rupali-codes left a comment

Choose a reason for hiding this comment

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

Can we put the "Report a Bug" button at bottom-right corner? in the sidebar, there's already a lot for it.

Untitled

Other than it looks pretty fine to me :)

@Anmol-Baranwal
Copy link
Collaborator Author

@rupali-codes
Should it be sticky or floating in the right corner of the screen, or just at the very end?

Should it appear on all routes, including subcategories, or only on the landing page?

Let me know, and I will change it accordingly.

@rupali-codes
Copy link
Owner

@rupali-codes Should it be sticky or floating in the right corner of the screen, or just at the very end?

Should it appear on all routes, including subcategories, or only on the landing page?

Let me know, and I will change it accordingly.

I think it should be sticky,

@Anmol-Baranwal
Copy link
Collaborator Author

@rupali-codes
I've done it. Please check!

I have kept it hidden for xs & sm. And made it slightly responsive for md.
I have also changed the hover color to white, neither red (destructive) nor theme purple was very good.

Attaching it here for reference. Let me know if you want to change it.

image image image

to fix lint warnings
Copy link
Owner

@rupali-codes rupali-codes left a comment

Choose a reason for hiding this comment

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

Hi Anmol, please make the button sticky, currently its only showing the button on hompage, but not on the other pages.

Also, make this button it bit smaller, or maybe just remove the text and keep the icon (question mark)

image

@Anmol-Baranwal
Copy link
Collaborator Author

Hi Anmol, please make the button sticky, currently its only showing the button on hompage, but not on the other pages.

Also, make this button it bit smaller, or maybe just remove the text and keep the icon (question mark)

image

But removing the text might confuse users because it provides context. If you still want it removed, please let me know, and I'll take care of it.

Also, could you clarify what you mean by 'sticky'? Currently, it's floating (sticky) irrespective of scroll position, but are you suggesting it should be attached to the bottom of the page, visible to users as they scroll down?

@rupali-codes
Copy link
Owner

Hi Anmol, please make the button sticky, currently its only showing the button on hompage, but not on the other pages.
Also, make this button it bit smaller, or maybe just remove the text and keep the icon (question mark)
image

But removing the text might confuse users because it provides context. If you still want it removed, please let me know, and I'll take care of it.

Also, could you clarify what you mean by 'sticky'? Currently, it's floating (sticky) irrespective of scroll position, but are you suggesting it should be attached to the bottom of the page, visible to users as they scroll down?

For the first one, lets keep the text but make it smaller. And secondly, the button only showing on main/home page, its supposed to be shown on other pages as well, like category page and resource page.

@Anmol-Baranwal
Copy link
Collaborator Author

@rupali-codes
Done! I've created a component because we're using it in several places, and please check the styling in the light theme. I tried various options, and this one seemed appropriate. Let me know if any changes are needed.

Copy link
Owner

@rupali-codes rupali-codes left a comment

Choose a reason for hiding this comment

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

@Anmol-Baranwal it looks perfect, just one thing, there's a transition delay when changing the theme. And can yo try making the color voilet? ig it would look more attractive then

@Anmol-Baranwal
Copy link
Collaborator Author

@rupali-codes @aftabrehan @CBID2
The changes are done and final. Please review and merge this to avoid any conflicts.

CBID2
CBID2 previously approved these changes Apr 13, 2024
Copy link
Collaborator

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

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

Looks great

@Anmol-Baranwal
Copy link
Collaborator Author

@rupali-codes
I've resolved conflicts if that helps!

Copy link
Owner

@rupali-codes rupali-codes left a comment

Choose a reason for hiding this comment

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

@Anmol-Baranwal there's a small bug, when you click on theme toggler on the resource page, and then click back on the toggler, its closing the sidebar menu

LinksHub.-.Brave.2024-04-20.12-33-02.mp4

@Anmol-Baranwal
Copy link
Collaborator Author

@Anmol-Baranwal there's a small bug, when you click on theme toggler on the resource page, and then click back on the toggler, its closing the sidebar menu

LinksHub.-.Brave.2024-04-20.12-33-02.mp4

Is this related to this PR?
It would be great if someone else can handle it in another PR.
Because this just improves the icon based system and little codebase structure (nothing related to functionality).

@rupali-codes
Copy link
Owner

@Anmol-Baranwal there's a small bug, when you click on theme toggler on the resource page, and then click back on the toggler, its closing the sidebar menu
LinksHub.-.Brave.2024-04-20.12-33-02.mp4

Is this related to this PR? It would be great if someone else can handle it in another PR. Because this just improves the icon based system and little codebase structure (nothing related to functionality).

it's not on the main side, it belongs to this PR only

@Anmol-Baranwal
Copy link
Collaborator Author

@rupali-codes
I don't see the bug and neither can I replicate it.

See the video here.

@rupali-codes
Copy link
Owner

@rupali-codes I don't see the bug and neither can I replicate it.

See the video here.

Okay then, i'm merging this PR for now,

@rupali-codes rupali-codes merged commit 49826fe into main Apr 21, 2024
8 checks passed
@rupali-codes rupali-codes deleted the codebase-structure branch April 21, 2024 09:30
Copy link

Thank you for contributing to LinksHub! Please take a moment to rate this repo's DX on EddieHub's RepoRater and give it a star ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal: new-feature New feature or request goal: refactor Refactoring the codebase priority: high Making completely new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OTHER] Missing Report a Bug [Refactor] improve codebase structure & our team section
4 participants