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

Add custom menu component support to Basic Theme #15611

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

enisn
Copy link
Member

@enisn enisn commented Feb 6, 2023

Description

Resolves part of #12118 (write the related issue number if available)

Since defining a custom component is related to a theme, this operation can't be planned without a theme dependency. So, the component code will be different according to different themes. Each theme should implement this logic itself if possible.

custom-component-basic-theme

Checklist

  • I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue) Will be done after all themes implemented

How to test it?

UseComponent() method can be used in MenuContributor in a project that uses the basic theme.

context.Menu.Items.Add(
  new ApplicationMenuItem("Custom.1", "My Custom Menu", "#")
    .UseComponent(typeof(MyMenuComponent)));

@enisn enisn requested a review from maliming February 6, 2023 12:09
@EngincanV EngincanV added this to the 7.1-preview milestone Feb 6, 2023
@enisn enisn requested review from realLiangshiwei and EngincanV and removed request for maliming February 6, 2023 13:00
@enisn enisn merged commit d5b2414 into dev Feb 6, 2023
@enisn enisn deleted the custom-component-basictheme branch February 6, 2023 15:29
{
<DynamicComponent Type="@customComponentType" />
}
else if (url != null)
Copy link
Contributor

@rqx110 rqx110 Feb 7, 2023

Choose a reason for hiding this comment

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

is this mistake? the url will never null.
revert to use MenuItem.Url != null ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in #15625

enisn added a commit that referenced this pull request Feb 7, 2023
@enisn enisn mentioned this pull request Feb 7, 2023
2 tasks
EngincanV added a commit that referenced this pull request Feb 7, 2023
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.

None yet

3 participants