From 196c311459a429b7585f26414564501ebaf05aeb Mon Sep 17 00:00:00 2001 From: Abdurrahman Rajab Date: Mon, 22 May 2023 02:41:31 +0300 Subject: [PATCH 01/26] feat: post on highlights --- src/constants.ts | 12 ++++--- src/pages/posthighlight.tsx | 56 +++++++++++++++++++++++++++++ src/utils/fetchOpenSaucedApiData.ts | 28 ++++++++++++--- 3 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 src/pages/posthighlight.tsx diff --git a/src/constants.ts b/src/constants.ts index 0f345ea0..52db8271 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,11 +6,13 @@ export const OPEN_SAUCED_INSIGHTS_DOMAIN = "insights.opensauced.pizza"; export const AI_PR_DESCRIPTION_CONFIG_KEY = "ai-pr-description-config"; // API endpoints -export const OPEN_SAUCED_USERS_ENDPOINT = "https://api.opensauced.pizza/v1/users"; -export const OPEN_SAUCED_REPOS_ENDPOINT = "https://api.opensauced.pizza/v1/repos"; -export const OPEN_SAUCED_SESSION_ENDPOINT = "https://api.opensauced.pizza/v1/auth/session"; -export const OPEN_SAUCED_USER_INSIGHTS_ENDPOINT = "https://api.opensauced.pizza/v1/user/insights"; -export const OPEN_SAUCED_AI_PR_DESCRIPTION_ENDPOINT = "https://api.opensauced.pizza/v1/prs/description/generate"; +export const OPEN_SAUCED_API_ENDPOINT = "https://api.opensauced.pizza/v1"; +export const OPEN_SAUCED_USERS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/users`; +export const OPEN_SAUCED_REPOS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/repos`; +export const OPEN_SAUCED_SESSION_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/auth/session`; +export const OPEN_SAUCED_USER_INSIGHTS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/user/insights`; +export const OPEN_SAUCED_AI_PR_DESCRIPTION_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/prs/description/generate`; +export const OPEN_SAUCED_USER_HIGHLIGHTS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/user/highlights`; export const OPEN_SAUCED_AI_CODE_REFACTOR_ENDPOINT = "https://api.opensauced.pizza/v1/prs/suggestion/generate"; // GitHub constants/selectors diff --git a/src/pages/posthighlight.tsx b/src/pages/posthighlight.tsx new file mode 100644 index 00000000..97b811c5 --- /dev/null +++ b/src/pages/posthighlight.tsx @@ -0,0 +1,56 @@ +import { useContext } from "react"; +import { FaChevronLeft } from "react-icons/fa"; +import OpenSaucedLogo from "../assets/opensauced-logo.svg"; +import { RouteContext } from "../App"; + + +const PostOnHighlight = () => { + const { setCurrentPage } = useContext(RouteContext); + + return ( +
+
+
+ + + OpenSauced logo +
+
+ +
+ + + +