Skip to content

Commit 9c3c104

Browse files
Merge pull request #3 from flatlogic/new_version_improvements
fix(Grid) css update, fix(Widgets) css, fix(Widget) loading state
2 parents fd65fae + 42d4a79 commit 9c3c104

File tree

31 files changed

+115
-109
lines changed

31 files changed

+115
-109
lines changed

src/components/Header/Header.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class Header extends React.Component {
157157

158158
</Nav>
159159

160-
<Form className="d-sm-down-none ml-5" inline>
160+
<Form className={`d-sm-down-none ml-5 ${s.headerSearchInput}`} inline>
161161
<FormGroup>
162162
<InputGroup onFocus={this.toggleFocus} onBlur={this.toggleFocus} className={
163163
cx('input-group-no-border', {'focus' : !!focus})
@@ -190,7 +190,7 @@ class Header extends React.Component {
190190
<span>{firstUserLetter}</span>
191191
)}
192192
</span>
193-
<span className="small">{user.name || user.email || "Philip smith"}</span>
193+
<span className={`small ${this.props.sidebarStatic ? s.adminEmail : ''}`}>{user.name || user.email || "Philip smith"}</span>
194194
<span className="ml-1 circle bg-warning text-white fw-bold">13</span>
195195
</DropdownToggle>
196196
<DropdownMenu right className={`${s.notificationsWrapper} py-0 animated animated-fast fadeInUp`}>
@@ -202,10 +202,10 @@ class Header extends React.Component {
202202
<i className="la la-cog" />
203203
</DropdownToggle>
204204
<DropdownMenu right className="super-colors">
205-
<DropdownItem><i className="la la-user" /> My Account</DropdownItem>
205+
<DropdownItem href="/#/app/profile"><i className="la la-user" /> My Account</DropdownItem>
206206
<DropdownItem divider />
207-
<DropdownItem href="/calendar">Calendar</DropdownItem>
208-
<DropdownItem href="/inbox">Inbox &nbsp;&nbsp;<Badge color="danger" pill className="animated bounceIn">9</Badge></DropdownItem>
207+
<DropdownItem href="/#/app/extra/calendar">Calendar</DropdownItem>
208+
<DropdownItem href="/#/app/inbox">Inbox &nbsp;&nbsp;<Badge color="danger" pill className="animated bounceIn">9</Badge></DropdownItem>
209209
<DropdownItem divider />
210210
<DropdownItem onClick={this.doLogout}><i className="la la-sign-out" /> Log Out</DropdownItem>
211211
</DropdownMenu>
@@ -232,7 +232,8 @@ class Header extends React.Component {
232232
</div>
233233
</NavItem>
234234
<NavItem className="fs-lg d-md-none">
235-
<NavLink href="#" onClick={this.props.chatToggle}>
235+
<NavLink href="#" onClick={this.toggleChat}>
236+
<i className={`chat-notification-sing ${this.props.chatSidebar ? 'hide' : ''}`}></i>
236237
<span className="rounded rounded-lg bg-gray text-white"><i className="la la-globe" /></span>
237238
</NavLink>
238239
</NavItem>

src/components/Header/Header.module.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,17 @@
156156
opacity: 1;
157157
pointer-events: initial;
158158
}
159+
@media(max-width: 1020px) {
160+
.headerSearchInput {
161+
margin-left: 0!important;
162+
}
163+
}
164+
165+
@media(max-width: 950px) {
166+
.adminEmail {
167+
display: none;
168+
}
169+
.headerSearchInput {
170+
width: 180px;
171+
}
172+
}

src/components/Widget/Widget.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class Widget extends React.Component {
190190
<section
191191
style={{display: hideWidget ? 'none' : ''}}
192192
className={
193-
classNames('widget', {'fullscreened' : !!fullscreened, 'collapsed' : !!collapseWidget}, s.widget, className, reloading ? s.reloading : '')
193+
classNames('widget', {'fullscreened' : !!fullscreened, 'collapsed' : !!collapseWidget}, s.widget, className, (reloading || fetchingData) ? s.reloading : '')
194194
} {...attributes}
195195
>
196196
{
@@ -327,10 +327,8 @@ class Widget extends React.Component {
327327
}
328328
<AnimateHeight
329329
duration={ 500 }
330-
height={ height } // see props documentation bellow
330+
height={ height }
331331
>
332-
333-
334332
<div className={`${s.widgetBody} widget-body ${bodyClass}`}>
335333
{reloading || fetchingData ? <Loader className={s.widgetLoader} size={40}/> : customBody ? (
336334
<div className="jumbotron handle bg-gray text-white mb-0">

src/components/Widget/Widget.module.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@
108108
}
109109

110110
:global {
111-
.reset-padding {
112-
padding: 15px 0 0;
113-
}
114111
.loader {
115112
position: absolute;
116113
top: 0;
@@ -128,7 +125,7 @@
128125
}
129126
}
130127

131-
.widget-body.p-0 {
128+
.widget-body.undo_padding {
132129
margin: $widget-padding-vertical (-$widget-padding-horizontal) (-$widget-padding-vertical);
133130

134131
+ footer {

src/pages/analytics/Analitycs.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,4 @@
5959

6060
:global .legendColorBox div {
6161
border-radius: 50%;
62-
}
63-
64-
.resetPadding {
65-
padding: 0;
6662
}

src/pages/analytics/Analytics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class Analytics extends Component {
260260
<Col xs={12} className="mb-lg">
261261
<Widget
262262
className="pb-0"
263-
bodyClass={`mt ${s.resetPadding}`}
263+
bodyClass={`mt p-0`}
264264
title={<h4> Support <strong>Requests</strong></h4>}
265265
close settings
266266
>

src/pages/analytics/components/BigStat/BigStat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class BigStat extends Component {
3939
<div className="pb-xlg h-100">
4040
<Widget
4141
className="mb-0 h-100"
42-
bodyClass={`mt ${s.resetPadding}`}
42+
bodyClass={`mt p-0`}
4343
title={
4444
<div className="d-flex justify-content-between flex-wrap">
4545
<h4 className={cx('d-flex align-items-center pb-1', s.bigStatTitle)}>

src/pages/analytics/components/BigStat/BigStat.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,4 @@
2121
}
2222
}
2323
}
24-
}
25-
26-
.resetPadding {
27-
padding: 0;
2824
}

src/pages/charts/apex/Apex.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
BreadcrumbItem,
77
} from 'reactstrap';
88
import ApexChart from 'react-apexcharts';
9+
import './ApexChart.module.scss';
910
import Widget from '../../../components/Widget';
1011
import chartsData from './mock';
1112

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:global {
2+
.apexcharts-menu-item {
3+
white-space: nowrap;
4+
}
5+
}

src/pages/dashboard/Dashboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class Dashboard extends React.Component {
240240
title={<h6><span className="badge badge-danger">New</span> Messages</h6>}
241241
refresh close
242242
>
243-
<div className="widget-body p-0">
243+
<div className="widget-body undo_padding">
244244
<div className="list-group list-group-lg">
245245
<button className="list-group-item text-left">
246246
<span className="thumb-sm float-left mr">
@@ -366,7 +366,7 @@ class Dashboard extends React.Component {
366366
</Col>
367367

368368
<Col lg={4} xs={12}>
369-
<Widget title={<h6>Calendar</h6>} settings close bodyClass={s.resetPadding}>
369+
<Widget title={<h6>Calendar</h6>} settings close bodyClass={"pt-2 px-0 py-0"}>
370370
<Calendar />
371371
<div className="list-group fs-mini">
372372
<button className="list-group-item text-ellipsis">

src/pages/dashboard/Dashboard.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,3 @@
2121
}
2222
}
2323
}
24-
25-
.resetPadding {
26-
padding: 15px 0 0;
27-
}

src/pages/dashboard/components/calendar/Calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class Calendar extends Component {
9999

100100
return (
101101
<div className={`${s.calendarRectangle}`}>
102-
<div className={`${s.calendarContent}`}>
102+
<div>
103103
<section className={`${s.mainCalendar}`}>
104104
<header className={`${s.calendarHeader}`}>
105105
<div className={`${s.calendarRow} ${s.titleHeader}`}>

src/pages/dashboard/components/rickshaw/Rickshaw.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import Rickshaw from 'rickshaw';
33
import PropTypes from 'prop-types';
4-
4+
import { connect } from 'react-redux';
55

66
class RickshawGraph extends React.Component {
77

@@ -27,6 +27,12 @@ class RickshawGraph extends React.Component {
2727
window.addEventListener('resize', this.onResizeRickshaw);
2828
}
2929

30+
componentDidUpdate(prevProps) {
31+
if (this.props.sidebarStatic !== prevProps.sidebarStatic) {
32+
this.onResizeRickshaw()
33+
}
34+
}
35+
3036
componentWillUnmount() {
3137
window.removeEventListener('resize', this.onResizeRickshaw);
3238
}
@@ -87,4 +93,10 @@ class RickshawGraph extends React.Component {
8793
}
8894
}
8995

90-
export default RickshawGraph;
96+
function mapStateToProps(store) {
97+
return {
98+
sidebarStatic: store.navigation.sidebarStatic,
99+
};
100+
}
101+
102+
export default connect(mapStateToProps)(RickshawGraph);

src/pages/email/components/MessageTableHeader/MessageTableHeader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const MessageTableHeader = (props) => {
6363
</DropdownMenu>
6464
</UncontrolledButtonDropdown>
6565
</div>
66-
<Input placeholder="Search Messages" size="sm" onChange={e => search(e.target.value)} />
66+
<Input placeholder="Search Messages" bsSize="sm" onChange={e => search(e.target.value)} />
6767
</div>
6868
);
6969
};

src/pages/extra/invoice/Invoice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Stats extends React.Component {
2424
<Col lg={11}>
2525
<Row className={s.root}>
2626
<Col xs={12}>
27-
<Widget bodyClass={s.resetPadding}>
27+
<Widget bodyClass={"p-0"}>
2828
<div className="widget">
2929
<header>
3030
<Row>

src/pages/extra/invoice/Invoice.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@
1414
padding: 10px 20px;
1515
}
1616
}
17-
}
18-
19-
.resetPadding {
20-
padding: 0;
2117
}

src/pages/extra/timeline/Timeline.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Timeline extends React.Component {
102102
<img className="rounded-circle" src={avatar} alt="..." />
103103
</span>
104104
<div className={s.commentBody}>
105-
<Input size="sm" placeholder="Write your comment..." />
105+
<Input bsSize="sm" placeholder="Write your comment..." />
106106
</div>
107107
</li>
108108
</ul>
@@ -198,7 +198,7 @@ class Timeline extends React.Component {
198198
<img className="rounded-circle" src={avatar} alt="..." />
199199
</span>
200200
<div className={s.commentBody}>
201-
<Input size="sm" placeholder="Write your comment..." />
201+
<Input bsSize="sm" placeholder="Write your comment..." />
202202
</div>
203203
</li>
204204
</ul>

src/pages/grid/Grid.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import Sortable from 'react-sortablejs'
1111

1212
import Widget from '../../components/Widget';
13-
import './Grid.scss';
13+
import s from './Grid.module.scss';
1414

1515
import mock from './mock';
1616

@@ -105,7 +105,7 @@ class Grid extends React.Component {
105105
widgetType="shares"
106106
prompt={true}
107107
className="shares-widget"
108-
bodyClass={"reset-padding"}
108+
bodyClass={"pt-3 px-0 py-0"}
109109
showTooltip tooltipPlacement={tooltipPlacement}
110110
title={<h6>
111111
<span className="badge badge-primary"><i className="fa fa-facebook" /></span> &nbsp;
@@ -206,6 +206,7 @@ class Grid extends React.Component {
206206
customCollapse={true}
207207
customFullscreen={true}
208208
customReload={true}
209+
bodyClass={"pt-3 px-0 py-0"}
209210
>
210211
<ul className={'news-list stretchable'}>
211212
{this.state.gridData.news.map(item => (
@@ -241,15 +242,14 @@ class Grid extends React.Component {
241242
Bruce Lee
242243
</footer>
243244
</blockquote>
244-
<p>To make a widget initially collapsed just add
245-
<code>data-widgster-collapsed=&quot;true&quot;</code> attribute
245+
<p>To make a widget initially collapsed just add <code>collapsed</code> property
246246
to <code>.widget</code>.</p>
247247
<p>To make it locked (prevent dragging) add <code>.locked</code> class.</p>
248248
</div>
249249
</Widget>
250250

251251
<Widget
252-
className="custom-gray-bg"
252+
className={s.customGrayBg}
253253
customBody={true}
254254
>
255255
</Widget>

src/pages/grid/Grid.scss renamed to src/pages/grid/Grid.module.scss

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121

2222
&:last-child {
23-
margin-bottom: -10px;
23+
margin-bottom: 0px;
2424
}
2525
}
2626

@@ -60,52 +60,6 @@
6060
}
6161
}
6262

63-
.react-grid-layout {
64-
position: relative;
65-
width: 100%;
66-
transition: height 200ms ease;
67-
}
68-
.react-grid-item {
69-
transition: all 200ms ease;
70-
transition-property: left, top;
71-
}
72-
.react-grid-item.cssTransforms {
73-
transition-property: transform;
74-
}
75-
.react-grid-item.resizing {
76-
z-index: 1;
77-
will-change: width, height;
78-
}
79-
80-
.react-grid-item.react-draggable-dragging {
81-
transition: none;
82-
z-index: 3;
83-
will-change: transform;
84-
}
85-
86-
.react-grid-item.dropping {
87-
visibility: hidden;
88-
}
89-
90-
.react-grid-item > .react-resizable-handle {
91-
position: absolute;
92-
width: 20px;
93-
height: 20px;
94-
bottom: 0;
95-
right: 0;
96-
cursor: se-resize;
97-
}
98-
99-
.react-grid-item > .react-resizable-handle::after {
100-
content: "";
101-
position: absolute;
102-
right: 3px;
103-
bottom: 3px;
104-
width: 5px;
105-
height: 5px;
106-
border-right: 2px solid rgba(0, 0, 0, 0.4);
107-
border-bottom: 2px solid rgba(0, 0, 0, 0.4);
108-
}
10963

11064
/* SHARES LIST */
11165
:global {
@@ -121,6 +75,6 @@
12175
}
12276
}
12377

124-
.custom-gray-bg {
125-
background-color: #495057;
78+
.customGrayBg {
79+
background-color: $gray-700;
12680
}

src/pages/product/components/Description/Description.module.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@
9898
button {
9999
color: $gray-500;
100100
width: 100%;
101+
background: transparent;
102+
border: none;
101103
}
102104
}
103105

0 commit comments

Comments
 (0)