pineafan | f5dd187 | 2023-02-28 17:33:16 +0000 | [diff] [blame] | 1 | import React from 'react'; |
| 2 | |
| 3 | function Testing(props) { |
| 4 | return <> |
| 5 | <div style={{ |
| 6 | width: "100vw", |
| 7 | height: "40px", |
| 8 | backgroundColor: "#F27878", |
| 9 | display: "flex", |
| 10 | justifyContent: "left", |
| 11 | alignItems: "center", |
| 12 | paddingLeft: "25px", |
| 13 | color: "white", |
| 14 | fontSize: "1.5em", |
| 15 | }}>Nucleus Transcripts</div> |
| 16 | <div style={{ |
| 17 | height: "100vw", |
| 18 | width: "100vw", |
| 19 | backgroundColor: "var(--theme-ui-colors-background)", |
| 20 | margintop: "-50px", |
| 21 | padding: "25px", |
| 22 | paddingTop: "10px", |
| 23 | transition: "all 0.3s ease-in-out" |
| 24 | }}> |
TheCodedProf | c86e44b | 2023-02-28 17:30:57 -0500 | [diff] [blame] | 25 | { |
| 26 | props.humanReadable.split("\n").map((s, i) => { |
| 27 | return <p key={i}>{s}</p> |
| 28 | }) |
| 29 | } |
pineafan | f5dd187 | 2023-02-28 17:33:16 +0000 | [diff] [blame] | 30 | </div> |
| 31 | </> |
| 32 | } |
| 33 | |
| 34 | export default Testing; |
| 35 | export async function getServerSideProps(ctx) { |
| 36 | if(!ctx.query.code) { |
| 37 | return { |
| 38 | redirect: { |
| 39 | destination: '/nucleus/transcript/about', |
| 40 | permanent: true |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | if (ctx.query.code === "test") { |
| 45 | return { |
| 46 | props: { |
TheCodedProf | c86e44b | 2023-02-28 17:30:57 -0500 | [diff] [blame] | 47 | humanReadable: "This is a test string! It should render correctly on the page\nAnd a newline!" |
pineafan | f5dd187 | 2023-02-28 17:33:16 +0000 | [diff] [blame] | 48 | } |
| 49 | } |
| 50 | } else { |
| 51 | return { |
| 52 | redirect: { |
| 53 | destination: '/nucleus/transcript/invalid', |
| 54 | permanent: true |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | } |