Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Icon naming conflict #6

Closed
pareeohnos opened this issue Mar 29, 2021 · 5 comments
Closed

Icon naming conflict #6

pareeohnos opened this issue Mar 29, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@pareeohnos
Copy link

It seems that there are multiple icons that have the same name based on the main website, and as a result I'm unable to import the correct one. For example, the following two icons are both called Bin 1 on the website

streamline-icon-bin-1@140x140-2
streamline-icon-bin-1@140x140

And when viewing the relevant import statement, they both show

import Bin1 from '@streamlinehq/streamlinehq/images/streamline-light/bin-1.svg'

When the package downloads all of the icons, the folder only contains a single bin-1.svg icon (no copies, or 1.1 or anything) and as such, importing the bin icon that I actually want gives me the wrong icon.

I'm not sure how many icons this is happening to, this is jus the one I've found but I'm sure there are probably more

@cbrwizard
Copy link
Contributor

You're right, it's an issue in this package design and it must be fixed.
We will be releasing a 1.1.X version of a package soon which uses an image's name + a shortened part of its id. Eg this Bin1 image will be available to import as @streamlinehq/streamlinehq/images/streamline-light/bin-1-n8OgWa.svg. This means it will be a breaking change unfortunately :\

@pareeohnos
Copy link
Author

ok great thanks, I can live with that 🙂

@cbrwizard
Copy link
Contributor

cbrwizard commented Mar 30, 2021

Done: this change is implemented in version 2.0.0 https://github.com/webalys-hq/streamlinehq-npm/releases/tag/2.0.0. Please note that it introduces a couple of other breaking changes as well.

Please check it out and tell if it solves your issue.

@cbrwizard cbrwizard added bug Something isn't working awaiting feedback Streamline is waiting for user's comment labels Mar 30, 2021
@timc13
Copy link

timc13 commented Mar 30, 2021

This doesn't seem very ergonomic. Is there somewhere that lists these ids so that we can easily import icons as needed ?

@cbrwizard
Copy link
Contributor

cbrwizard commented Mar 31, 2021

It's in the app itself: go to https://app.streamlinehq.com, select a family you're interested in, then select an icon you're interested in and see the import path in the sidebar
Screenshot 2021-03-31 at 10 38 30
Another option is to use an IDE which suggests you to autocomplete a path to an image:
Screenshot 2021-03-31 at 10 39 32

I've updated README with these instructions https://github.com/webalys-hq/streamlinehq-npm/blob/master/README.md

On a side note, we're considering adding plugins to popular IDEs: Visual Studio Code and Webstorm, where you would be able to select an image and paste it in code visually. Another thing we're adding soon is a desktop app with drag&drop support.

@cbrwizard cbrwizard self-assigned this Mar 31, 2021
@cbrwizard cbrwizard removed the awaiting feedback Streamline is waiting for user's comment label Mar 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants