🚀 chore(MainPage): use constant for header text in user projects section
The changes in headerComponent remove unused imports and update the header text to use a constant instead of a hardcoded string. The constant is added in constants.tsx. The MainPage component is updated to use the constant for the header text in the user projects section. This improves code readability and maintainability. 🎨 style(headerComponent): remove unused imports and update header text to use constant ✨ feat(constants.tsx): add constant for header text in user projects section
This commit is contained in:
parent
bf621c78b4
commit
28a902ec15
3 changed files with 13 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { SunIcon, MoonIcon, BellIcon, Home, Users2 } from "lucide-react";
|
||||
import { useContext, useState, useEffect } from "react";
|
||||
import { BellIcon, Home, Users2 } from "lucide-react";
|
||||
import { useContext } from "react";
|
||||
import { FaGithub } from "react-icons/fa";
|
||||
import { Button } from "../ui/button";
|
||||
import { TabsContext } from "../../contexts/tabsContext";
|
||||
|
|
@ -10,6 +10,7 @@ import { PopUpContext } from "../../contexts/popUpContext";
|
|||
import { typesContext } from "../../contexts/typesContext";
|
||||
import MenuBar from "./components/menuBar";
|
||||
import { Link, useLocation, useParams } from "react-router-dom";
|
||||
import { USER_PROJECTS_HEADER } from "../../constants";
|
||||
|
||||
export default function Header() {
|
||||
const { flows, addFlow, tabId } = useContext(TabsContext);
|
||||
|
|
@ -39,7 +40,7 @@ export default function Header() {
|
|||
size="sm"
|
||||
>
|
||||
<Home className="w-4 h-4" />
|
||||
<div className="flex-1">My Projects</div>
|
||||
<div className="flex-1">{USER_PROJECTS_HEADER}</div>
|
||||
</Button>
|
||||
</Link>
|
||||
<Link to="/community">
|
||||
|
|
|
|||
|
|
@ -399,3 +399,10 @@ export const NOUNS: string[] = [
|
|||
"yalow",
|
||||
"yonath",
|
||||
];
|
||||
|
||||
/**
|
||||
* Header text for user projects
|
||||
* @constant
|
||||
*
|
||||
*/
|
||||
export const USER_PROJECTS_HEADER = "My Collection";
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { TabsContext } from "../../contexts/tabsContext";
|
|||
import { Button } from "../../components/ui/button";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { CardComponent } from "../../components/cardComponent";
|
||||
import { USER_PROJECTS_HEADER } from "../../constants";
|
||||
export default function HomePage() {
|
||||
const { flows, setTabId, downloadFlows, uploadFlows, addFlow, removeFlow } =
|
||||
useContext(TabsContext);
|
||||
|
|
@ -16,7 +17,7 @@ export default function HomePage() {
|
|||
<div className="w-full flex justify-between py-12 pb-2 px-6">
|
||||
<span className="text-2xl flex items-center justify-center gap-2 font-semibold">
|
||||
<Home className="w-6" />
|
||||
My Collection
|
||||
{USER_PROJECTS_HEADER}
|
||||
</span>
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue