Skip to content

Commit a1850cc

Browse files
committed
Layout and ProtectedRoute modified.
1 parent be34610 commit a1850cc

File tree

21 files changed

+461
-215
lines changed

21 files changed

+461
-215
lines changed

reactjs/package-lock.json

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactjs/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"@aspnet/signalr": "^1.0.0",
77
"@types/moment": "^2.13.0",
88
"@types/moment-timezone": "^0.5.9",
9+
"@types/react-document-title": "^2.0.3",
910
"@types/recharts": "^1.1.1",
1011
"abp-web-resources": "^3.8.2",
1112
"antd": "^3.10.3",
@@ -20,6 +21,7 @@
2021
"react": "^16.6.0",
2122
"react-app-rewire-less": "^2.1.3",
2223
"react-app-rewired": "^1.6.2",
24+
"react-document-title": "^2.0.3",
2325
"react-dom": "^16.6.0",
2426
"react-router-dom": "^4.3.1",
2527
"react-scripts-ts": "3.1.0",

reactjs/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import './App.css';
33
import { withRouter, Switch, Route } from 'react-router-dom';
4-
import Layout from './scenes/Layout';
4+
import Layout from './components/Layout';
55
import Login from './scenes/Login';
66
import { inject } from 'mobx-react';
77
import SignalRAspNetCoreHelper from 'src/lib/signalRAspNetCoreHelper';

reactjs/src/components/AppComponentBase/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import * as React from 'react';
2-
import AppConsts from 'src/lib/appconst';
2+
import { L, isGranted } from 'src/lib/abpUtility';
33

44
class AppComponentBase<P = {}, S = {}, SS = any> extends React.Component<P, S, SS> {
5-
localizationSourceName = AppConsts.localization.defaultLocalizationSourceName;
6-
75
L(key: string, sourceName?: string): string {
8-
return abp.localization.localize(key, sourceName ? sourceName : this.localizationSourceName);
6+
return L(key);
97
}
108

119
isGranted(permissionName: string): boolean {
12-
return abp.auth.isGranted(permissionName);
10+
return isGranted(permissionName);
1311
}
1412
}
1513

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as React from 'react';
2+
3+
const Footer = () => {
4+
return (
5+
<React.Fragment>
6+
Asp.Net Boilerplate - React ©2018 <a href="https://github.com/ryoldash/module-zero-core-template">Github Page</a>
7+
</React.Fragment>
8+
);
9+
};
10+
export default Footer;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.trigger {
2+
font-size: 18px;
3+
line-height: 64px;
4+
padding: 0 24px;
5+
cursor: pointer;
6+
transition: color 0.3s;
7+
}
8+
9+
.trigger:hover {
10+
color: #1890ff;
11+
}
12+
13+
.logo {
14+
height: 32px;
15+
background: rgba(255, 255, 255, 0.2);
16+
margin: 16px;
17+
}
18+
19+
/* Let's get this party started */
20+
::-webkit-scrollbar {
21+
width: 12px;
22+
}
23+
24+
/* Track */
25+
::-webkit-scrollbar-track {
26+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
27+
-webkit-border-radius: 10px;
28+
border-radius: 10px;
29+
}
30+
31+
/* Handle */
32+
::-webkit-scrollbar-thumb {
33+
-webkit-border-radius: 10px;
34+
border-radius: 10px;
35+
background: #455A64;
36+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
37+
}
38+
39+
::-webkit-scrollbar-thumb:window-inactive {
40+
background: #455A64;
41+
}
42+
43+
.sidebar {
44+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 3px 10px 30px 3px rgba(0, 0, 0, 0.19);
45+
}
Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import * as React from 'react';
2-
import { Col, Icon, Layout, Avatar, Menu, Dropdown, Badge } from 'antd';
2+
import { Col, Icon, Avatar, Menu, Dropdown, Badge } from 'antd';
33
import { Link } from 'react-router-dom';
4+
import LanguageSelect from '../LanguageSelect';
5+
import './index.css';
46

5-
export interface LayoutHeaderProps {
7+
export interface IHeaderProps {
68
collapsed?: any;
79
toggle?: any;
810
}
@@ -11,29 +13,18 @@ const userDropdownMenu = (
1113
<Menu>
1214
<Menu.Item key="2">
1315
<Icon type="logout" />
14-
<span> <Link to="/login">Logout</Link></span>
16+
<span>
17+
{' '}
18+
<Link to="/login">Logout</Link>
19+
</span>
1520
</Menu.Item>
1621
</Menu>
1722
);
1823

19-
const languageMenu = (
20-
<Menu>
21-
<Menu.Item key="1">
22-
<span>English</span>
23-
</Menu.Item>
24-
<Menu.Item key="2">
25-
<span>Deutsch</span>
26-
</Menu.Item>
27-
<Menu.Item key="3">
28-
<span>Türkçe</span>
29-
</Menu.Item>
30-
</Menu>
31-
);
32-
33-
export class LayoutHeader extends React.Component<LayoutHeaderProps> {
24+
export class Header extends React.Component<IHeaderProps> {
3425
render() {
3526
return (
36-
<Layout.Header style={{ background: '#fff', minHeight: 83, padding: 0 }}>
27+
<React.Fragment>
3728
<Col style={{ textAlign: 'left' }} span={12}>
3829
<Icon
3930
style={{ marginTop: 10, marginRight: 10, textAlign: 'left' }}
@@ -43,18 +34,16 @@ export class LayoutHeader extends React.Component<LayoutHeaderProps> {
4334
/>
4435
</Col>
4536
<Col style={{ margin: 15, marginLeft: 10, textAlign: 'right' }}>
46-
<Dropdown overlay={languageMenu} trigger={['click']}>
47-
<Icon style={{ margin: 20 }} type="global" />
48-
</Dropdown>
37+
<LanguageSelect />
4938
<Dropdown overlay={userDropdownMenu} trigger={['click']}>
5039
<Badge style={{ margin: 10 }} count={3}>
5140
<Avatar style={{ margin: 10 }} size={48} alt={'profile'} src="https://sametkabay.com/images/smtkby/smtkby240.png" />
5241
</Badge>
5342
</Dropdown>
5443
</Col>
55-
</Layout.Header>
44+
</React.Fragment>
5645
);
5746
}
5847
}
5948

60-
export default LayoutHeader;
49+
export default Header;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.trigger {
2+
font-size: 18px;
3+
line-height: 64px;
4+
padding: 0 24px;
5+
cursor: pointer;
6+
transition: color 0.3s;
7+
}
8+
9+
.trigger:hover {
10+
color: #1890ff;
11+
}
12+
13+
.logo {
14+
height: 32px;
15+
background: rgba(255, 255, 255, 0.2);
16+
margin: 16px;
17+
}
18+
19+
/* Let's get this party started */
20+
::-webkit-scrollbar {
21+
width: 12px;
22+
}
23+
24+
/* Track */
25+
::-webkit-scrollbar-track {
26+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
27+
-webkit-border-radius: 10px;
28+
border-radius: 10px;
29+
}
30+
31+
/* Handle */
32+
::-webkit-scrollbar-thumb {
33+
-webkit-border-radius: 10px;
34+
border-radius: 10px;
35+
background: #455A64;
36+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
37+
}
38+
39+
::-webkit-scrollbar-thumb:window-inactive {
40+
background: #455A64;
41+
}
42+
43+
.sidebar {
44+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 3px 10px 30px 3px rgba(0, 0, 0, 0.19);
45+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as React from 'react';
2+
import { Menu, Dropdown, Icon } from 'antd';
3+
import './index.css';
4+
5+
const languageMenu = (
6+
<Menu>
7+
<Menu.Item key="1">
8+
<span>English</span>
9+
</Menu.Item>
10+
<Menu.Item key="2">
11+
<span>Deutsch</span>
12+
</Menu.Item>
13+
<Menu.Item key="3">
14+
<span>Türkçe</span>
15+
</Menu.Item>
16+
</Menu>
17+
);
18+
19+
const LanguageSelect = () => {
20+
return (
21+
<Dropdown overlay={languageMenu} trigger={['click']}>
22+
<Icon style={{ margin: 20 }} type="global" />
23+
</Dropdown>
24+
);
25+
};
26+
27+
export default LanguageSelect;

reactjs/src/scenes/Layout/index.css renamed to reactjs/src/components/Layout/index.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/* Track */
2525
::-webkit-scrollbar-track {
26-
-webkit-box-shadow: inset 0 0 3px rgba(0,0,0,0.3);
26+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
2727
-webkit-border-radius: 10px;
2828
border-radius: 10px;
2929
}
@@ -32,12 +32,14 @@
3232
::-webkit-scrollbar-thumb {
3333
-webkit-border-radius: 10px;
3434
border-radius: 10px;
35-
background: #455A64;
36-
-webkit-box-shadow: inset 0 0 3px rgba(0,0,0,0.5);
35+
background: #455A64;
36+
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
3737
}
38+
3839
::-webkit-scrollbar-thumb:window-inactive {
39-
background: #455A64;
40+
background: #455A64;
4041
}
42+
4143
.sidebar {
4244
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 3px 10px 30px 3px rgba(0, 0, 0, 0.19);
4345
}

0 commit comments

Comments
 (0)