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

[feature] replace storybook with react-live #55

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Soecka
Copy link
Contributor

@Soecka Soecka commented Aug 28, 2024

[add] react live
[optimize] CodeExample component

[add] react live
[optimize] CodeExample component
@Soecka Soecka added the feature New feature or request label Aug 28, 2024
@Soecka
Copy link
Contributor Author

Soecka commented Aug 28, 2024

[unfinished]

  • state component live editor
    1. <Loading /> Component
    2. <Select /> Component
    3. <Dialog /> Component
    4. <PageNav /> Component

@Soecka Soecka changed the title [feature] Replace storybook with react-live [feature] replace storybook with react-live Aug 28, 2024
Comment on lines +241 to +252
render() {
const { showLoading } = this;

return (
<>
<Button
onClick={async () => {
this.showLoading = true;
await sleep(1);
this.showLoading = false;
}}
style={{ zIndex: '1040' }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
render() {
const { showLoading } = this;
return (
<>
<Button
onClick={async () => {
this.showLoading = true;
await sleep(1);
this.showLoading = false;
}}
style={{ zIndex: '1040' }}
toggle = async () => {
this.showLoading = true;
await sleep(1);
this.showLoading = false;
};
render() {
const { showLoading } = this;
return (
<>
<Button
style={{ zIndex: '1040' }}
onClick={this.toggle}

Comment on lines +212 to +225
<>
<Button
onClick={async () => {
this.showLoading = true;
await sleep(1);
this.showLoading = false;
}}
style={{ zIndex: '1040' }}
>
显示
</Button>

{showLoading && <Loading>加载中...</Loading>}
</>
Copy link
Member

Choose a reason for hiding this comment

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

和下面那个组件有啥区别呢?

Comment on lines +1 to +9
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: pnpm install && pnpm run build
command: pnpm run start
Copy link
Member

Choose a reason for hiding this comment

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

复用其它前端脚手架的同名文件内容,设置更详细。

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

Successfully merging this pull request may close these issues.

开发【动态预览组件】替代 StoryBook
2 participants