Skip to content

Commit b55bcc4

Browse files
committed
Desktop design
1 parent 4974c47 commit b55bcc4

File tree

27 files changed

+295
-15
lines changed

27 files changed

+295
-15
lines changed

dev-tools/webpack/webpack.config.dev.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dllDepPath = path.resolve(dllPath, 'fibookDeps.dll.js')
1616

1717
exports.context = APP_PATH
1818
exports.devtool = 'source-map'
19+
exports.mode = 'development'
1920

2021
exports.entry = [
2122
'webpack-hot-middleware/client'

src/components/List.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const s = require('./style/list.css')
44

55
interface Props {
66
empty?: JSX.Element
7-
noBorder?: boolean
7+
strong?: boolean
88
}
99

1010
export default class List extends React.PureComponent<Props> {
@@ -13,7 +13,7 @@ export default class List extends React.PureComponent<Props> {
1313
return this.props.empty
1414
}
1515

16-
const className = this.props.noBorder ? `${s.list} ${s.noBorder}` : s.list
16+
const className = this.props.strong ? `${s.list} ${s.strong}` : s.list
1717

1818
return (
1919
<div className={className}>

src/components/Page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface Props {
1111
fixed?: React.ReactNode
1212
tabs?: TabData[]
1313
shadow?: boolean
14+
tabsTop?: boolean
1415
}
1516

1617
interface State {
@@ -35,6 +36,9 @@ export default class Page extends React.PureComponent<Props> {
3536
if (this.props.shadow) {
3637
className = `${className} ${s.shadow}`
3738
}
39+
if (this.props.tabsTop) {
40+
className = `${className} ${s.tabsTop}`
41+
}
3842

3943
return (
4044
<div className={className} data-page={this.props.name}>

src/components/Tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class Tabs extends React.PureComponent<Props> {
2424
const tab = this.props.data[active]
2525

2626
return (
27-
<Page shadow name={this.props.name} tabbar={map(this.props.data, this.renderButton)} fixed={tab.fixed}>
27+
<Page shadow tabsTop name={this.props.name} tabbar={map(this.props.data, this.renderButton)} fixed={tab.fixed}>
2828
{map(this.props.data, this.renderTab)}
2929
</Page>
3030
)

src/components/Toolbar.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { withRouter } = require('react-router')
44

55
const s = require('./style/toolbar.css')
66
const svg = require('./style/ios-arrow-back.svg')
7+
const close = require('./style/close.svg')
78

89
interface Props {
910
title: React.ReactNode
@@ -23,6 +24,11 @@ export default class Toolbar extends React.PureComponent<Props> {
2324
</div>
2425
}
2526
<div className={s.title}>{this.props.title}</div>
27+
{this.props.backButton &&
28+
<div className={s.closeButton} onClick={this.goBack}>
29+
<InlineSVG src={close}/>
30+
</div>
31+
}
2632
</div>
2733
)
2834
}

src/components/style/button.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
text-align: center;
1212
}
1313

14+
.wrapper:hover {
15+
opacity: 0.7;
16+
}
17+
1418
.wrapper:active {
1519
color: white;
1620
background-color: var(--blue);

src/components/style/close.svg

Lines changed: 3 additions & 0 deletions
Loading

src/components/style/fileInput.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,19 @@
3333
top: 0;
3434
left: 0;
3535
}
36+
37+
@media (min-width: 800px) {
38+
.wrapper {
39+
box-shadow: none;
40+
background: none;
41+
opacity: 0.5;
42+
border-radius: 5px;
43+
transition: opacity 100ms ease-in;
44+
}
45+
46+
.wrapper:hover {
47+
opacity: 1;
48+
cursor: pointer;
49+
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);;
50+
}
51+
}

src/components/style/list.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
.list {
22
background: transparent;
3-
border-bottom: var(--border);
43
overflow: hidden;
54
-webkit-overflow-scrolling: touch;
65
}
76

8-
.no-border {
9-
border-bottom: none;
7+
@media (min-width: 800px) {
8+
.list:not(.strong) {
9+
display: flex;
10+
flex-direction: row;
11+
flex-wrap: wrap;
12+
}
1013
}

src/components/style/listItem.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,39 @@
6666
color: var(--darkGrey);
6767
font-size: var(--fontS);
6868
}
69+
70+
@media (min-width: 800px) {
71+
.listItem:not(.small) {
72+
flex-direction: column;
73+
align-items: center;
74+
}
75+
76+
.listItem:not(.small):hover {
77+
opacity: 0.7;
78+
}
79+
80+
.thumbnail {
81+
width: 94px;
82+
height: 144px;
83+
}
84+
85+
.left {
86+
margin-right: 0;
87+
}
88+
89+
.listItem:not(.small) .center {
90+
border-bottom: none;
91+
align-items: center;
92+
width: 94px;
93+
text-align: center;
94+
font-size: var(--fontS);
95+
}
96+
97+
.subtitle {
98+
font-size: var(--fontXS);
99+
}
100+
101+
.listItem:last-child {
102+
padding-bottom: 0;
103+
}
104+
}

src/components/style/listTab.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@
33
height: 84px;
44
line-height: 84px;
55
text-align: center;
6+
cursor: pointer;
67
}
78

89
.spinner {
910
margin-top: 14px;
1011
margin-bottom: 13px;
1112
text-align: center;
13+
width: 100%;
14+
}
15+
16+
@media (min-width: 800px) {
17+
.loadMore {
18+
height: 40px;
19+
line-height: 40px;
20+
width: 100%;
21+
}
1222
}

src/components/style/loading.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
}
99

1010
.loading i {
11-
width: 20vw;
11+
width: 50px;
1212
}

src/components/style/modal.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,18 @@
6262
}
6363

6464
.button {
65+
cursor: pointer;
6566
border-left: var(--border);
6667
height: 44px;
6768
line-height: 44px;
6869
text-align: center;
6970
width: 100%;
7071
}
7172

73+
.button:hover {
74+
opacity: 0.5;
75+
}
76+
7277
.button:first-child {
7378
border: none;
7479
}

src/components/style/page.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,39 @@
6969
:global(.toolbar) .content {
7070
top: 44px;
7171
}
72+
73+
@media (min-width: 800px) {
74+
.page {
75+
position: relative;
76+
flex: 1;
77+
width: 602px;
78+
padding-top: 40px;
79+
padding-bottom: 5px;
80+
}
81+
82+
.content {
83+
position: static;
84+
max-height: 540px;
85+
}
86+
87+
.toolbar {
88+
border-bottom: none;
89+
background: none;
90+
}
91+
92+
.tabs {
93+
background: none;
94+
height: 40px;
95+
}
96+
97+
.tabs-top .tabs {
98+
top: 0;
99+
bottom: initial;
100+
height: 38px;
101+
justify-content: flex-start;
102+
align-items: flex-end;
103+
left: 15px;
104+
box-shadow: none !important;
105+
border-bottom: 1px solid #E9E9E9
106+
}
107+
}

src/components/style/tabs.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,40 @@
5959
.button-active {
6060
color: var(--blue);
6161
}
62+
63+
.button:not(.button-active) {
64+
cursor: pointer;
65+
}
66+
67+
@media (min-width: 800px) {
68+
.tab-left,
69+
.tab-right,
70+
.tab-active {
71+
position: static;
72+
display: none;
73+
transition: none;
74+
width: auto;
75+
}
76+
.tab-active {
77+
display: block;
78+
}
79+
80+
.icon {
81+
display: none;
82+
}
83+
84+
.button, .button-active {
85+
font-size: var(--fontM);
86+
width: auto;
87+
height: auto;
88+
padding-top: 15px;
89+
padding-bottom: 5px;
90+
margin-right: 15px;
91+
border-bottom: 1px solid white;
92+
color: black;
93+
}
94+
95+
.button-active {
96+
border-bottom-color: #F9973C;
97+
}
98+
}

src/components/style/toolbar.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.wrapper {
2+
position: relative;
23
align-items: center;
34
display: flex;
45
flex-direction: row;
@@ -18,6 +19,11 @@
1819
display: flex;
1920
position: absolute;
2021
left: 0;
22+
cursor: pointer;
23+
}
24+
25+
.back-button:hover {
26+
opacity: 0.7;
2127
}
2228

2329
.icon {
@@ -28,3 +34,30 @@
2834
height: 32px;
2935
fill: var(--blue);
3036
}
37+
38+
.close-button {
39+
display: none;
40+
position: absolute;
41+
right: 5px;
42+
top: -8px;
43+
cursor: pointer;
44+
}
45+
46+
.close-button :hover {
47+
opacity: 0.7;
48+
}
49+
50+
.close-button svg {
51+
height: 10px;
52+
fill: black;
53+
}
54+
55+
@media (min-width: 800px) {
56+
.title, .back-button {
57+
display: none;
58+
}
59+
60+
.close-button {
61+
display: block;
62+
}
63+
}

src/containers/Root/Root.dev.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as React from 'react'
22
import Routes from 'routes'
3-
const DevTools = require('mobx-react-devtools').default
43

54

65
/**
@@ -9,7 +8,6 @@ const DevTools = require('mobx-react-devtools').default
98
const Root = () => (
109
<div>
1110
<Routes />
12-
<DevTools position={{top: 50, right: 0}}/>
1311
</div>
1412
)
1513

src/pages/BookPage/components/BookDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class BookDetails extends React.PureComponent<Props> {
2222
}
2323

2424
return (
25-
<List noBorder>
25+
<List strong>
2626
<ListItem small center="Автор" right={author}/>
2727
<ListItem small center="Название" right={title}/>
2828
<ListItem small center="Статус" right={Status}/>

src/pages/BookPage/components/BookPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class BookPage extends React.Component<ContainerProps> {
2222
render() {
2323
if (this.props.fetching) {
2424
return (
25-
<Page name="book" toolbar={this.renderToolbar()}>
25+
<Page name="book" className={s.bookPage} toolbar={this.renderToolbar()}>
2626
<Loading />
2727
</Page>
2828
);
@@ -32,6 +32,7 @@ export class BookPage extends React.Component<ContainerProps> {
3232
return (
3333
<Page
3434
name="book"
35+
className={s.bookPage}
3536
toolbar={this.renderToolbar()}
3637
tabbar={this.renderBottomToolbar()}
3738
>

src/pages/BookPage/components/style/bookPage.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@
1111
margin: 15px;
1212
text-align: center;
1313
}
14+
15+
@media (min-width: 800px) {
16+
.book-page {
17+
width: 310px;
18+
flex: none;
19+
padding-top: 10px;
20+
padding-bottom: 40px;
21+
border-left: 1px solid #E9E9E9;
22+
}
23+
}

0 commit comments

Comments
 (0)