Skip to content

Commit ad48e27

Browse files
dongruisunnywx
authored andcommitted
fix: User portal style issues (#796)
* fix: Home page style * fix: Header nav active link style
1 parent fb62494 commit ad48e27

File tree

31 files changed

+329
-223
lines changed

31 files changed

+329
-223
lines changed

public/op-logo.svg

Lines changed: 6 additions & 0 deletions
Loading

server/routes/page.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ router.get('/logout', ctx => {
2222
'username',
2323
'user_id',
2424
'role',
25+
'portal',
2526
'email',
2627
'login_time',
2728
'changedRole',

src/components/AppList/index.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
@import '~scss/vars';
22

33
.appList {
4-
position: relative;
54
overflow: hidden;
65
_zoom: 1;
7-
top: 30px;
86

97
> div {
108
&:nth-child(3n+4) {
@@ -18,4 +16,4 @@
1816
font-size: 12px;
1917
color: $N75;
2018
}
21-
}
19+
}

src/components/Banner/index.jsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
33
import classnames from 'classnames';
44
import { translate } from 'react-i18next';
5-
import { inject, observer } from 'mobx-react';
5+
import { observer, inject } from 'mobx-react';
66

77
import { Image } from 'components/Base';
88
import SearchBox from 'pages/Home/SearchBox';
@@ -11,7 +11,9 @@ import { getPortalFromPath } from 'routes';
1111
import styles from './index.scss';
1212

1313
@translate()
14-
@inject('rootStore')
14+
@inject(({ rootStore }) => ({
15+
user: rootStore.user
16+
}))
1517
@observer
1618
export default class Banner extends Component {
1719
static propTypes = {
@@ -42,22 +44,26 @@ export default class Banner extends Component {
4244
className,
4345
stretch,
4446
shrink,
45-
rootStore,
47+
user,
4648
t
4749
} = this.props;
4850

4951
if (!['', 'user'].includes(getPortalFromPath())) {
5052
return null;
5153
}
5254

55+
const titleShow = user.isLoggedIn()
56+
? `${t('QingCloud App Center')} - ${t(title)}`
57+
: t(title);
58+
5359
return (
5460
<div
5561
className={classnames(
5662
'banner',
5763
styles.banner,
5864
{
5965
[styles.stretch]: stretch,
60-
[styles.shrink]: shrink || rootStore.fixNav
66+
[styles.shrink]: shrink
6167
},
6268
className
6369
)}
@@ -69,7 +75,7 @@ export default class Banner extends Component {
6975
<Image src={icon} iconSize={48} iconLetter={title} />
7076
</span>
7177
)}
72-
<div className={styles.name}>{t(title)}</div>
78+
<div className={styles.name}>{titleShow}</div>
7379
<div className={styles.description}>{t(description)}</div>
7480
</div>
7581

src/components/Banner/index.scss

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,41 @@ $speed: 0.2s;
77
width: 100%;
88
z-index: 2;
99
top: $header-height;
10-
padding: 30px 0;
1110
background-color: $N500;
1211
transition: all $speed ease-in-out;
1312

1413
&.stretch {
15-
padding: 64px 0;
14+
height: $search-banner-height;
15+
.wrapper {
16+
padding: 68px 0;
17+
height: $search-banner-height;
18+
}
1619
.search {
20+
transition: all $speed ease-in-out;
1721
float: none;
18-
top: 0;
22+
bottom: 0;
1923
}
2024
}
2125

2226
&.shrink {
23-
padding: 30px 0 !important;
27+
height: $title-banner-height;
28+
2429
.search {
2530
transition: all $speed ease-in-out;
2631
float: right;
27-
top: -15px;
32+
bottom: 10px;
2833
}
2934
}
3035

3136
.wrapper {
3237
width: $content-width;
3338
margin: 0 auto;
39+
padding: 28px 0;
40+
height: $title-banner-height;
3441

3542
.words {
3643
display: inline-block;
44+
height: 52px;
3745
}
3846
}
3947

@@ -63,10 +71,9 @@ $speed: 0.2s;
6371
}
6472

6573
.name {
66-
margin-bottom: 4px;
6774
font-size: 20px;
6875
font-weight: 500;
69-
line-height: 24px;
76+
line-height: 32px;
7077
letter-spacing: 0;
7178
color: $N0;
7279
}
@@ -115,4 +122,4 @@ $speed: 0.2s;
115122
}
116123
}
117124
}
118-
}
125+
}

src/components/Base/Popover/index.scss

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,28 @@
117117
}
118118
}
119119

120-
:global(.operate-menu) {
121-
a {
122-
color: $N300;
123-
}
124-
li,a,span {
125-
display: block;
126-
min-width: 105px;
127-
padding: 0 12px;
128-
height: 32px;
129-
font-size: 12px;
130-
line-height: 32px;
131-
color: $N300;
132-
background-color: $N0;
133-
cursor: pointer;
134-
transition: all $transition-speed;
135-
&:hover {
136-
color: $N500;
137-
background-color: $N10;
120+
:global{
121+
.operate-menu {
122+
a {
123+
color: $N300;
124+
}
125+
126+
>li,>a,>span {
127+
display: block;
128+
min-width: 105px;
129+
padding: 0 12px;
130+
height: 32px;
131+
font-size: 12px;
132+
line-height: 32px;
133+
color: $N300;
134+
background-color: $N0;
135+
cursor: pointer;
136+
transition: all $transition-speed;
137+
138+
&:hover {
139+
color: $N500;
140+
background-color: $N10;
141+
}
138142
}
139143

140144
.icon {
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
@import '~scss/vars';
22

3-
.title{
4-
padding-bottom: 12px;
5-
line-height: 1.25;
6-
font-size: $font16;
7-
font-weight: bold;
8-
color: $N500;
9-
.more{
3+
.title {
4+
@include title-font($font-size: 16px);
5+
margin: 32px 0 12px;
6+
7+
.more {
108
display: none;
119
float: right;
1210
font-size: 12px;
1311
font-weight: normal;
1412
cursor: pointer;
1513
@include moreText();
1614
}
17-
.show{
15+
.show {
1816
display: inline-block;
1917
}
2018
}

src/components/Card/index.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ $card-height: 208px;
77
float: left;
88
display: inline-block;
99
position: relative;
10-
width: $card-width;
10+
width: calc(33.3% - 13.3px);
1111
height: $card-height;
1212
padding: 32px 44px;
13-
margin: 0 24px 24px 0;
13+
margin: 0 20px 20px 0;
1414
border-radius: 2px;
1515
border: 1px solid $N0;
1616
background-color: $N0;
1717
transition: all .3s ease-in-out;
18-
text-align: center;
1918
box-shadow: 0 1px 4px 0 rgba(73, 33, 173, 0.06), 0 4px 8px 0 rgba(35, 35, 36, 0.04);
2019
cursor: pointer;
2120
overflow: hidden;
@@ -27,11 +26,15 @@ $card-height: 208px;
2726
margin: 0 auto 12px;
2827
transition:all 0.3s ease;
2928
position: relative;
29+
30+
img {
31+
border-radius: 3px;
32+
}
3033
}
3134
.name {
32-
font-family: Roboto sans-serif;
3335
font-size: 14px;
34-
color: #343945;
36+
color: $N500;
37+
font-weight: 500;
3538
text-align: center;
3639
line-height: 28px;
3740
margin-bottom: 8px;

src/components/DetailTabs/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class DetailTabs extends Component {
2929
const firstTab = props.tabs[0];
3030
this.state = {
3131
curTab:
32-
props.defaultTab || _.isObject(firstTab) ? firstTab.value : firstTab
32+
props.defaultTab || (_.isObject(firstTab) ? firstTab.value : firstTab)
3333
};
3434
}
3535

src/components/DetailTabs/index.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@
3232

3333
.accountTabs {
3434
padding: 0;
35-
height: 41px;
35+
height: 32px;
3636
background-color: $N500;
3737
border-bottom: 0 none;
3838

3939
>label {
40-
padding: 12px 0;
40+
margin-right: 40px;
41+
line-height: 20px;
42+
padding: 0 0 11px 0;
4143
color: $N30;
44+
border-bottom: 1px solid transparent;
4245

4346
&.active {
4447
color: $N0;

0 commit comments

Comments
 (0)