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

Website: 🐛 code example chip to same on first page #3310

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,18 @@ const ComponentExamples = ({ node }: CodeExamplesProps) => {
<Chips>
{node.dir.filer.map((fil) => {
const id = `${node.dir.title.toLowerCase()}demo-${fil.navn}`;
const isSelected = active === fil.navn;
return (
<Chips.Toggle
checkmark={false}
key={fil._key}
value={fil.navn}
selected={active === fil.navn}
selected={isSelected}
id={id}
onClick={() => {
const newPath = `${router.asPath.split("#")[0]}#${id}`;
if (newPath === router.asPath) return;
if (isSelected) return;
setUnloaded(true);
const newPath = `${router.asPath.split("#")[0]}#${id}`;
router.replace(newPath);
Comment on lines +115 to 116
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't really need that const now

Suggested change
const newPath = `${router.asPath.split("#")[0]}#${id}`;
router.replace(newPath);
router.replace(`${router.asPath.split("#")[0]}#${id}`);

}}
>
Expand Down