-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
fix: navigates user to the relevant category when URL is provided #2786
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ export default function toolsList({ toolsData }) { | |
<div className="" data-testid="ToolsList-main" > | ||
{Object.keys(toolsData).map((categoryName, index) => { | ||
if(toolsData[categoryName].toolsList.length > 0) return ( | ||
<div className='my-8' key={index} id={categoryName}> | ||
<div className='my-8 scroll-m-96 scroll-mb-96' key={index} id={categoryName}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why there is a change in the design ?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we select the category from the dropdown directly, it takes us to the heading of that category, but it does not happen if we directly enter the URL. Hence this change in the CSS. |
||
<Heading typeStyle='heading-md-semibold' className='my-2' > | ||
{categoryName} | ||
</Heading> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should use hardcode functions.
Is there any other way of doing this??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get what you mean by hardcoded functions. Could you please elaborate on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean how we are checking the slug and replacing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are looking at the specific component of the URL i.e. the category. Hence for URLs like
domain/tools#Frameworks
I try to extract the wordFrameworks
usingelementIndex
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try running this url on your local host
https://localhost:3000/tools#Documentation%20Generators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asyncapi.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sambhavgupta0705 is the PR good to be merged?