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

feat(ui): Action support indirect nesting children #928

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

dengfuping
Copy link
Collaborator

@dengfuping dengfuping commented Jan 13, 2025

📦 Modified package

  • @oceanbase/design
  • @oceanbase/ui
  • @oceanbase/icons
  • @oceanbase/charts
  • @oceanbase/util
  • @oceanbase/codemod
  • Other (about what?)

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

  • None

💡 Background and solution

import React, { useState } from 'react';
import { Action } from '@oceanbase/ui';
import { Drawer, Space } from '@oceanbase/design';

const ActionButton4 = () => {
  const [open, setOpen] = useState(false);
  return (
    <>
      <Action.Button
        onClick={() => {
          setOpen(true);
        }}
      >
        action4
      </Action.Button>
      <Drawer
        open={open}
        title="Drawer Title"
        onOk={() => {
          setOpen(false);
        }}
        onCancel={() => {
          setOpen(false);
        }}
      >
        Drawer Content
      </Drawer>
    </>
  );
};

const ActionButton5 = () => <Action.Button disabled>action5</Action.Button>;

export default () => {
  return (
    <Action.Group>
      <Action.Button>action1</Action.Button>
      <Action.Button disabled tooltip={'禁用展示tooltip'}>
        禁用提示
      </Action.Button>
      <Action.Button
        onClick={() => {
          console.log('hello~~');
        }}
      >
        action3
      </Action.Button>
+      <ActionButton4 />
+      <ActionButton5 />
    </Action.Group>
  );
};

📝 Changelog

Language Changelog
🇺🇸 English -
🇨🇳 Chinese - 🆕 Action 支持子元素间接嵌套。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Tests is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

github-actions bot commented Jan 13, 2025

@dengfuping dengfuping merged commit c0f1850 into master Jan 13, 2025
6 checks passed
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.

1 participant