Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { Add, Clear, FilterList, RestartAlt } from "@mui/icons-material";
import { Box, Button, Chip, FormControl, IconButton, InputLabel, MenuItem, Select, Stack, TextField } from "@mui/material";
import * as React from "react";

import BackendAdminAPISchemas from "../../../../../packages/common/src/schemas/backendAdminAPI";

type OpenAPIParameterSchema = BackendAdminAPISchemas.OpenAPIParameterSchema;
type ChoicesResponse = BackendAdminAPISchemas.ChoicesResponse;
import { ChoicesResponse, OpenAPIParameterSchema } from "../../../../../packages/common/src/schemas/backendAdminAPI";

type AdminListFilterProps = {
parameters: OpenAPIParameterSchema[];
Expand Down
7 changes: 2 additions & 5 deletions apps/pyconkr-admin/src/components/pages/page/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ import { commands } from "@uiw/react-md-editor";
import * as React from "react";
import { useParams } from "react-router-dom";

// I don't know why, I don't want to know why, I shouldn't have to wonder why,
// but for whatever reason this stupid namespace won't import on Common.Schemas.BackendAdminAPI.PageSectionSchema.
// TODO: FIXME: Remove this hack when the issue is resolved. This is dumb.
import BackendAdminAPISchemas from "../../../../../../packages/common/src/schemas/backendAdminAPI";
import { PageSectionSchema } from "../../../../../../packages/common/src/schemas/backendAdminAPI";
import { muiTheme } from "../../../styles/globalStyles";
import { addErrorSnackbar } from "../../../utils/snackbar";
import { AdminEditor } from "../../layouts/admin_editor";

type SectionType = BackendAdminAPISchemas.PageSectionSchema;
type SectionType = PageSectionSchema;

type CommonSectionEditorPropType = {
disabled?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions apps/pyconkr-admin/src/components/pages/sitemap/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import { enqueueSnackbar, OptionsObject } from "notistack";
import * as React from "react";
import { GroupOptions, ReactSortable, SortableEvent, SortableOptions } from "react-sortablejs";

import BackendAdminAPISchemas from "../../../../../../packages/common/src/schemas/backendAdminAPI";
import { FlattenedSiteMapSchema, NestedSiteMapSchema } from "../../../../../../packages/common/src/schemas/backendAdminAPI";
import { BackendAdminSignInGuard } from "../../elements/admin_signin_guard";
import { AdminEditor } from "../../layouts/admin_editor";

type FlatSiteMap = BackendAdminAPISchemas.FlattenedSiteMapSchema;
type FlatSiteMap = FlattenedSiteMapSchema;
type FlatSiteMapObj = Record<string, FlatSiteMap>;
type NestedSiteMap = BackendAdminAPISchemas.NestedSiteMapSchema;
type NestedSiteMap = NestedSiteMapSchema;
type FlatNestedSiteMap = Record<string, NestedSiteMap>;

const DepthColorMap: React.CSSProperties["backgroundColor"][] = [
Expand Down
4 changes: 2 additions & 2 deletions apps/pyconkr/src/components/layout/BreadCrumb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import * as React from "react";
import { Link } from "react-router-dom";
import * as R from "remeda";

import BackendAPISchemas from "../../../../../../packages/common/src/schemas/backendAPI";
import { NestedSiteMapSchema } from "../../../../../../packages/common/src/schemas/backendAPI";

type BreadCrumbPropType = {
title: string;
parentSiteMaps: (BackendAPISchemas.NestedSiteMapSchema | undefined)[];
parentSiteMaps: (NestedSiteMapSchema | undefined)[];
};

export const BreadCrumb: React.FC<BreadCrumbPropType> = ({ title, parentSiteMaps }) => {
Expand Down
4 changes: 2 additions & 2 deletions apps/pyconkr/src/components/layout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import * as React from "react";
import { Link } from "react-router-dom";
import * as R from "remeda";

import BackendAPISchemas from "../../../../../../packages/common/src/schemas/backendAPI";
import { NestedSiteMapSchema } from "../../../../../../packages/common/src/schemas/backendAPI";
import { useAppContext } from "../../../contexts/app_context";
import { CartBadgeButton } from "../CartBadgeButton";
import LanguageSelector from "../LanguageSelector";
import { SignInButton } from "../SignInButton";
// import { ScanCodeIconButton } from "../UserScanCodeButton";
import { MobileHeader } from "./Mobile/MobileHeader";

type MenuType = BackendAPISchemas.NestedSiteMapSchema;
type MenuType = NestedSiteMapSchema;
type MenuOrUndefinedType = MenuType | undefined;

type NavigationStateType = {
Expand Down
4 changes: 2 additions & 2 deletions apps/pyconkr/src/components/pages/sponsor_detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from "react";
import { useParams } from "react-router-dom";
import * as R from "remeda";

import BackendAPISchemas from "../../../../../packages/common/src/schemas/backendAPI";
import { SponsorTierSchema } from "../../../../../packages/common/src/schemas/backendAPI";
import { useAppContext } from "../../contexts/app_context";
import { PageLayout } from "../layout/PageLayout";

Expand Down Expand Up @@ -54,7 +54,7 @@ export const SponsorDetailPage: React.FC = ErrorBoundary.with(
Suspense.with({ fallback: <CenteredLoadingPage /> }, () => {
const { id } = useParams();
const { language, sponsorTiers, setAppContext } = useAppContext();
const sponsors = sponsorTiers?.reduce((acc, tier) => [...acc, ...tier.sponsors], [] as BackendAPISchemas.SponsorTierSchema["sponsors"]);
const sponsors = sponsorTiers?.reduce((acc, tier) => [...acc, ...tier.sponsors], [] as SponsorTierSchema["sponsors"]);
const sponsor = sponsors?.find((s) => s.id === id);

const title = language === "ko" ? "후원사" : "Sponsor";
Expand Down
8 changes: 4 additions & 4 deletions apps/pyconkr/src/contexts/app_context.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";

import BackendAPISchemas from "../../../../packages/common/src/schemas/backendAPI";
import { NestedSiteMapSchema, SponsorTierSchema } from "../../../../packages/common/src/schemas/backendAPI";

type LanguageType = "ko" | "en";

Expand All @@ -9,10 +9,10 @@ export type AppContextType = {
shouldShowTitleBanner: boolean;
shouldShowSponsorBanner: boolean;

siteMapNode?: BackendAPISchemas.NestedSiteMapSchema;
sponsorTiers?: BackendAPISchemas.SponsorTierSchema[];
siteMapNode?: NestedSiteMapSchema;
sponsorTiers?: SponsorTierSchema[];
title: string;
currentSiteMapDepth: (BackendAPISchemas.NestedSiteMapSchema | undefined)[];
currentSiteMapDepth: (NestedSiteMapSchema | undefined)[];

setAppContext: React.Dispatch<React.SetStateAction<Omit<AppContextType, "setAppContext">>>;
};
Expand Down