Skip to content

Conversation

heiyu4585
Copy link
Contributor

support items

@lgtm-com
Copy link

lgtm-com bot commented Nov 13, 2022

This pull request introduces 2 alerts when merging 1f66513 into 1924a3f - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented Nov 13, 2022

This pull request introduces 2 alerts when merging 7222fc3 into 1924a3f - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@codecov
Copy link

codecov bot commented Nov 13, 2022

Codecov Report

Merging #164 (01e2341) into master (1924a3f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #164   +/-   ##
=======================================
  Coverage   97.76%   97.77%           
=======================================
  Files           7        7           
  Lines         224      225    +1     
  Branches       44       46    +2     
=======================================
+ Hits          219      220    +1     
  Misses          5        5           
Impacted Files Coverage Δ
src/KeywordTrigger.tsx 93.33% <ø> (-0.42%) ⬇️
src/Option.tsx 100.00% <ø> (ø)
src/DropdownMenu.tsx 100.00% <100.00%> (ø)
src/Mentions.tsx 99.28% <100.00%> (+0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

<Option value="bamboo">Bamboo</Option>
<Option value="cat">Cat</Option>
</Mentions>
items={[
Copy link
Member

Choose a reason for hiding this comment

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

options~~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@heiyu4585 heiyu4585 changed the title feat: support items feat: support options Nov 17, 2022
src/Option.tsx Outdated

export interface OptionProps {
value?: string;
label?: string | React.ReactNode;
Copy link
Member

Choose a reason for hiding this comment

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

单独拆一个 ts 定义,否则 Mentions.Option 也会出现 label 的定义

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

>
{options.map((option, index) => {
const { key, disabled, children, className, style } = option;
const { key, disabled, className, style, label, children } = option;
Copy link
Member

Choose a reason for hiding this comment

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

data driven 后,这边只取 label 就好,这边 也把 children 转成 label

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@lgtm-com
Copy link

lgtm-com bot commented Nov 17, 2022

This pull request fixes 1 alert when merging c2c6dd5 into 1924a3f - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

src/Mentions.tsx Outdated
label?: string | React.ReactNode;
key?: string;
disabled?: boolean;
children?: React.ReactNode;
Copy link
Member

Choose a reason for hiding this comment

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

这个就没 children 了,可以直接:

export interface DataDrivenOptionProps extends Omit<OptionProps, 'children'> {
  label?: React.ReactNode;
}

@lgtm-com
Copy link

lgtm-com bot commented Nov 17, 2022

This pull request fixes 1 alert when merging 01e2341 into 1924a3f - view on LGTM.com

fixed alerts:

  • 1 for Useless assignment to local variable

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@zombieJ zombieJ merged commit d1cd4b2 into react-component:master Nov 17, 2022
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