Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import projectData from 'fragments/projectData'; // eslint-disable-line
import { WithLoading, WithToast, Project, CommentFeed } from 'components';
import Box from 'grommet-udacity/components/Box';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import * as ProjectActionCreators from './actions';
let RichTextEditor;
if (typeof window !== 'undefined') {
RichTextEditor = require('react-rte').default; // eslint-disable-line
}
class ProjectContainer extends Component {
constructor() {
super();
this.handleSubmit = this.handleSubmit.bind(this);
this.handleUpvote = this.handleUpvote.bind(this);
this.checkAuthToken = this.checkAuthToken.bind(this);
this.handleResettingComment = this.handleResettingComment.bind(this);
}
componentDidMount() {
this.handleResettingComment();
}
handleResettingComment() {
if (RichTextEditor) {
this.props.actions.projectEditComment(RichTextEditor.createEmptyValue());
import { bindActionCreators } from 'redux';
import cssModules from 'react-css-modules';
import Box from 'grommet-udacity/components/Box';
import Section from 'grommet-udacity/components/Section';
import Headline from 'grommet-udacity/components/Headline';
import Paragraph from 'grommet-udacity/components/Paragraph';
import Markdown from 'grommet-udacity/components/Markdown';
import { compose, lifecycle, withHandlers } from 'recompose';
import { Divider, WithLoading, CommentFeed, WithToast } from 'components';
import withData from './gql';
import * as TutorialActionCreators from './actions';
import styles from './index.module.scss';
let RichTextEditor;
if (typeof window !== 'undefined') {
RichTextEditor = require('react-rte').default; // eslint-disable-line
}
const TutorialContainer = ({
isLoading,
tutorial,
commentInput,
actions,
commentError,
message,
user,
handleSubmit,
handleUpvote,
}) => (
import Section from 'grommet-udacity/components/Section';
import Article from 'grommet-udacity/components/Article';
import Button from 'grommet-udacity/components/Button';
import Footer from 'grommet-udacity/components/Footer';
import Columns from 'grommet-udacity/components/Columns';
import Heading from 'grommet-udacity/components/Heading';
import List from 'grommet-udacity/components/List';
import ListItem from 'grommet-udacity/components/ListItem';
import Label from 'grommet-udacity/components/Label';
import { Comment, Divider } from 'components';
import Status from 'grommet-udacity/components/icons/Status';
import { Link } from 'react-router';
let RichTextEditor;
if (typeof window !== 'undefined') {
RichTextEditor = require('react-rte').default; // eslint-disable-line
}
const CommentFeed = ({
value,
onChange,
onSubmit,
comments,
onUpvote,
user,
}) => (
<section align="center">
{RichTextEditor != null && // eslint-disable-line
<article>
Comments</article></section>
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import cssModules from 'react-css-modules';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import Box from 'grommet-udacity/components/Box';
import { WithLoading, Post, CommentFeed, WithToast } from 'components';
import postFragment from './fragments';
import * as PostActionCreators from './actions';
import styles from './index.module.scss';
let RichTextEditor;
if (typeof window !== 'undefined') {
RichTextEditor = require('react-rte').default; // eslint-disable-line
}
class PostContainer extends Component { // eslint-disable-line react/prefer-stateless-function
constructor(props) {
super(props);
this.handleSubmit = this.handleSubmit.bind(this);
this.handleUpvote = this.handleUpvote.bind(this);
this.checkAuthToken = this.checkAuthToken.bind(this);
this.handleResettingComment = this.handleResettingComment.bind(this);
}
componentDidMount() {
this.handleResettingComment();
}
handleResettingComment() {
if (RichTextEditor) {
this.props.actions.postEditComment(RichTextEditor.createEmptyValue());