From d58c7a3ad5dc83a08e040a855f158f8c6c09e154 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Sun, 11 Apr 2021 13:50:20 -0700 Subject: password resolution, dynamic head --- frontend/src/pages/raw/[hash].js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'frontend/src/pages/raw') diff --git a/frontend/src/pages/raw/[hash].js b/frontend/src/pages/raw/[hash].js index a100b4b..3374eea 100644 --- a/frontend/src/pages/raw/[hash].js +++ b/frontend/src/pages/raw/[hash].js @@ -2,6 +2,7 @@ import React from 'react'; import resolvePaste from "../../http/resolvePaste"; import {CodeLike} from "../../components/Common/mixins"; import styled from 'styled-components' +import NextHead from "../../components/NextHead"; const RawText = styled.pre` ${CodeLike} @@ -10,15 +11,17 @@ const RawText = styled.pre` export async function getServerSideProps(ctx) { const data = await resolvePaste(ctx.params.hash) - - // Pass data to the page via props + console.log(data) return { props: { ...data } } } const Raw = ({error, data}) => { - return - {data?.content || error} - + return <> + {!error && } + + {data?.content || error} + + } export default Raw \ No newline at end of file -- cgit v1.2.3