aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components
diff options
context:
space:
mode:
authorJacky Zhao <[email protected]>2020-09-17 00:31:18 -0700
committerGitHub <[email protected]>2020-09-17 00:31:18 -0700
commitc7edce043511660117dfd17f2c32d21cb3dd5889 (patch)
tree50bac163e56558325422f2b0342804a10d59a9a2 /frontend/src/components
parentMerge pull request #58 from jackyzha0/patch (diff)
parentset default for md and latex to renderer, add title and description setting i... (diff)
downloadctrl-v-c7edce043511660117dfd17f2c32d21cb3dd5889.tar.xz
ctrl-v-c7edce043511660117dfd17f2c32d21cb3dd5889.zip
Merge pull request #59 from jackyzha0/patch-qol
QOL Improvements
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/ViewPaste.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/frontend/src/components/ViewPaste.js b/frontend/src/components/ViewPaste.js
index 179321b..b2e1ba5 100644
--- a/frontend/src/components/ViewPaste.js
+++ b/frontend/src/components/ViewPaste.js
@@ -7,6 +7,7 @@ import PasswordModal from './modals/PasswordModal'
import { FetchPaste, FetchPasswordPaste } from '../helpers/httpHelper'
import { LANGS } from './renderers/Code'
import RenderDispatch from './renderers/RenderDispatch'
+import MetaTags from 'react-meta-tags';
function fmtDateStr(dateString) {
const d = new Date(dateString)
@@ -22,7 +23,7 @@ const ViewPaste = (props) => {
const [validPass, setValidPass] = useState(false);
const [expiry, setExpiry] = useState('');
const [theme, setTheme] = useState('atom');
- const [isRenderMode, setIsRenderMode] = useState(false);
+ const [isRenderMode, setIsRenderMode] = useState(true);
const [language, setLanguage] = useState(LANGS.raw);
const ErrorLabelRef = useRef(null);
@@ -54,6 +55,7 @@ const ViewPaste = (props) => {
}
function setStateFromData(data) {
+ document.title = data.title
setTitle(data.title)
setContent(data.content)
setLanguage(data.language)
@@ -114,6 +116,10 @@ const ViewPaste = (props) => {
return (
<div>
+ <MetaTags>
+ <meta name="description" content={`${language}, expires ${expiry}. hosted on ctrl-v`} />
+ <meta property="og:title" content={title} />
+ </MetaTags>
<PasswordModal
hasPass={hasPass}
validPass={validPass}