From 0568ee72bd05ed16cf5250a444d936821c42b524 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Mon, 25 May 2020 23:05:04 -0700 Subject: various fixes --- frontend/src/components/Err.js | 3 +-- frontend/src/components/Footer.js | 2 +- frontend/src/components/NewPaste.js | 3 ++- frontend/src/components/PasteInfo.js | 5 ++--- frontend/src/components/ViewPaste.js | 4 ++-- frontend/src/components/modals/PasswordModal.js | 3 ++- frontend/src/components/modals/shared.js | 5 +++++ 7 files changed, 15 insertions(+), 10 deletions(-) (limited to 'frontend/src/components') diff --git a/frontend/src/components/Err.js b/frontend/src/components/Err.js index dc78398..c87f6a8 100644 --- a/frontend/src/components/Err.js +++ b/frontend/src/components/Err.js @@ -4,7 +4,6 @@ import styled, { css } from 'styled-components' const ErrMsg = styled.p` display: inline; font-weight: 700; - margin-left: 2em; color: #ff3333; opacity: 0; transition: opacity 0.3s cubic-bezier(.25,.8,.25,1); @@ -23,7 +22,7 @@ class Error extends React.Component { this.state = { active: false, - msg: '', + msg: ' ', }; this.showMessage = this.showMessage.bind(this); diff --git a/frontend/src/components/Footer.js b/frontend/src/components/Footer.js index ecd85e1..c7878e5 100644 --- a/frontend/src/components/Footer.js +++ b/frontend/src/components/Footer.js @@ -2,7 +2,7 @@ import React from 'react'; import styled from 'styled-components' const SpacedFooter = styled.div` - margin: 1em 0; + margin: 2em 0; ` const Link = (props) => { diff --git a/frontend/src/components/NewPaste.js b/frontend/src/components/NewPaste.js index 8012b99..f17c8b4 100644 --- a/frontend/src/components/NewPaste.js +++ b/frontend/src/components/NewPaste.js @@ -91,7 +91,7 @@ class NewPaste extends React.Component { // some weird err if (resp !== undefined) { - const errTxt = `${resp.statusText}: ${resp.data}` + const errTxt = `${resp.status}: ${resp.data}` this.ErrorLabel.current.showMessage(errTxt) } else { // some weird err (e.g. network) @@ -165,6 +165,7 @@ class NewPaste extends React.Component { onClick={this.togglePreview} > preview +
); diff --git a/frontend/src/components/PasteInfo.js b/frontend/src/components/PasteInfo.js index 0b4188d..76d8859 100644 --- a/frontend/src/components/PasteInfo.js +++ b/frontend/src/components/PasteInfo.js @@ -79,10 +79,9 @@ const PasteInfo = (props) => { expires: {props.expiry} - - {props.err} - +
+ {props.err} ); } diff --git a/frontend/src/components/ViewPaste.js b/frontend/src/components/ViewPaste.js index 30fb29e..117bb18 100644 --- a/frontend/src/components/ViewPaste.js +++ b/frontend/src/components/ViewPaste.js @@ -70,7 +70,7 @@ class ViewPaste extends React.Component { // otherwise, just log it lmao if (resp !== undefined) { - const errTxt = `${resp.statusText}: ${resp.data}` + const errTxt = `${resp.status}: ${resp.data}` this.ErrorLabel.current.showMessage(errTxt) } else { // some weird err (e.g. network) @@ -166,7 +166,7 @@ class ViewPaste extends React.Component { // some weird err if (resp !== undefined) { - const errTxt = `${resp.statusText}: ${resp.data}` + const errTxt = `${resp.status}: ${resp.data}` this.ErrorLabel.current.showMessage(errTxt, -1) return } diff --git a/frontend/src/components/modals/PasswordModal.js b/frontend/src/components/modals/PasswordModal.js index 619e60a..527fc54 100644 --- a/frontend/src/components/modals/PasswordModal.js +++ b/frontend/src/components/modals/PasswordModal.js @@ -1,7 +1,7 @@ import React from 'react'; import Modal from 'react-modal'; import { PassInput } from '../Inputs' -import { RightPad, LeftPad, ModalHeader } from './shared' +import { RightPad, LeftPad, ModalHeader, Padding } from './shared' import Error from '../Err'; const modalStyles = { @@ -51,6 +51,7 @@ class PasswordModal extends React.Component { + diff --git a/frontend/src/components/modals/shared.js b/frontend/src/components/modals/shared.js index 9359436..d63be06 100644 --- a/frontend/src/components/modals/shared.js +++ b/frontend/src/components/modals/shared.js @@ -11,3 +11,8 @@ export const LeftPad = styled.div` export const ModalHeader = styled.h3` font-weight: 700 ` + +export const Padding = styled.span` + content: ' '; + margin-right: 2em; +` \ No newline at end of file -- cgit v1.2.3 From 236c38871913d6c2a1a06cfc45bd2ef6e7ab9af1 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Tue, 26 May 2020 00:09:07 -0700 Subject: fix coderenderer not loading all langs --- frontend/src/components/renderers/Code.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'frontend/src/components') diff --git a/frontend/src/components/renderers/Code.js b/frontend/src/components/renderers/Code.js index 524ea30..3dbd544 100644 --- a/frontend/src/components/renderers/Code.js +++ b/frontend/src/components/renderers/Code.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'; +import SyntaxHighlighter from 'react-syntax-highlighter'; import { atomOneLight, ascetic, atomOneDark, dracula, ocean } from 'react-syntax-highlighter/dist/esm/styles/hljs'; import styled from 'styled-components' @@ -23,6 +23,7 @@ export const LANGS = Object.freeze({ 'html': 'html', 'java': 'java', 'js': 'javascript', + 'jsx': 'jsx', 'latex': 'latex', 'lisp': 'lisp', 'makefile': 'makefile', @@ -64,7 +65,7 @@ const CodeRenderer = React.forwardRef((props, ref) => {
-- cgit v1.2.3