Skip to content

Commit 76a4543

Browse files
authored
Merge pull request #5 from ryoldash/u-samet
User Layout Refactoring
2 parents 55c5c19 + c027310 commit 76a4543

File tree

9 files changed

+3936
-3744
lines changed

9 files changed

+3936
-3744
lines changed

reactjs/package-lock.json

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

reactjs/src/App.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.App {
22
text-align: center;
3+
background: #142c52;
34
}
45

56
.App-logo {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.footer {
2+
position: sticky;
3+
left: 0;
4+
margin-top: 16px;
5+
bottom: 64px;
6+
width: 100%;
7+
text-align: center;
8+
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import * as React from 'react';
2+
import { Col } from 'antd';
3+
import './index.less';
24

35
const Footer = () => {
46
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>
7+
<Col className={"footer"}>
8+
Asp.Net Boilerplate - React © 2018 <a href="https://github.com/ryoldash/module-zero-core-template">Github Page</a>
9+
</Col>
810
);
911
};
1012
export default Footer;
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
@import '~antd/lib/style/themes/default.less';
2+
3+
.container {
4+
display: flex;
5+
flex-direction: column;
6+
height: 100vh;
7+
overflow: auto;
8+
background: @layout-body-background;
9+
}
10+
11+
.lang {
12+
text-align: right;
13+
width: 100%;
14+
height: 40px;
15+
line-height: 44px;
16+
:global(.ant-dropdown-trigger) {
17+
margin-right: 24px;
18+
}
19+
}
20+
21+
.content {
22+
padding: 32px 0;
23+
flex: 1;
24+
}
25+
26+
@media (min-width: @screen-md-min) {
27+
.container {
28+
background-image: url('../../images/userLayout-Backround.svg');
29+
background-repeat: no-repeat;
30+
background-position: center 110px;
31+
background-size: 100%;
32+
}
33+
34+
.content {
35+
padding: 72px 0 24px 0;
36+
}
37+
}
38+
39+
.top {
40+
text-align: center;
41+
}
42+
43+
.header {
44+
height: 44px;
45+
line-height: 44px;
46+
a {
47+
text-decoration: none;
48+
}
49+
}
50+
51+
.logo {
52+
height: 44px;
53+
vertical-align: top;
54+
margin-right: 16px;
55+
}
56+
57+
.title {
58+
font-size: 33px;
59+
color: @heading-color;
60+
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
61+
font-weight: 600;
62+
position: relative;
63+
top: 2px;
64+
}
65+
66+
.desc {
67+
font-size: @font-size-base;
68+
color: @text-color-secondary;
69+
margin-top: 12px;
70+
margin-bottom: 40px;
71+
}

reactjs/src/components/Layout/UserLayout.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import DocumentTitle from 'react-document-title';
33
import { Switch, Route, Redirect } from 'react-router-dom';
44
import utils from 'src/utils/utils';
55
import { userRouter } from '../Router/router.config';
6+
import { Col } from 'antd';
7+
// import "./UserLayout.css";
8+
import "./UserLayout.less";
9+
import Footer from '../Footer';
610

711
class UserLayout extends React.Component<any> {
812
render() {
@@ -11,15 +15,18 @@ class UserLayout extends React.Component<any> {
1115
} = this.props;
1216
return (
1317
<DocumentTitle title={utils.getPageTitle(pathname)}>
14-
<Switch>
15-
{userRouter
16-
.filter((item: any) => !item.isLayout)
17-
.map((item: any, index: number) => (
18-
<Route key={index} path={item.path} component={item.component} exact={item.exact} />
19-
))}
18+
<Col className="container">
19+
<Switch>
20+
{userRouter
21+
.filter((item: any) => !item.isLayout)
22+
.map((item: any, index: number) => (
23+
<Route key={index} path={item.path} component={item.component} exact={item.exact} />
24+
))}
2025

21-
<Redirect from="/user" to="/user/login" />
22-
</Switch>
26+
<Redirect from="/user" to="/user/login" />
27+
</Switch>
28+
<Footer/>
29+
</Col>
2330
</DocumentTitle>
2431
);
2532
}
Lines changed: 69 additions & 0 deletions
Loading

reactjs/src/scenes/Login/index.less

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@import '~antd/lib/style/themes/default.less';
2+
3+
.main {
4+
width: 368px;
5+
margin: 0 auto;
6+
@media screen and (max-width: @screen-sm) {
7+
width: 95%;
8+
}
9+
10+
.icon {
11+
font-size: 24px;
12+
color: rgba(0, 0, 0, 0.2);
13+
margin-left: 16px;
14+
vertical-align: middle;
15+
cursor: pointer;
16+
transition: color 0.3s;
17+
18+
&:hover {
19+
color: @primary-color;
20+
}
21+
}
22+
23+
.other {
24+
text-align: left;
25+
margin-top: 24px;
26+
line-height: 22px;
27+
28+
.register {
29+
float: right;
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)