add(coral-admin): Syntax highlighting on links

This commit is contained in:
Dan Zajdband
2016-11-18 10:46:09 -05:00
parent d9f1c05216
commit 1134e3bc09
2 changed files with 28 additions and 9 deletions
+11 -1
View File
@@ -5,6 +5,7 @@ import timeago from 'timeago.js';
import styles from './CommentList.css';
import I18n from 'coral-framework/modules/i18n/i18n';
import translations from '../translations.json';
import Linkify from 'react-linkify';
// Render a single comment for the list
export default props => (
@@ -27,7 +28,11 @@ export default props => (
</div>
</div>
<div className={styles.itemBody}>
<span className={styles.body}>{props.comment.get('body')}</span>
<span className={styles.body}>
<Linkify component='span' properties={{style: linkStyles}}>
{props.comment.get('body')}
</Linkify>
</span>
</div>
</li>
);
@@ -43,4 +48,9 @@ const canShowAction = (action, comment) => {
return true;
};
const linkStyles = {
backgroundColor: 'rgb(255, 219, 135)',
padding: '1px 2px'
};
const lang = new I18n(translations);
+17 -8
View File
@@ -16,8 +16,13 @@
"config": {
"pre-git": {
"commit-msg": [],
"pre-commit": ["npm run lint", "npm test"],
"pre-push": ["npm test"],
"pre-commit": [
"npm run lint",
"npm test"
],
"pre-push": [
"npm test"
],
"post-commit": [],
"post-merge": []
}
@@ -26,7 +31,12 @@
"type": "git",
"url": "git+https://github.com/coralproject/talk.git"
},
"keywords": ["talk", "coral", "coralproject", "ask"],
"keywords": [
"talk",
"coral",
"coralproject",
"ask"
],
"author": "",
"license": "Apache-2.0",
"bugs": {
@@ -44,18 +54,17 @@
"express": "^4.14.0",
"express-session": "^1.14.2",
"helmet": "^3.1.0",
"jsonwebtoken": "^7.1.9",
"lodash": "^4.16.6",
"lodash.debounce": "^4.0.8",
"mongoose": "^4.6.5",
"morgan": "^1.7.0",
"nodemailer": "^2.6.4",
"passport": "^0.3.2",
"passport-facebook": "^2.1.1",
"passport-local": "^1.0.0",
"jsonwebtoken": "^7.1.9",
"lodash": "^4.16.6",
"mongoose": "^4.6.5",
"morgan": "^1.7.0",
"nodemailer": "^2.6.4",
"prompt": "^1.0.0",
"react-linkify": "^0.1.3",
"redis": "^2.6.3",
"uuid": "^2.0.3"
},