Skip to content

Commit

Permalink
clickable 'link out' icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Krautwurst committed Oct 28, 2019
1 parent 4e708b5 commit 14af634
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/SchemaFields/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ const ExternalLink = (props) => {
const { idSchema: { id }, schema: { title: label }, formData:value } = props;

return <div>
<label htmlFor={id}>{label} <ExternalLinkIcon /></label>
<label className={styles.linkLabel} htmlFor={id}>{label}
<a target='_blank' rel='noopener noreferrer' href={value}>
<ExternalLinkIcon />
</a>
</label>
<a target='_blank' rel='noopener noreferrer' href={value}>{value}</a>
</div>;
};
Expand Down
9 changes: 9 additions & 0 deletions src/SchemaFields/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@
[class*=react-datetime-picker__wrapper] {
width: 100%;
}
}

.linkLabel {
align-items: flex-end;
display: flex;
margin-bottom: 0.25rem;
a {
margin-left: 0.25rem;
}
}

0 comments on commit 14af634

Please sign in to comment.