Minor tweaks to appearance, clean up deps
This commit is contained in:
parent
b48b5716d3
commit
7076eadec4
5 changed files with 53 additions and 232 deletions
|
|
@ -3,31 +3,34 @@ import 'ace-builds/src-noconflict/theme-github';
|
|||
import React from 'react';
|
||||
import AceEditor from 'react-ace';
|
||||
import { Container } from 'react-bootstrap';
|
||||
import { CSSTransition } from 'react-transition-group';
|
||||
import Syntax from './paste/Syntax.json';
|
||||
|
||||
const reverseSearch = (syntax) => Object.keys(Syntax).filter((x) => Syntax[x] === syntax);
|
||||
|
||||
export default ({ paste, syntax }) => (
|
||||
<div className="v-center">
|
||||
<h4 className="text-center">{`Viewing ${reverseSearch(syntax)} File`}</h4>
|
||||
<Container className="shadow paste-view p-0">
|
||||
<AceEditor
|
||||
mode={`${syntax}`}
|
||||
theme="github"
|
||||
name="paste_viewer"
|
||||
fontSize={18}
|
||||
value={paste}
|
||||
wrapEnabled
|
||||
readOnly
|
||||
setOptions={{
|
||||
wrapBehavioursEnabled: true,
|
||||
wrap: true,
|
||||
}}
|
||||
tabSize="4"
|
||||
width="100%"
|
||||
height="100%"
|
||||
className="rounded"
|
||||
/>
|
||||
</Container>
|
||||
</div>
|
||||
<CSSTransition classNames="react-router" appear in timeout={300}>
|
||||
<div className="v-center">
|
||||
<h4 className="text-center">{`Viewing ${reverseSearch(syntax)} File`}</h4>
|
||||
<Container className="shadow paste-view p-0 rouned">
|
||||
<AceEditor
|
||||
mode={`${syntax}`}
|
||||
theme="github"
|
||||
name="paste_viewer"
|
||||
fontSize={18}
|
||||
value={paste}
|
||||
wrapEnabled
|
||||
readOnly
|
||||
setOptions={{
|
||||
wrapBehavioursEnabled: true,
|
||||
wrap: true,
|
||||
}}
|
||||
tabSize="4"
|
||||
width="100%"
|
||||
height="100%"
|
||||
className="rounded"
|
||||
/>
|
||||
</Container>
|
||||
</div>
|
||||
</CSSTransition>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue