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

docs(storybook): add version button in storybook toolbar #807

Merged
merged 4 commits into from
Mar 18, 2024

Conversation

ozkersemih
Copy link
Contributor

@ozkersemih ozkersemih commented Mar 4, 2024

In this pr, I want to add custom toolbar button in storybook to redirect beta/stable version
Screenshot 2024-03-04 at 17 21 34

@AykutSarac
Copy link
Member

I don't think it is visible enough within the UI. Is that possible to place a select component or similar under the search input here?

image

@ozkersemih
Copy link
Contributor Author

I don't think it is visible enough within the UI. Is that possible to place a select component or similar under the search input here?

image

I totally aggre with you but i didn't find anything about to add selection for version switching in storybook.

@leventozen leventozen self-requested a review March 14, 2024 10:24
Copy link
Member

@leventozen leventozen left a comment

Choose a reason for hiding this comment

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

LGTM!

@buseselvi
Copy link
Contributor

Great job! Let's add a button like the one below on the welcome pages, too.

image

Copy link
Member

@AykutSarac AykutSarac left a comment

Choose a reason for hiding this comment

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

@erbilnas, in reference to your recent commit, Baklava CDN is integrated into the storybook. However, since the README.md is also displayed on the GitHub repository, we won't be able to access Baklava components from there.

@ozkersemih
Copy link
Contributor Author

@AykutSarac @erbilnas I have another idea

// welcome.stories.mdx file
<Markdown>{ReadMe.slice(0,ReadMe.search("## How to use"))}</Markdown>
<bl-button>...</bl-button>
<Markdown>{ReadMe.slice(ReadMe.search("## How to use"))}</Markdown>

We can split readme in welcome mdx file like this. With this way, also we wont crash original readme file. What do u think?

@erbilnas
Copy link
Collaborator

@erbilnas, in reference to your recent commit, Baklava CDN is integrated into the storybook. However, since the README.md is also displayed on the GitHub repository, we won't be able to access Baklava components from there.

You're correct, let me amend it now.

@ozkersemih
Copy link
Contributor Author

Last touch will be like below, I think it is ok.

<Meta title="Documentation/Welcome" />

<Markdown>{ReadMe.slice(0,ReadMe.search("Baklava is a design system"))}</Markdown>
<div align={"center"}>
  {window.parent.location.hostname.includes('next') && <bl-button variant="secondary" size="large" onclick="window.open('https://baklava.design/', '_blank')">Stable Version</bl-button>}
  {!window.parent.location.hostname.includes('next') && <bl-button variant="secondary" size="large" onclick="window.open('https://next.baklava.design/', '_blank')">Beta Version</bl-button>}
</div>
<Markdown>{ReadMe.slice(ReadMe.search("Baklava is a design system"))}</Markdown>

Screenshot 2024-03-18 at 16 18 14

@erbilnas erbilnas requested a review from AykutSarac March 18, 2024 14:48
@erbilnas erbilnas merged commit 66eca65 into next Mar 18, 2024
7 checks passed
@erbilnas erbilnas deleted the storybook-version-selecting branch March 18, 2024 14:49
Copy link

🎉 This PR is included in version 3.0.0-beta.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented May 2, 2024

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

6 participants