Skip to content

Commit

Permalink
fix(web): hide template (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk authored Jun 16, 2023
1 parent 88f5bec commit 60b4b89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions web/src/layouts/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ const Header = (props: { bg: string }) => {
const { colorMode } = useColorMode();
const darkMode = colorMode === COLOR_MODE.dark;
const { toggleColorMode } = useColorMode();
const [chosenItem, setChosenItem] = useState<string>("");
// const [chosenItem, setChosenItem] = useState<string>("");

const navList_left = [
{ text: t("HomePage.NavBar.home"), ref: "/dashboard" },
{
text: t("HomePage.NavBar.funcTemplate"),
ref: "/market/templates/all",
value: "templateMarket",
},
// {
// text: t("HomePage.NavBar.funcTemplate"),
// ref: "/market/templates/all",
// value: "templateMarket",
// },
// { text: t("HomePage.NavBar.appMarket"), ref: "/function-templates" },
];
const navList_right = [
Expand Down Expand Up @@ -67,11 +67,11 @@ const Header = (props: { bg: string }) => {
return () => {};
}, []);

useEffect(() => {
if (window.location.href.includes("function-templates")) {
setChosenItem("templateMarket");
}
}, []);
// useEffect(() => {
// if (window.location.href.includes("function-templates")) {
// setChosenItem("templateMarket");
// }
// }, []);

return (
<div
Expand All @@ -98,8 +98,8 @@ const Header = (props: { bg: string }) => {
href={item.ref}
className={clsx(
"mr-8 text-lg",
item.value === chosenItem && !darkMode ? "font-semibold text-grayModern-900" : "",
item.value === chosenItem && darkMode ? "font-semibold text-grayModern-100" : "",
// item.value === chosenItem && !darkMode ? "font-semibold text-grayModern-900" : "",
// item.value === chosenItem && darkMode ? "font-semibold text-grayModern-100" : "",
)}
rel="noreferrer"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import { SUPPORTED_METHODS } from "@/constants";

import { useCreateFunctionMutation, useUpdateFunctionMutation } from "../../../service";
import useFunctionStore from "../../../store";
import FuncTemplate from "../FunctionTemplate";

// import FuncTemplate from "../FunctionTemplate";
import functionTemplates from "./functionTemplates";

import { TMethod } from "@/apis/typing";
Expand Down Expand Up @@ -136,7 +136,7 @@ const CreateModal = (props: {
className="h-8 w-10/12 border-l-2 border-primary-600 bg-transparent pl-4 text-2xl font-medium"
style={{ outline: "none", boxShadow: "none" }}
/>
{isEdit ? null : (
{/* {isEdit ? null : (
<FuncTemplate>
<span
className="w-2/12 cursor-pointer pl-2 text-lg font-medium text-primary-600"
Expand All @@ -145,7 +145,7 @@ const CreateModal = (props: {
{t("FunctionPanel.CreateFromTemplate")}
</span>
</FuncTemplate>
)}
)} */}
</div>
<FormErrorMessage>{errors.name && errors.name.message}</FormErrorMessage>
</FormControl>
Expand Down

0 comments on commit 60b4b89

Please sign in to comment.