Skip to content

Commit 20232ef

Browse files
committed
Merge branch 'nextjs' of https://github.com/flexmonster/pivot-react into nextjs
2 parents c102eb9 + ccbc14c commit 20232ef

File tree

3 files changed

+44
-43
lines changed

3 files changed

+44
-43
lines changed

typescript-next/src/UIElements/SideMenu.tsx

+41-38
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,48 @@ import React from "react";
33

44
export default class SideMenu extends React.Component {
55

6-
render () {
6+
activeClassName(pathname: string) : string {
7+
return window.location.pathname == pathname ? "router-link-exact-active" : "";
8+
}
9+
render() {
710
return (
8-
<div className="side-menu">
9-
<ol>
10-
<li className="tab-button">
11-
<a className="router-link-exact-active" href="/pivot-table-demo">PIVOT TABLE DEMO</a>
12-
</li>
13-
</ol>
14-
<div className="sub-title">API and Events</div>
15-
<ol>
16-
<li className="tab-button">
17-
<a className="router-link-exact-active" href="/handling-events">HANDLING EVENTS</a>
18-
</li>
19-
<li className="tab-button">
20-
<a className="router-link-exact-active" href="/using-api-calls">USING API CALLS</a>
21-
</li>
22-
<li className="tab-button">
23-
<a className="router-link-exact-active" href="/updating-data">UPDATING DATA</a>
24-
</li>
25-
</ol>
26-
<div className="sub-title">Customization</div>
27-
<ol>
28-
<li className="tab-button">
29-
<a className="router-link-exact-active" href="/customizing-toolbar">CUSTOMIZING THE TOOLBAR</a>
30-
</li>
31-
<li className="tab-button">
32-
<a className="router-link-exact-active" href="/customizing-grid">CUSTOMIZING THE GRID</a>
33-
</li>
34-
</ol>
35-
<div className="sub-title">Integration</div>
36-
<ol>
37-
<li className="tab-button">
38-
<a className="router-link-exact-active" href="/with-highcharts">WITH HIGHCHARTS</a>
39-
</li>
40-
<li className="tab-button">
41-
<a className="router-link-exact-active" href="/with-amcharts">WITH AMCHARTS</a>
42-
</li>
43-
</ol>
44-
</div>
11+
<div className="side-menu">
12+
<ol>
13+
<li className="tab-button">
14+
<a className={this.activeClassName("/pivot-table-demo")} href="/pivot-table-demo">PIVOT TABLE DEMO</a>
15+
</li>
16+
</ol>
17+
<div className="sub-title">API and Events</div>
18+
<ol>
19+
<li className="tab-button">
20+
<a className={this.activeClassName("/handling-events")} href="/handling-events">HANDLING EVENTS</a>
21+
</li>
22+
<li className="tab-button">
23+
<a className={this.activeClassName("/using-api-calls")} href="/using-api-calls">USING API CALLS</a>
24+
</li>
25+
<li className="tab-button">
26+
<a className={this.activeClassName("/updating-data")} href="/updating-data">UPDATING DATA</a>
27+
</li>
28+
</ol>
29+
<div className="sub-title">Customization</div>
30+
<ol>
31+
<li className="tab-button">
32+
<a className={this.activeClassName("/customizing-toolbar")} href="/customizing-toolbar">CUSTOMIZING THE TOOLBAR</a>
33+
</li>
34+
<li className="tab-button">
35+
<a className={this.activeClassName("/customizing-grid")} href="/customizing-grid">CUSTOMIZING THE GRID</a>
36+
</li>
37+
</ol>
38+
<div className="sub-title">Integration</div>
39+
<ol>
40+
<li className="tab-button">
41+
<a className={this.activeClassName("/with-highcharts")} href="/with-highcharts">WITH HIGHCHARTS</a>
42+
</li>
43+
<li className="tab-button">
44+
<a className={this.activeClassName("/with-amcharts")} href="/with-amcharts">WITH AMCHARTS</a>
45+
</li>
46+
</ol>
47+
</div>
4548
);
4649
}
4750
}

typescript-next/src/app/globals.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ ul {
489489
}
490490

491491
.side-menu li a:hover,
492-
.side-menu li a.router-link-exact-active:active,
493-
.side-menu li.active a.router-link-exact-active:active {
492+
.side-menu li a.router-link-exact-active,
493+
.side-menu li.active a.router-link-exact-active {
494494
color: #df3800;
495495
}
496496

typescript-next/src/app/layout.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import './globals.css'
22
import TopMenu from '@/UIElements/TopMenu'
33
import SideMenu from '@/UIElements/SideMenu'
44
import { Inter } from 'next/font/google'
5-
import { BrowserRouter as Router } from 'react-router-dom';
65

76
const inter = Inter({ subsets: ['latin'] })
87

98
export const metadata = {
109
title: 'Flexmonster Next App',
11-
1210
}
1311

1412
export default function RootLayout({
@@ -22,7 +20,7 @@ export default function RootLayout({
2220
<div id="app">
2321
<TopMenu />
2422
<div className="wrap">
25-
<SideMenu />
23+
<SideMenu/>
2624
<div className="pivot-example-container">
2725
{children}
2826
</div>

0 commit comments

Comments
 (0)