SyntaxUI / syntaxui

Get free access to pre-built, Tailwind CSS-powered components, animations and effects - brought to life using Framer Motion. Just copy, paste and you're ready to go!
https://syntaxui.com
MIT License
806 stars 52 forks source link

Fixed `Get Portfolio Template` button #216

Closed epoll31 closed 4 months ago

epoll31 commented 4 months ago

Description

I fixed the homepage button that says 'Get Portfolio Template'

Proposed Changes

Checklist

Please check the boxes that apply:

vercel[bot] commented 4 months ago

@epoll31 is attempting to deploy a commit to the SyntaxUI Team on Vercel.

A member of the Team first needs to authorize it.

Ansub commented 4 months ago

useRouter() is better in this case as it doesn't performs page-reload when doing client-side transitions

you can read more here: https://blog.logrocket.com/next-js-routechangestart-router-events/

epoll31 commented 4 months ago

@Ansub I am under the impression that 'Link' also does not perform a full page reload in v14 according to their docs

Either way, we should probably still rename the button something besides DiscordButton

I will close this PR though :)

Ansub commented 4 months ago

Link also does the same thing, if you see the link of the docs you shared, it says:

to provide prefetching and client-side navigation between routes

epoll31 commented 4 months ago

Then should we use <Link prefetch={false}>? This way we are still using a link for SEO and general best practices?

Ansub commented 4 months ago

Then should we use <Link prefetch={false}>? This way we are still using a link for SEO and general best practices?

how will disabling prefetch a best practice, enlighten me please.

prefetching is done so that other page id already fetched to reduce load time when going to next page. making it false will disable the behaviour and then it will act just like an a tag.

epoll31 commented 4 months ago

I thought that was what you were recommending.

I am confused as to what useRouter does better than Link in this case.

You mentioned that useRouter doesn't perform a full-page reload, but I think that Link also doesn't perform a full-page reload.

Ansub commented 4 months ago

I thought that was what you were recommending.

I am confused as to what useRouter does better than Link in this case.

You mentioned that useRouter doesn't perform a full-page reload, but I think that Link also doesn't perform a full-page reload.

yes both does the same thing

epoll31 commented 4 months ago

So should we switch it to a Link? I can open a new PR that is directed to main since this branch is now closed.

Ansub commented 4 months ago

let's work on other stuff, this is not a deal breaker, both does the same work so it doesn't matter