Skip to content

Commit c509c87

Browse files
committed
Add reroute to problems page when header tab is clicked
1 parent c0140f9 commit c509c87

File tree

1 file changed

+5
-0
lines changed
  • apps/question-service/src/components/Header

1 file changed

+5
-0
lines changed

apps/question-service/src/components/Header/header.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { Menu } from "antd";
22
import { Header as AntdHeader } from "antd/es/layout/layout";
3+
import { useRouter } from "next/navigation";
34
import "./styles.scss";
45

56
const Header = (): JSX.Element => {
7+
const { push } = useRouter();
68
// Stores the details for the header buttons
79
const items = [
810
{
@@ -28,6 +30,9 @@ const Header = (): JSX.Element => {
2830
defaultSelectedKeys={["0"]}
2931
items={items}
3032
style={{ flex: 1, minWidth: 0 }}
33+
onClick={(info) => {
34+
push("/");
35+
}}
3136
/>
3237
</AntdHeader>
3338
);

0 commit comments

Comments
 (0)