Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown summary #794

Merged
merged 8 commits into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 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 LinkNewTab from 'universal/components/LinkNewTab/LinkNewTab';

const Card = (props) => {
const {content, status} = props;
Expand Down Expand Up @@ -53,6 +55,9 @@ const Card = (props) => {
};
}

const markdownCustomComponents = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this outside the component since it'll never change & then we can reuse that same object for all the cards.

Link: LinkNewTab
};
return (
<table style={ui.emailTableBase} width="100%">
<tbody>
Expand All @@ -66,7 +71,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
3 changes: 2 additions & 1 deletion src/universal/modules/newTeam/components/NewTeam/NewTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {DragDropContext as dragDropContext} from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';

const NewTeam = (props) => {
console.log(props);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's nuke this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ndey96 any update on this?

const {dispatch, params: {newOrg}} = props;
return (
<DashboardWrapper title="User Dashboard">
Expand All @@ -19,7 +20,7 @@ const NewTeam = (props) => {
NewTeam.propTypes = {
dispatch: PropTypes.func.isRequired,
params: PropTypes.shape({
newOrg: PropTypes.object
newOrg: PropTypes.string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

})
};

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