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

<ComparisonTable>, <FAQ>, <Search> tweaks #1927

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Conversation

dimaMachina
Copy link
Collaborator

No description provided.

Copy link

changeset-bot bot commented Dec 23, 2024

🦋 Changeset detected

Latest commit: ac86875

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@theguild/components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 23, 2024

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@theguild/components 8.2.1-alpha-20250106124202-ac86875c14251d3f4ab49c90817cc7815270a356 npm ↗︎ unpkg ↗︎

Copy link
Contributor

📚 Storybook Deployment

The latest changes are available as preview in: https://833bd4b8.the-guild-docs-storybook.pages.dev

@dimaMachina dimaMachina changed the title Update nextra 4 and search tweaks <ComparisonTable>, <FAQ>, <Search> tweks Jan 3, 2025
@dimaMachina dimaMachina changed the title <ComparisonTable>, <FAQ>, <Search> tweks <ComparisonTable>, <FAQ>, <Search> tweaks Jan 3, 2025

useEffect(() => {
const html = document.querySelector('html')!;
const path = pathname.replace('/graphql/hive', '/');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this always be /graphql/hive?

Comment on lines +47 to +50
{cloneElement(children, {
components: {
a,
h2,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can't be done with a provider in Server Components world, right?

Copy link
Collaborator Author

@dimaMachina dimaMachina Jan 4, 2025

Choose a reason for hiding this comment

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

yes, here is code from Yoga how it looks like, FAQ is mdx
image

return <td className={cn(cellStyle, className)} {...props} />;
};

export const ComparisonTable = Object.assign(Table, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we could

import { Table } from "@theguild/components"
Suggested change
export const ComparisonTable = Object.assign(Table, {
export const Table = Object.assign(_Table, {

It doesn't really have to be a comparison table. It is one in Mesh, maybe in Yoga too, but I think the styles work for every table.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in components <Table> component already reexported from Nextra

, should we override the default Table for mdx pages too?

const html = document.querySelector('html')!;
const path = pathname.replace('/graphql/hive', '/');

if (faqPages.includes(path) && !html.hasAttribute('itemscope')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Like I mentioned on Slack, I doubt this check is needed.

@@ -83,7 +85,7 @@ export function HiveNavigation({
},
],
developerMenu,
searchProps,
search = <Search />,
Copy link
Collaborator

Choose a reason for hiding this comment

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

You moved the styles here to a .css file, right?

Copy link
Collaborator Author

@dimaMachina dimaMachina Jan 4, 2025

Choose a reason for hiding this comment

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

yes, because in Yoga I use <VersionnedSearch> search which passes Pagefind's filters

So I will avoid copy-pasting x100 characters className

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants