diff --git a/front/.eslintrc.json b/front/.eslintrc.json index 9d616e9..56e4146 100644 --- a/front/.eslintrc.json +++ b/front/.eslintrc.json @@ -26,6 +26,7 @@ "no-multiple-empty-lines": "error", "no-unused-vars": ["error", { "argsIgnorePattern": "_" }], "object-curly-spacing": ["error", "always"], + "react/jsx-curly-spacing": ["error", { "when": "always" }], "react/prop-types": "off", "sort-imports": ["error", { "ignoreCase": true }], "sort-keys": "error", diff --git a/front/src/Component/App.js b/front/src/Component/App.js index 0892dd4..e36466e 100644 --- a/front/src/Component/App.js +++ b/front/src/Component/App.js @@ -11,7 +11,7 @@ import TextEditor from './Container/TextEditor/TextEditor' const App = ({ store, }) => - +
diff --git a/front/src/Component/Container/Tweet/Tweet.js b/front/src/Component/Container/Tweet/Tweet.js index 9737e31..1ab20f6 100644 --- a/front/src/Component/Container/Tweet/Tweet.js +++ b/front/src/Component/Container/Tweet/Tweet.js @@ -33,7 +33,7 @@ const didMount = ({ const View = ({ uid, }) => -
+
// lifecycles :: React.Component -> React.Component const lifecycles = compose( diff --git a/front/src/Component/View/BrightcovePlayer/BrightcoveVideo.js b/front/src/Component/View/BrightcovePlayer/BrightcoveVideo.js index 8f09f57..81f4c68 100644 --- a/front/src/Component/View/BrightcovePlayer/BrightcoveVideo.js +++ b/front/src/Component/View/BrightcovePlayer/BrightcoveVideo.js @@ -20,30 +20,30 @@ const BrightcoveVideo = ({ */
- {editable && + { editable &&

p

} - {isReady && + { isReady && } - {!isNil(name) && -
{name}
+ { !isNil(name) && +
{ name }
}
diff --git a/front/src/Component/View/List/NoResult.js b/front/src/Component/View/List/NoResult.js index 11f2e0a..c6ff578 100644 --- a/front/src/Component/View/List/NoResult.js +++ b/front/src/Component/View/List/NoResult.js @@ -6,20 +6,20 @@ import React from 'react' // NoResult :: Props -> React.Component const NoResult = ({ - resource, + children, collection, isLoading, - children, + resource, }) => - {(!isLoading && isEmpty(collection)) && + { (!isLoading && isEmpty(collection)) &&
- There is no {resource} matching your search criterias. + There is no { resource } matching your search criterias.
} - {!isEmpty(collection) && children} + { !isEmpty(collection) && children }
export default NoResult; diff --git a/front/src/Component/View/MediaPicker/ImagePicker.js b/front/src/Component/View/MediaPicker/ImagePicker.js index b5dfb60..37ab0af 100644 --- a/front/src/Component/View/MediaPicker/ImagePicker.js +++ b/front/src/Component/View/MediaPicker/ImagePicker.js @@ -19,28 +19,28 @@ const ImagePicker = ({
{/* scroll left */}

1 ? 'show' : ''}`} + onClick={ scrollLeft } + className={ `btn-knp left is-pulled-left is-hidden-mobile ${ page > 1 ? 'show' : '' }` } > l

{/* scroll right */}

r

{/* search result container */}
- +
- {renderImages(images.slice(0, 5), pickImage, domain, extra)} + { renderImages(images.slice(0, 5), pickImage, domain, extra) }
- {renderImages(images.slice(5, 10), pickImage, domain, extra)} + { renderImages(images.slice(5, 10), pickImage, domain, extra) }
@@ -49,11 +49,11 @@ const ImagePicker = ({ // renderImages :: ([Image], Function, String, Object) -> React.Component const renderImages = (images, pickImage, domain, extra) => images.map(image => -
+
pickImage(image.id, domain, extra)} - src={image.href} - alt={image.legend} + onClick={ () => pickImage(image.id, domain, extra) } + src={ image.href } + alt={ image.legend } />
, ) diff --git a/front/src/Component/View/MediaPicker/MediaPicker.js b/front/src/Component/View/MediaPicker/MediaPicker.js index 76e1cec..b710769 100644 --- a/front/src/Component/View/MediaPicker/MediaPicker.js +++ b/front/src/Component/View/MediaPicker/MediaPicker.js @@ -5,31 +5,31 @@ import VideoPicker from '../../Container/MediaPicker/VideoPicker' // MediaPicker :: Props -> React.Component const MediaPicker = ({ - isOpened, close, isFetchingImages, isFetchingVideos, isImagePickerOpened, + isOpened, isVideoPickerOpened, + openImagePicker, searchImages, searchVideos, - openImagePicker, }) => -
+
-
e.preventDefault()}> + e.preventDefault() }> { isImagePickerOpened &&
-
- +
+ s
} { isVideoPickerOpened &&
-
- +
+ s
@@ -37,8 +37,8 @@ const MediaPicker = ({
  • isImagePickerOpened ? e.preventDefault() : openImagePicker()} + className={ `image-mode btn-knp ${isImagePickerOpened ? 'active' : '' }` } + onClick={ e => isImagePickerOpened ? e.preventDefault() : openImagePicker() } >c

  • {/* @TODO fix this features before re-enabling @@ -54,10 +54,10 @@ const MediaPicker = ({
{ isImagePickerOpened && } - { isVideoPickerOpened && } + { isVideoPickerOpened && }

- e + e

diff --git a/front/src/Component/View/MediaPicker/VideoPicker.js b/front/src/Component/View/MediaPicker/VideoPicker.js index 7885660..806ddb3 100644 --- a/front/src/Component/View/MediaPicker/VideoPicker.js +++ b/front/src/Component/View/MediaPicker/VideoPicker.js @@ -14,22 +14,22 @@ import React from 'react' // VideoPicker :: Props -> React.Component const VideoPicker = ({ - videos, + page, scrollLeft, scrollRight, - page, + videos, ...restProps }) =>
{/* scroll left */}

1 ? 'show' : ''}`} + onClick={ scrollLeft } + className={ `btn-knp left is-pulled-left icomoon-font ${ page > 1 ? 'show' : '' }` } >l

{/* scroll right */}

r

{/* search result container */} @@ -42,10 +42,10 @@ const VideoPicker = ({
:
- {compose(renderVideos(restProps), nth(0), splitMedias)(videos)} + { compose(renderVideos(restProps), nth(0), splitMedias)(videos) }
- {compose(renderVideos(restProps), nth(1), splitMedias)(videos)} + { compose(renderVideos(restProps), nth(1), splitMedias)(videos) }
} @@ -54,12 +54,12 @@ const VideoPicker = ({ // renderVideos :: Props -> [Video] -> React.Component const renderVideos = props => map(video => -
+
props.pickVideo(video.id, props.domain, props.extra)} - src={video.poster} - alt={video.name} + title={ video.name } + onClick={ () => props.pickVideo(video.id, props.domain, props.extra) } + src={ video.poster } + alt={ video.name } />
, ) diff --git a/front/src/Component/View/TextEditor/InsertTweet.js b/front/src/Component/View/TextEditor/InsertTweet.js index dc4e1a8..5012341 100644 --- a/front/src/Component/View/TextEditor/InsertTweet.js +++ b/front/src/Component/View/TextEditor/InsertTweet.js @@ -5,14 +5,14 @@ const InsertTweet = ({ fetching = false, submit, }) => - -
+ +
diff --git a/front/src/Component/View/TextEditor/InsertYoutubeVideo.js b/front/src/Component/View/TextEditor/InsertYoutubeVideo.js index 1609506..8cc8ae9 100644 --- a/front/src/Component/View/TextEditor/InsertYoutubeVideo.js +++ b/front/src/Component/View/TextEditor/InsertYoutubeVideo.js @@ -4,14 +4,14 @@ import React from 'react' const InsertYoutubeVideo = ({ submit, }) => -
+
diff --git a/front/src/Component/View/TextEditor/ParagraphToolbox.js b/front/src/Component/View/TextEditor/ParagraphToolbox.js index bdaeb42..b1f4dc0 100644 --- a/front/src/Component/View/TextEditor/ParagraphToolbox.js +++ b/front/src/Component/View/TextEditor/ParagraphToolbox.js @@ -6,26 +6,26 @@ import React from 'react' // ParagraphToolbox :: Props -> React.Component const ParagraphToolbox = ({ closeInsertTweet, + closeInsertYoutubeVideo, editorName, insertTweetOpened = false, + insertYoutubeVideoOpened = false, isVisible = false, + mediaPickerOpened, openInsertTweet, + openInsertYoutubeVideo, openMediaPicker, top = 0, - insertYoutubeVideoOpened = false, - openInsertYoutubeVideo, - closeInsertYoutubeVideo, - mediaPickerOpened, }) => export default ParagraphToolbox; diff --git a/front/src/Component/View/TextEditor/TextEditor.js b/front/src/Component/View/TextEditor/TextEditor.js index 05f2cd3..76b30e6 100644 --- a/front/src/Component/View/TextEditor/TextEditor.js +++ b/front/src/Component/View/TextEditor/TextEditor.js @@ -5,27 +5,27 @@ import TextToolbox from '../../Container/TextEditor/TextToolbox' // TextEditor :: Props -> React.Component const TextEditor = ({ + children, click, editorName, keyDown, paste, selectText, - children, }) =>
- - + +
click(editorName, e.target)} - onKeyDown={keyDown} - onPaste={paste} - onSelect={() => selectText(editorName)} + contentEditable={ true } + suppressContentEditableWarning={ true } + onClick={ e => click(editorName, e.target) } + onKeyDown={ keyDown } + onPaste={ paste } + onSelect={ () => selectText(editorName) } > - {children} + { children }
diff --git a/front/src/Component/View/TextEditor/TextToolbox.js b/front/src/Component/View/TextEditor/TextToolbox.js index 2a8bb34..a27c103 100644 --- a/front/src/Component/View/TextEditor/TextToolbox.js +++ b/front/src/Component/View/TextEditor/TextToolbox.js @@ -9,77 +9,77 @@ const TextToolbox = ({ closeLinkCreator, handleLinkButton, handleLinkForm, + isBold, + isItalic, + isLink, isLinkCreatorOpened, + isQuote, + isTitle, + isUnderline, isVisible, mutate, top, - isBold, - isItalic, - isUnderline, - isTitle, - isQuote, - isLink, }) =>