Skip to content

Commit

Permalink
beam
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeparticle committed Oct 23, 2023
1 parent b7a6133 commit 32f35f3
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
7 changes: 7 additions & 0 deletions ui/public/resource/course.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
"url": "https://www.joyofreact.com/",
"socials": []
},
{
"name": "REACT.gg",
"category": "React",
"subCategory": "React",
"url": "https://react.gg/",
"socials": []
},
{
"name": "useEffect",
"category": "React",
Expand Down
12 changes: 12 additions & 0 deletions ui/public/resource/plugin.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
[
{
"name": "ReacTree",
"category": "VSCode Extension",
"subCategory": "Visualizer",
"url": "https://marketplace.visualstudio.com/items?itemName=ReacTreeDev.reactree",
"socials": [
{
"url": "https://marketplace.visualstudio.com",
"name": "VSCode Marketplace"
}
]
},
{
"name": "Prettier-vscode",
"category": "VSCode Extension",
Expand Down
28 changes: 25 additions & 3 deletions ui/src/components/Hoc/withPageTitle/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@ type HelpEntry = {
description: string;
};

interface HelpType {
interface Help {
[key: string]: HelpEntry;
}

const HELP: HelpType = {
interface QueryParam {
[key: string]: string;
}

interface BeamDetail {
name?: string;
url?: string;
queryParams?: QueryParam[];
}

interface Beam {
[key: string]: BeamDetail[];
}

const HELP: Help = {
[routesById.colorpicker.id]: {
description: "Color generator tool",
},
Expand All @@ -17,6 +31,14 @@ const HELP: HelpType = {
},
};

const BEAM: Beam = {
[routesById.colorpicker.id]: [
{ name: routesById.shadesandtints.title },
{ url: routesById.shadesandtints.path },
{ queryParams: [{ color: "color" }] },
],
};

const NO_PADDING = [
"BinaryTree: Developer Productivity Tools",
"About",
Expand All @@ -36,4 +58,4 @@ const NO_TITLE = [
];

export type { HelpEntry };
export { HELP, NO_PADDING, NO_TITLE };
export { HELP, NO_PADDING, NO_TITLE, BEAM };
3 changes: 2 additions & 1 deletion ui/src/components/Hoc/withPageTitle/utils/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { routes } from "data/routeData";
import { useLocation } from "react-router-dom";
import { HELP } from "./constants";
import { BEAM, HELP } from "./constants";

const usePageTitle = () => {
const { pathname } = useLocation();
Expand All @@ -16,6 +16,7 @@ const usePageTitle = () => {
title,
description,
helpObject: HELP[id] || {},
beamObject: BEAM[id] || {},
url: `https://binarytree.dev${pathname}`,
};
};
Expand Down

0 comments on commit 32f35f3

Please sign in to comment.