-
Notifications
You must be signed in to change notification settings - Fork 0
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
Image link should not render the external link icon by default #160
Conversation
HCRC-112. In a secondary link, an anchor element had span for text and another for the link icon. Both the sublements were displayed as flex, which made them to fill the whole row and rendering the icon in another row compared to the text.
5556566
to
95f0270
Compare
HCRC-112. If there is an image included in the Link children, the external link icon should not be rendered by default for the external links. It can be forced with `showExternalIcon` prop.
95f0270
to
d8ca726
Compare
7c6ade7
to
35213d5
Compare
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.
It would good to document the recursiveMap
function as although the code is not long it still has nuances, e.g. there are non-mapped parts (i.e. stuff not being run through fn
) and mapped parts (i.e. stuff being run through fn
), why the difference? What does the function really do as it skips mapping on some elements and not on others? Adding clear documentation for this would certainly help understand the code's intention.
35213d5
to
5d4edac
Compare
HCRC-112. Add a recursively map utility, that can be used to recursively map the React children. Add a findAllElementsOfType utility, that takes advantage of the `recursiveMap` and `getChildrenByType` utilities. Add tests to each utility. Finally, the Link should use the new findAllElementsOfType utility to search for images inside an anchor.
5d4edac
to
4de2ede
Compare
HCRC-112.
If there is an image included in the Link children, the external link icon should not be rendered by default for the external links. It can be forced with
showExternalIcon
prop.Also fixed the styles of the secondary link.
In a secondary link, an anchor element had span for text and another for the link icon. Both the subelements were displayed as flex, which made them to fill the whole row and rendering the icon in another row compared to the text.