diff --git a/public/screenshots/dashboard.png b/public/screenshots/dashboard.png new file mode 100644 index 0000000..e2187d6 Binary files /dev/null and b/public/screenshots/dashboard.png differ diff --git a/public/screenshots/frontpage.png b/public/screenshots/frontpage.png new file mode 100644 index 0000000..24a4cf4 Binary files /dev/null and b/public/screenshots/frontpage.png differ diff --git a/src/pages/_middleware.ts b/src/pages/_middleware.ts index f9f1509..8342137 100644 --- a/src/pages/_middleware.ts +++ b/src/pages/_middleware.ts @@ -12,6 +12,8 @@ export async function middleware(req: NextRequest) { new URL(`/dashboards/view/${dashboardId}`, req.url) ); } + } else if (pathname === "/capture") { + return NextResponse.redirect(new URL("/", req.url)); } else if (pathname === "/secretDashboard") { const dashboardId = searchParams.get("dashboardId"); if (dashboardId) { diff --git a/src/pages/capture.tsx b/src/pages/capture.tsx deleted file mode 100644 index e1a8e86..0000000 --- a/src/pages/capture.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { NextPage } from "next"; -import React from "react"; - -import { displayQuestionsWrapperForCapture } from "../web/display/displayQuestionsWrappers"; -import { Layout } from "../web/display/Layout"; -import { Props } from "../web/search/anySearchPage"; -import CommonDisplay from "../web/search/CommonDisplay"; - -export { getServerSideProps } from "../web/search/anySearchPage"; - -const CapturePage: NextPage = (props) => { - return ( - - - - ); -}; - -export default CapturePage; diff --git a/src/pages/tools.tsx b/src/pages/tools.tsx index 7463a07..5eecb24 100644 --- a/src/pages/tools.tsx +++ b/src/pages/tools.tsx @@ -52,19 +52,19 @@ const ToolsPage: NextPage = () => { title: "Search", description: "Find forecasting questions on many platforms.", innerLink: "/", - img: "https://i.imgur.com/Q94gVqG.png", + img: "/screenshots/frontpage.png", }, { title: "[Beta] Present", description: "Present forecasts in dashboards.", innerLink: "/dashboards", - img: "https://i.imgur.com/x8qkuHQ.png", + img: "/screenshots/dashboard.png", }, { title: "Capture", description: - "Capture forecasts save them to Imgur. Useful for posting them somewhere else as images. Currently rate limited by Imgur, so if you get a .gif of a fox falling flat on his face, that's why.", - innerLink: "/capture", + "Capture forecasts save them to Imgur. Useful for posting them somewhere else as images. Currently rate limited by Imgur, so if you get a .gif of a fox falling flat on his face, that's why. Capture button can be found on individual questions pages.", + innerLink: "/", img: "https://i.imgur.com/EXkFBzz.png", }, { @@ -75,9 +75,10 @@ const ToolsPage: NextPage = () => { img: "https://i.imgur.com/BQ4Zzjw.png", }, { - title: "[Upcoming] Request", + title: "[Beta] Request", description: - "Interact with metaforecast's API and fetch forecasts for your application. Currently possible but documentation is poor, get in touch.", + "Interact with metaforecast's GraphQL API and fetch forecasts for your application. Currently possible but documentation is poor, get in touch.", + externalLink: "/api/graphql", }, { title: "[Upcoming] Record", diff --git a/src/web/display/displayQuestionsWrappers.tsx b/src/web/display/displayQuestionsWrappers.tsx index 7c4683d..bf407bb 100644 --- a/src/web/display/displayQuestionsWrappers.tsx +++ b/src/web/display/displayQuestionsWrappers.tsx @@ -1,4 +1,3 @@ -import { DisplayOneQuestionForCapture } from "./DisplayOneQuestionForCapture"; import { DisplayQuestions } from "./DisplayQuestions"; export function displayQuestionsWrapperForSearch({ @@ -16,16 +15,3 @@ export function displayQuestionsWrapperForSearch({ ); } - -export function displayQuestionsWrapperForCapture({ - results, - whichResultToDisplayAndCapture, -}) { - return ( -
- -
- ); -} diff --git a/src/web/questions/pages/QuestionPage.tsx b/src/web/questions/pages/QuestionPage.tsx index 707dbcd..53a4ae3 100644 --- a/src/web/questions/pages/QuestionPage.tsx +++ b/src/web/questions/pages/QuestionPage.tsx @@ -1,21 +1,17 @@ import { GetServerSideProps, NextPage } from "next"; import ReactMarkdown from "react-markdown"; -import { QualityIndicatorsObj } from "../../../graphql/schema/questions"; import { Query } from "../../common/Query"; import { Card } from "../../display/Card"; +import { DisplayOneQuestionForCapture } from "../../display/DisplayOneQuestionForCapture"; import { - QuestionFooter, - qualityIndicatorLabels, - formatIndicatorValue, - UsedIndicatorName, - getStarsElement, + formatIndicatorValue, getStarsElement, qualityIndicatorLabels, UsedIndicatorName } from "../../display/DisplayQuestion/QuestionFooter"; import { Layout } from "../../display/Layout"; +import { LineHeader } from "../../display/LineHeader"; import { QuestionWithHistoryFragment } from "../../fragments.generated"; import { ssrUrql } from "../../urql"; import { HistoryChart } from "../components/HistoryChart"; -import { QuestionOptions } from "../components/QuestionOptions"; import { QuestionPageDocument } from "../queries.generated"; interface Props { @@ -164,11 +160,21 @@ const QuestionPage: NextPage = ({ id }) => { return (
- - - {({ data }) => } - - + + {({ data }) => ( +
+ + + +
+ +

Capture

+
+ +
+
+ )} +
);