@@ -16,6 +16,8 @@ import OrgAuth from '../dashboard/Community/components/OrgAuth';
1616import OrgMaintenance from '../dashboard/Community/components/OrgMaintenance' ;
1717import Users from './Users' ;
1818import ActivityTimeline from './ActivityTimeline' ;
19+ import { Mobile , Desktop } from '../../utils/breakpoints' ;
20+ import { Accordion , Button } from 'react-bootstrap' ;
1921
2022class 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 ) ) ;
0 commit comments