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
fix: Outgoing add-on links (fix #1859) #1877
Conversation
src/amo/components/AddonMoreInfo.js
Outdated
ref={(ref) => { this.homepageLink = ref; }}> | ||
{homepage.replace(/^https?:\/\//, '')} | ||
</a> | ||
{addon.homepage ? <dt>{i18n.gettext('Add-on Links')}</dt> : null} |
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.
The dt will only be shown when addon.homepage is available. Presumably it should now be on the basis of either a homepage link or support url?
Okay, updated with screenshots and better tests/code. All set for r? |
I wonder - if a url was missing a sane protocol should we just bin it and not display it at all? |
ref={(ref) => { this.homepageLink = ref; }}> | ||
{homepage.replace(/^https?:\/\//, '')} | ||
</a> | ||
{homepage || supportUrl ? ( |
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 might be cleaner to move these bits into separate snippets using if statements to avoid so much ternary in the JSX?
r+wc |
There's no harm in doing it this way and we have to check either way... so might as well make the best of bad data. I suppose I could log the data, but realistically I think this is better UX than not showing it because our data went off somewhere. |
8e05dbe
to
cf1927f
Compare
cf1927f
to
35c4e4c
Compare
fix #1859
Before
After