File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // src/components/ui/button_go_user_dashboard.tsx
2+
3+ /*
4+ This is the button component that will take us to the organization dashboard page
5+ Copy this function into its own file so it can be reused in multiple places
6+ */
7+
8+ // Next.js uses the Link component for client-side navigation
9+ // better and faster then <a> tags.
10+ import Link from "next/link" ;
11+ import React from "react" ;
12+
13+ /*
14+ legacyBehavior is used to enable the older behavior of Link component
15+ we dont actually need to have an <a> tag inside Link cause Link itself can handle it,
16+ but for styling purposes we are using it here
17+ */
18+ const ButtonGoUserDashboard = ( ) => {
19+ return (
20+ // Change the href to match the new page name, the name is based on the file name
21+ // example: organization_dashboard.tsx -> /organization_dashboard
22+ < Link href = "/user_dashboard" legacyBehavior >
23+ < a
24+ style = { {
25+ padding : "10px 20px" ,
26+ marginTop : "20px" ,
27+ backgroundColor : "#0070f3" ,
28+ color : "white" ,
29+ borderRadius : "5px" ,
30+ textDecoration : "none" ,
31+ fontSize : "1.1em" ,
32+ } }
33+ >
34+ Go to User Dashboard
35+ </ a >
36+ </ Link >
37+ ) ;
38+ } ;
39+
40+ // Use default export so it can be easily imported into the page
41+ export default ButtonGoUserDashboard ;
You can’t perform that action at this time.
0 commit comments