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

Tab icon in Admin 5 #1068

Closed
UncleSamSwiss opened this issue Apr 25, 2021 · 6 comments
Closed

Tab icon in Admin 5 #1068

UncleSamSwiss opened this issue Apr 25, 2021 · 6 comments
Labels

Comments

@UncleSamSwiss
Copy link
Contributor

Did you already test your adapter in Admin 5 with React? (I can't test it right now as I'm on my phone)

From what I can see, you used an HTML hack to use your own tab icon instead of a standard FA icon.

If you really want to keep using your icon, I would suggest to create a PR for Admin which makes it possible to support SVG icons other than FA. This would have to be done in a way that is backwards compatible.

I would also suggest to use a theme compatible svg (using the special color currentColor), so it is more in line with the FA icons of other tabs (ie monochrome). Here are examples how I achieved this for the dev portal: https://github.com/UncleSamSwiss/iobroker-dev-portal/blob/1cc4d5b10083b37c95c04e326886e096a2c7aa15/express/frontend/src/components/Icons.tsx#L27

@asgothian
Copy link
Collaborator

asgothian commented Apr 25, 2021

I have tested the Adapter with React - it behaves as expected.

  • Within the adapter config, the theme is ignored, the HTML is displayed as it would be without react
  • With the Tab, parts of the theme are honored (background color), but many are not (text color on some tabs, Coloring of Buttons and other UI elements.)
    As far as the tab icon goes, the Zigbee Tab is in good company with the Backitup, EChards and Javascript adapter for being colorful.

A.

@UncleSamSwiss
Copy link
Contributor Author

OK, sounds good. How about a Change Request (Issue) for Admin to officially support non-FA icons?

@kirovilya
Copy link
Collaborator

all works fine with original icons. not only our adapter
image

@UncleSamSwiss
Copy link
Contributor Author

It seems like everything works fine.
What I don't like (from a maintainability perspective) is that there is a "hack" to display another icon. I believe there should be a straight forward way to define a non-FontAwesome icon.

Currently you are using this:

"fa-icon": "</i><img style='width:24px;margin-bottom:-6px;' src='/adapter/zigbee/zigbee.svg'><i>"

I would prefer if admin 5 supported something like

        "adminTab": {
            ...
            "icon": "zigbee.svg"
        }

See also my request here: ioBroker/ioBroker.admin#797

@stale
Copy link

stale bot commented Jul 1, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 1, 2021
@UncleSamSwiss
Copy link
Contributor Author

Admin 5 will no longer use tab specific icons but rather just the adapter icon. Thus, this is no longer an issue.

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

No branches or pull requests

3 participants