Skip to content

Commit

Permalink
refactor hoc
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeparticle committed Sep 25, 2023
1 parent d873645 commit b409cc0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions ui/src/components/Hoc/withPageTitle/withPageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import { Space } from "antd";
import usePageTitle from "./utils/hooks";
import { HeadProvider, Title, Link, Meta } from "react-head";

const NO_PADDING = ["BinaryTree: Developer Productivity Tools", "About"];
const NO_PADDING = [
"BinaryTree: Developer Productivity Tools",
"About",
"Terms",
];

const NO_TITLE = ["BinaryTree: Developer Productivity Tools", "Terms"];

const withPageTitle = <T extends object>(
WrappedComponent: React.ComponentType<T>
) => {
Expand All @@ -25,7 +32,7 @@ const withPageTitle = <T extends object>(
<Meta name="description" content={description} />
</div>
</HeadProvider>
{title !== "BinaryTree: Developer Productivity Tools" && (
{!NO_TITLE.includes(title) && (
<>
<Space align="center">
<Text text={title} level={3} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
padding-top: 50px;
padding-left: 100px;
padding-right: 100px;
padding-bottom: 50px;
display: flex;

ul {
Expand Down
1 change: 1 addition & 0 deletions ui/src/pages/Footer/Terms/Terms.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
padding-top: 50px;
padding-left: 100px;
padding-right: 100px;
padding-bottom: 50px;
display: flex;

ul {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/Routes/utils/constant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export const routes: Route[] = [
{
id: "terms",
path: "/terms",
title: "",
title: "Terms",
description: "",
component: Terms,
},
Expand Down

0 comments on commit b409cc0

Please sign in to comment.