diff --git a/newsfeed/babel.config.json b/newsfeed/babel.config.json index 4f014be9..51239243 100644 --- a/newsfeed/babel.config.json +++ b/newsfeed/babel.config.json @@ -1,4 +1,12 @@ { - "presets": ["@babel/preset-react", "@babel/preset-typescript"], + "presets": [ + [ + "@babel/preset-react", + { + "runtime": "automatic" + } + ], + "@babel/preset-typescript" + ], "plugins": ["relay"] } diff --git a/newsfeed/server/resolvers.mjs b/newsfeed/server/resolvers.mjs index b792248a..92cfe35b 100644 --- a/newsfeed/server/resolvers.mjs +++ b/newsfeed/server/resolvers.mjs @@ -142,7 +142,8 @@ const nodes = [ id: "99", category: "NEWS", title: "Study: The egg came first, but only after the chicken", - summary: 'In a shocking new study, scientists have finally determined the age-old question of whether the chicken or the egg came first. And it turns out, the answer is both!\n According to the research, the egg actually came first — but only after the chicken had already laid it.\n \n "We were amazed by the results," said lead researcher Dr. Janet Hennessy. "It seems that the chicken somehow managed to lay an egg before it even existed. It\'s a real chicken-and-egg paradox."\n \n The study, which involved observing hundreds of chickens on a farm, found that the birds would lay eggs and then, a short time later, a fully-formed chicken would emerge from the shell.\n \n "We always thought that the egg came first and the chicken was born from it," said Hennessy. "But it turns out, the chicken was there all along, just waiting to hatch."\n \n The findings have caused quite a stir in the scientific community, with many experts calling for further research to be done on the mysterious life cycle of the chicken.\n \n "It\'s a groundbreaking discovery that will change the way we think about the chicken and the egg," said Hennessy. "Who knows what other secrets these amazing creatures may be hiding?"', + summary: + 'In a shocking new study, scientists have finally determined the age-old question of whether the chicken or the egg came first. And it turns out, the answer is both!\n According to the research, the egg actually came first — but only after the chicken had already laid it.\n \n "We were amazed by the results," said lead researcher Dr. Janet Hennessy. "It seems that the chicken somehow managed to lay an egg before it even existed. It\'s a real chicken-and-egg paradox."\n \n The study, which involved observing hundreds of chickens on a farm, found that the birds would lay eggs and then, a short time later, a fully-formed chicken would emerge from the shell.\n \n "We always thought that the egg came first and the chicken was born from it," said Hennessy. "But it turns out, the chicken was there all along, just waiting to hatch."\n \n The findings have caused quite a stir in the scientific community, with many experts calling for further research to be done on the mysterious life cycle of the chicken.\n \n "It\'s a groundbreaking discovery that will change the way we think about the chicken and the egg," said Hennessy. "Who knows what other secrets these amazing creatures may be hiding?"', authorID: "30", createdAt: "2020-01-01T00:00:00.000Z", attachments: [ diff --git a/newsfeed/src/components/App.tsx b/newsfeed/src/components/App.tsx index 4d04c1a3..77e07420 100644 --- a/newsfeed/src/components/App.tsx +++ b/newsfeed/src/components/App.tsx @@ -1,16 +1,17 @@ -import * as React from "react"; +import { Suspense } from "react"; + import RelayEnvironment from "../relay/RelayEnvironment"; -import Newsfeed from "./Newsfeed"; import LoadingSpinner from "./LoadingSpinner"; +import Newsfeed from "./Newsfeed"; -export default function App(): React.ReactElement { +export default function App() { return ( - }> + }>
-
+
); } diff --git a/newsfeed/src/components/Card.tsx b/newsfeed/src/components/Card.tsx index 58668d98..a2e29107 100644 --- a/newsfeed/src/components/Card.tsx +++ b/newsfeed/src/components/Card.tsx @@ -1,11 +1,11 @@ -import * as React from "react"; +import { ReactNode } from "react"; export default function Card({ children, dim, }: { - children: React.ReactNode; + children: ReactNode; dim?: boolean; -}): React.ReactElement { +}) { return
{children}
; } diff --git a/newsfeed/src/components/CategorySelector.tsx b/newsfeed/src/components/CategorySelector.tsx index e56feede..49093021 100644 --- a/newsfeed/src/components/CategorySelector.tsx +++ b/newsfeed/src/components/CategorySelector.tsx @@ -1,4 +1,3 @@ -import * as React from "react"; import SmallSpinner from "./SmallSpinner"; // In a real app this would be imported from NewsfeedQuery.graphql; it is only defined @@ -18,7 +17,7 @@ export default function CategorySelector({ value: Category; onChange: (newValue: Category) => void; isPending?: boolean; -}): React.ReactElement { +}) { return (