Skip to content

Conversation

@rajsite
Copy link
Member

@rajsite rajsite commented Jan 23, 2026

Pull Request

🀨 Rationale

πŸ‘©β€πŸ’» Implementation

πŸ§ͺ Testing

βœ… Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

{
var prefersDark = await JSRuntime!.InvokeAsync<bool>("DemoShared.PrefersColorScheme.prefersDark");
Theme = prefersDark ? Theme.Dark : Theme.Light;
await JSRuntime!.InvokeVoidAsync(
Copy link
Member Author

Choose a reason for hiding this comment

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

We should make a new helper component in the OkBlazor library like OkIconDynamic that has a static function to call this for the user.

Something like:

public partial class OkIconDynamic : ComponentBase
{
    public static async Task RegisterIconDynamicAsync(IJSRuntime jsRuntime, string name, string url)
    {
        await jsRuntime.InvokeVoidAsync(
            "DemoShared.IconDynamic.registerIconDynamic",
            name,
            url);
    }
}

Comment on lines +70 to +75
IconDynamic: {
registerIconDynamic: function (name, url) {
const registerIconDynamic = window.customElements.get('ok-icon-dynamic').registerIconDynamic;
registerIconDynamic(name, url);
}
}
Copy link
Member Author

@rajsite rajsite Jan 23, 2026

Choose a reason for hiding this comment

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

To align with above, this should be moved to the OkBlazor.lib.module.js in the window.OkBlazor object:

window.OkBlazor = window.OkBlazor ?? {
isReady: () => isReady
};

Base automatically changed from icon-refactor to main January 23, 2026 20:54
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