FrancescoXX / rustcrab

An Open Source project with everything you need to learn about Rust.
https://rustcrab.com
MIT License
402 stars 69 forks source link

Navigation bug #115

Closed felixoder closed 1 month ago

felixoder commented 1 month ago

after navigating to the see more func the nav menus are not working

https://github.com/user-attachments/assets/4c75b343-92b0-42eb-bd8b-d4fbd1e5cb1e

Thebeast01 commented 1 month ago

I did try to solve it but, I don't know whether it is good practice or not, I just added '/' in front of # in the nav links Although It worked but I think is not the best way to do it, So, Is there any other way ?

felixoder commented 1 month ago

yes that is the way to solve that bug did you raise the PR ? actually I am working with a functionality of #104 may that cause a conflicts.

Thebeast01 commented 1 month ago

No, I haven't raised the pr yet

felixoder commented 1 month ago

ok then

Thebeast01 commented 1 month ago

Since you are working on the fundamental section so you will also add it to the navigation menu right? So you add a forward slash to links as well. Do you think that's all right?

devvsakib commented 1 month ago

Yes, adding / before # will fix it. Thanks

felixoder commented 1 month ago

@Thebeast01 yes I will add that fs

FrancescoXX commented 1 month ago

@Thebeast01 want to be assigned to that?

Thebeast01 commented 1 month ago

@FrancescoXX No @felixoder Is working on it, its just a small fix

FrancescoXX commented 1 month ago

assigned to @felixoder .

If you want a better place to talka bout the project, we can use a channel on my discord server

felixoder commented 1 month ago

yeah for sure. @FrancescoXX

felixoder commented 1 month ago

@devvsakib @Thebeast01 One thing to mention if you use '/' navigation as we are using next file based routing so we will navigate to the more option page as that are (eg, books/page.tsx)

but this is an SPA (single page application) so for eg, /devtools we should navigate to # home menu.

if you use / instead # you can get this error

https://github.com/user-attachments/assets/11d6326b-50fd-4432-98c0-c54d859262dc

I am working with this if you wanna discuss you can (may be we can get some easy option)

devvsakib commented 1 month ago

@felixoder No, its because the folder name is different. please check again. see there are devtools folder, but link is dev_tools.

devvsakib commented 1 month ago

and there are no folder call projects, raise an issue and work on it☘️

felixoder commented 1 month ago

That's not the problem [though there is a spell mistake] buddy either you have to create a separate people folder and a projects folder . But still I want instead going to / route it should stay in main page while navigating to nav menu. I hope you got it.

I dont want this to be a multi page app while navigating to other menu.

https://github.com/user-attachments/assets/0502f107-75ee-4ba5-9365-00673a139d3b

felixoder commented 1 month ago

@devvsakib I want this to be a SPA so may be we will find some solution to make it SPA.

devvsakib commented 1 month ago

did @FrancescoXX told you to make it SPA?

felixoder commented 1 month ago

@FrancescoXX are you good with SPA or we will make it multi page navigation app ? do you have problem with that?

felixoder commented 1 month ago

@devvsakib That's why I have discussed it here! so that we will discuss that it will remain a SPA or a multi page route

Thebeast01 commented 1 month ago

@felixoder No, I didn't say use / instead of # I said Use both πŸ˜‚πŸ˜‚, That why I was not sure that, it is a good practice or not, Like locally If I'm writing link like this /#books, Then it is working

felixoder commented 1 month ago

@Thebeast01 Yeah! I have tried tons of fixes of fix but I found this /# is best! if anyone get another may be they raise some PR

devvsakib commented 1 month ago

Logically, we don't need to add an id in the menu. We can directly navigate the user to the dev tool/book etc. pages when the user clicks on the menu. That makes sense!

If we keep the URL the same with the id, I mean "#", just imagine a scenario where a user has navigated to the book page and then wants to go to the project page. In this case, it will take them to the project section of the home page, which doesn't sound good. We should just change the URL to /books for the book page and /project for the project page.

felixoder commented 1 month ago

Make sence but go to my pr I've fixed that

Thebeast01 commented 1 month ago

@devvsakib but then will it scroll smoothly as it is now?