noticed that a Sourcelink component has been declared, but in most places, an anchor tag is still been used instead of the source link component... not following React component architecture.
//current code with class component
import React, {Component} from 'react' class SourceLink extends Component { render() { return ( <a target="_blank" rel="noopener noreferrer" href={this.props.href} className="smallsuper"> <i className="fas fa-external-link-alt"></i> </a> ) } } export default SourceLink
//Improvement with functional component
import React from 'react' const SourceLink = ({ href, className, linkName, onClick, role, icon }) => { return ( <a target="_blank" rel="noopener noreferrer" href={href} className={className} onClick={onClick} role={role} > {icon && <i className="fas fa-external-link-alt" />} {linkName} </a> )
}
export default SourceLink
solved in #55
Fixed in b743bed
Metadata Update from @lbrabec: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.