-
Notifications
You must be signed in to change notification settings - Fork 5
feat(file): add download link per translation - INNO-1581 #105
Conversation
@@ -9,6 +9,7 @@ npm install --save @ecl-twig/ec-component-file | |||
## Parameters | |||
|
|||
- "icon" (object) (default: {}): object of type Icon; file type | |||
- "icon_path" (string) (default: ''): path to the icon file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an issue here.
Icon path is already part of the icon component. So having it in two different places is confusing.
In some components we have this kind of extra parameters, but in most of them it is part of the Icon structure.
This has to be harmonized.
I'm not in favor of adding duplicate parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly agree. To me, icon_path
should be some kind of environment variable, set once and for all. It should not be repeated every time we want to use an icon.
Now, if we don't want to introduce the new variable here, we still have to extract the path from somewhere... Let me refactor it a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be better now
New
download
property added totranslation.items
. This new property lets you define a custom label and href for each translation.For convenience, there's also a new
icon_path
property which defaults toicon.path
in order to avoid breaking changes. This new property is used for the icons that can not be changed (e.g. the download icons, the arrow icon)