diff --git a/src/layouts/userLayout/UserLayout.tsx b/src/layouts/userLayout/UserLayout.tsx new file mode 100644 index 000000000..270fa85ad --- /dev/null +++ b/src/layouts/userLayout/UserLayout.tsx @@ -0,0 +1,28 @@ +import Header from "../../layouts/userLayout/Header"; + +export interface UserLayoutProps { + title?: string; + children?: React.ReactNode; +} + +const UserLayout: React.FC = (props) => { + return ( +
+
+ {props.title && ( +
+
+

+ {props.title} +

+
+
+ )} +
+ {props.children} +
+
+ ); +}; + +export default UserLayout; diff --git a/src/pages/Problem.tsx b/src/pages/Problem.tsx index dadfb85f4..c5c40caa3 100644 --- a/src/pages/Problem.tsx +++ b/src/pages/Problem.tsx @@ -2,11 +2,11 @@ import { Button } from "@nextui-org/react"; import CodeEditor from "../components/code-editor/CodeEditor"; import MarkdownRender from "../components/markdown/MarkdownRender"; import { useProblem } from "../hooks/problem"; -import Header from "../layouts/userLayout/Header"; import JudgeVerdictTable from "../components/JudgeVerdictTable"; import { useJudge } from "../hooks/judge"; import { judgeVerdictListPipe } from "../pipes/judge"; import { useEffect } from "react"; +import UserLayout from "../layouts/userLayout/UserLayout"; const defaultCode = `#include using namespace std; @@ -28,47 +28,37 @@ const Problem: React.FC = () => { }, [setSrcLanguage]); return ( -
-
-
-
-

- {getProblemInfo()?.title} -

+ +
+
+
-
-
-
-
- -
-
- { - setSrc(value); - console.log(value); - }} - /> - -
+
+ { + setSrc(value); + console.log(value); + }} + /> +
- {getVerdicts().length > 0 && ( - - )} -
-
+ + {getVerdicts().length > 0 && ( + + )} + ); };