Skip to content

Commit

Permalink
Markdown summary (#794)
Browse files Browse the repository at this point in the history
* Add markdown in meeting summary

* Fix prop type errors

* Move markdownCustomComponents to utils

fix #728
  • Loading branch information
ndey96 authored and mattkrick committed Mar 22, 2017
1 parent 509913c commit c00f56f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/universal/modules/email/components/Card/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import labels from 'universal/styles/theme/labels';
import ui from 'universal/styles/ui';
import {trimString} from 'universal/utils';
import EmptySpace from '../EmptySpace/EmptySpace';
import ReactMarkdown from 'react-markdown';
import markdownCustomComponents from 'universal/utils/markdownCustomComponents';

const Card = (props) => {
const {content, status} = props;
Expand Down Expand Up @@ -66,7 +68,12 @@ const Card = (props) => {
<tr>
<td style={cellStyle}>
<div style={contentStyle}>
{trimString(content, 52)}
<ReactMarkdown
renderers={markdownCustomComponents}
source={trimString(content, 52)}
escapeHtml
softBreak="br"
/>
</div>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const NewTeam = (props) => {
NewTeam.propTypes = {
dispatch: PropTypes.func.isRequired,
params: PropTypes.shape({
newOrg: PropTypes.object
newOrg: PropTypes.string
})
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class NewTeamFormContainer extends Component {

NewTeamFormContainer.propTypes = {
dispatch: PropTypes.func.isRequired,
initialOrgCount: PropTypes.func.number,
initialOrgCount: PropTypes.number,
initialValues: PropTypes.object,
isNewOrg: PropTypes.bool,
organizations: PropTypes.array,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import appTheme from 'universal/styles/theme/appTheme';
import ui from 'universal/styles/ui';
import Textarea from 'react-textarea-autosize';
import ReactMarkdown from 'react-markdown';
import LinkNewTab from 'universal/components/LinkNewTab/LinkNewTab';
import markdownCustomComponents from 'universal/utils/markdownCustomComponents';


class OutcomeCardTextArea extends Component {
static propTypes = {
Expand Down Expand Up @@ -123,9 +124,6 @@ class OutcomeCardTextArea extends Component {
!isProject && cardHasHover && styles.actionContentWhenCardHovered,
!isProject && styles.descriptionAction
);
const markdownCustomComponents = {
Link: LinkNewTab
};
return (
<div
onClick={!isArchived && this.setEditing}
Expand Down
5 changes: 5 additions & 0 deletions src/universal/utils/markdownCustomComponents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import LinkNewTab from 'universal/components/LinkNewTab/LinkNewTab';

export default {
Link: LinkNewTab
};

0 comments on commit c00f56f

Please sign in to comment.