@bento-core/about 1.0.1-CDS.7 → 1.0.1-CDS.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,11 +68,13 @@ const AboutBody = _ref => {
68
68
  }, contentObj.paragraph.split('$$').map(splitedParagraph => {
69
69
  // Checking for regex ()[] pattern
70
70
  if (splitedParagraph != null && (/\[(.+)\]\((.+)\)/g.test(splitedParagraph) || /\((.+)\)\[(.+)\]/g.test(splitedParagraph))) {
71
- const title = splitedParagraph.match(/\[(.*)\]/).pop();
71
+ const defaultTitle = splitedParagraph.match(/\[(.*)\]/).pop();
72
72
  const linkAttrs = splitedParagraph.match(/\((.*)\)/).pop().split(' ');
73
+ const titleMatch = splitedParagraph.match(/title:\s*'([^']+)'/);
74
+ const title = titleMatch ? titleMatch[1].trim() : defaultTitle;
73
75
  const target = linkAttrs.find(link => link.includes('target:'));
74
76
  const url = linkAttrs.find(link => link.includes('url:'));
75
- const href = splitedParagraph.match(/\((.*)\)/).pop();
77
+ const href = linkAttrs[0];
76
78
  const link = /*#__PURE__*/_react.default.createElement(_core.Link, {
77
79
  title: title,
78
80
  target: target ? target.replace('target:', '') : '_blank',
@@ -80,7 +82,7 @@ const AboutBody = _ref => {
80
82
  href: url ? url.replace('url:', '') : href && href.includes('@') ? "mailto:".concat(href) : href,
81
83
  color: "inherit",
82
84
  className: classes.link
83
- }, title);
85
+ }, defaultTitle);
84
86
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, href.includes('@') || !href.includes('http') ? '' : /*#__PURE__*/_react.default.createElement("img", {
85
87
  src: externalIconImage
86
88
  // externalIconImage: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/common/images/logos/svgs/externalLinkIcon.svg',
@@ -24,7 +24,7 @@ const AboutHeader = _ref => {
24
24
  }, /*#__PURE__*/_react.default.createElement("div", {
25
25
  id: "about_title",
26
26
  className: classes.titleBody
27
- }, /*#__PURE__*/_react.default.createElement("span", {
27
+ }, /*#__PURE__*/_react.default.createElement("h1", {
28
28
  className: classes.titleText
29
29
  }, title))), /*#__PURE__*/_react.default.createElement("div", {
30
30
  className: classes.whitePadding
@@ -50,7 +50,8 @@ const styles = () => ({
50
50
  color: props.titleColor,
51
51
  fontFamily: 'Lato',
52
52
  fontSize: '35px',
53
- fontWeight: 'bold'
53
+ fontWeight: 'bold',
54
+ display: 'inline'
54
55
  })
55
56
  });
56
57
  AboutHeader.defaultProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/about",
3
- "version": "1.0.1-CDS.7",
3
+ "version": "1.0.1-CDS.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -13,7 +13,7 @@
13
13
  "access": "public"
14
14
  },
15
15
  "dependencies": {
16
- "@bento-core/facet-filter": "^1.0.1-CDS.4",
16
+ "@bento-core/facet-filter": "^1.0.1-CDS.5",
17
17
  "lodash": "^4.17.20",
18
18
  "react-zoom-pan-pinch": "*"
19
19
  },
@@ -27,5 +27,5 @@
27
27
  },
28
28
  "author": "CTOS Bento Team",
29
29
  "license": "ISC",
30
- "gitHead": "0e1d08cedda7906afc8b0d1c2c00255c80a1856a"
30
+ "gitHead": "61639923b9c77418e4b96267b0e4e430d0756b55"
31
31
  }
@@ -70,11 +70,13 @@ const AboutBody = ({
70
70
  { contentObj.paragraph.split('$$').map((splitedParagraph) => {
71
71
  // Checking for regex ()[] pattern
72
72
  if (splitedParagraph != null && ((/\[(.+)\]\((.+)\)/g.test(splitedParagraph)) || (/\((.+)\)\[(.+)\]/g.test(splitedParagraph)))) {
73
- const title = splitedParagraph.match(/\[(.*)\]/).pop();
73
+ const defaultTitle = splitedParagraph.match(/\[(.*)\]/).pop();
74
74
  const linkAttrs = splitedParagraph.match(/\((.*)\)/).pop().split(' ');
75
+ const titleMatch = splitedParagraph.match(/title:\s*'([^']+)'/);
76
+ const title = titleMatch ? titleMatch[1].trim() : defaultTitle;
75
77
  const target = linkAttrs.find((link) => link.includes('target:'));
76
78
  const url = linkAttrs.find((link) => link.includes('url:'));
77
- const href = splitedParagraph.match(/\((.*)\)/).pop();
79
+ const href = linkAttrs[0];
78
80
 
79
81
  const link = (
80
82
  <Link
@@ -85,7 +87,7 @@ const AboutBody = ({
85
87
  color="inherit"
86
88
  className={classes.link}
87
89
  >
88
- {title}
90
+ {defaultTitle}
89
91
  </Link>
90
92
  );
91
93
 
@@ -4,7 +4,7 @@ import { withStyles } from '@material-ui/core';
4
4
  const AboutHeader = ({ classes, title }) => (
5
5
  <div className={classes.container}>
6
6
  <div className={classes.header}>
7
- <div id="about_title" className={classes.titleBody}><span className={classes.titleText}>{title}</span></div>
7
+ <div id="about_title" className={classes.titleBody}><h1 className={classes.titleText}>{title}</h1></div>
8
8
  </div>
9
9
  <div className={classes.whitePadding} />
10
10
  </div>
@@ -33,6 +33,7 @@ const styles = () => ({
33
33
  fontFamily: 'Lato',
34
34
  fontSize: '35px',
35
35
  fontWeight: 'bold',
36
+ display: 'inline',
36
37
  }),
37
38
  });
38
39