Skip to content

Commit adf5134

Browse files
committed
Users Activity Responsive Fix
1 parent ff2dc7e commit adf5134

File tree

3 files changed

+82
-39
lines changed

3 files changed

+82
-39
lines changed

src/user/Activity/Activity.js

Lines changed: 59 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import OrgAuth from '../dashboard/Community/components/OrgAuth';
1616
import OrgMaintenance from '../dashboard/Community/components/OrgMaintenance';
1717
import Users from './Users';
1818
import ActivityTimeline from './ActivityTimeline';
19+
import { Mobile, Desktop } from '../../utils/breakpoints';
20+
import { Accordion, Button } from 'react-bootstrap';
1921

2022
class Activity extends Component {
2123
constructor(props) {
@@ -29,7 +31,8 @@ class Activity extends Component {
2931
authentication: false,
3032
maintenance: false,
3133
activity: true,
32-
details: true
34+
details: true,
35+
sidebarOpen: false
3336
},
3437
};
3538
}
@@ -49,41 +52,64 @@ class Activity extends Component {
4952

5053
render() {
5154
const { view } = this.state
52-
55+
const toggleSidebar = () => {
56+
this.setState((prevState) => {
57+
return {
58+
sidebarOpen: !prevState.sidebarOpen
59+
}
60+
})
61+
}
5362
return (
54-
<div className="overall_container">
55-
<div className="main_navigation">
56-
<Navigation orgSettings={this.state.org} user={this.props.user} />
57-
</div>
58-
<div className="org_settings_view">
59-
<div className="main_section">
60-
<div className="left_nav">
61-
<p className="header_text">Community Settings</p>
62-
<LeftNav
63-
data={{
64-
option: this.state.option,
65-
changeOption: this.changeOption.bind(this),
66-
}}
67-
/>
68-
</div>
69-
<div className="right_section">
70-
{view === "profile" ? <OrgProfile /> : null}
71-
{view === "permission" ? <OrgPermission /> : null}
72-
{view === "settings" ? <OrgSettings /> : null}
73-
{view === "authentication" ? <OrgAuth /> : null}
74-
{view === "maintenance" ? <OrgMaintenance /> : null}
75-
{view === "activity" ? (
76-
<Users
77-
handleOption={{ changeOption: this.changeOption.bind(this) }}
78-
/>
79-
) : null}
80-
{view === "details" ? (
81-
<ActivityTimeline />
82-
) : null}
63+
<>
64+
<Navigation orgSettings={this.state.org} user={this.props.user} />
65+
<div className="overall_container">
66+
<div className="org_settings_view">
67+
<div className="main_section">
68+
<div className="left_nav">
69+
<p className="header_text">Community Settings</p>
70+
<Desktop>
71+
<LeftNav
72+
data={{
73+
option: this.state.option,
74+
changeOption: this.changeOption.bind(this),
75+
}}
76+
/>
77+
</Desktop>
78+
<Mobile>
79+
<Accordion>
80+
<Accordion.Toggle onClick={() => toggleSidebar()} variant="outline-secondary" size="sm" as={Button} eventKey="0">
81+
{this.state.sidebarOpen?"Close Menu":"Setting Menu"}
82+
</Accordion.Toggle>
83+
<Accordion.Collapse eventKey="0">
84+
<LeftNav
85+
data={{
86+
option: this.state.option,
87+
changeOption: this.changeOption.bind(this),
88+
}}
89+
/>
90+
</Accordion.Collapse>
91+
</Accordion>
92+
</Mobile>
93+
</div>
94+
<div className="right_section">
95+
{view === "profile" ? <OrgProfile /> : null}
96+
{view === "permission" ? <OrgPermission /> : null}
97+
{view === "settings" ? <OrgSettings /> : null}
98+
{view === "authentication" ? <OrgAuth /> : null}
99+
{view === "maintenance" ? <OrgMaintenance /> : null}
100+
{view === "activity" ? (
101+
<Users
102+
handleOption={{ changeOption: this.changeOption.bind(this) }}
103+
/>
104+
) : null}
105+
{view === "details" ? (
106+
<ActivityTimeline />
107+
) : null}
108+
</div>
83109
</div>
84110
</div>
85111
</div>
86-
</div>
112+
</>
87113
);
88114
}
89115
}
@@ -94,4 +120,4 @@ const mapStateToProps = (state) => ({
94120
post: state.post
95121
})
96122

97-
export default connect(mapStateToProps, { getEventById, getPostById })(withRouter(Activity));
123+
export default connect(mapStateToProps, { getEventById, getPostById })(withRouter(Activity));

src/user/Activity/ActivityTimeline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function ActivityTimeline() {
8989
showSizeChanger
9090
onShowSizeChange={onShowSizeChange}
9191
defaultCurrent={1}
92-
total={500}
92+
total={activity.length}
9393
onChange={handlePagination}
9494
/>
9595
</div>

src/user/Activity/activityTimeline.scss

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,35 @@
1414
}
1515
}
1616
.activities__list {
17-
max-height: 75vh;
18-
overflow-y: auto;
17+
max-height: 100%;
18+
overflow-y: hidden;
1919
width: 75vw;
2020
margin-top: 4px;
2121
overflow-x: hidden;
2222
margin-top: 27px;
2323
display: flex;
2424
flex-direction: row;
2525
flex-wrap: wrap;
26+
padding-top: 1rem;
2627
.pagination__container {
27-
position: fixed;
28-
margin-top: 78vh;
28+
width: 100%;
2929
}
3030
}
31-
}
31+
}
32+
33+
@media (min-width: 320px) and (max-width: 1024px){
34+
.activity__timeline {
35+
margin: 0;
36+
padding-top: 2.5vh;
37+
.activities__list {
38+
max-height: 100%;
39+
overflow: hidden;
40+
width: 75vw;
41+
padding: 2.5vh 0 0 0;
42+
margin: 0 auto;
43+
.pagination__container {
44+
width: 100%;
45+
}
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)