@@ -9,6 +9,8 @@ import Navigation from '../navigation/navigation'
99import { connect } from 'react-redux'
1010import OrgMaintenance from './components/OrgMaintenance' ;
1111import Users from '../../Activity/Users'
12+ import { Mobile , Desktop } from '../../../utils/breakpoints' ;
13+ import { Accordion , Button } from 'react-bootstrap' ;
1214
1315class CommunitySetting extends Component {
1416 constructor ( props ) {
@@ -20,7 +22,8 @@ class CommunitySetting extends Component {
2022 settings : false ,
2123 permission : false ,
2224 authentication : false ,
23- maintenance : false
25+ maintenance : false ,
26+ sidebarOpen : false
2427 }
2528 } ;
2629 }
@@ -37,36 +40,61 @@ class CommunitySetting extends Component {
3740 }
3841 render ( ) {
3942 const { view } = this . state ;
43+
44+ const toggleSidebar = ( ) => {
45+ this . setState ( ( prevState ) => {
46+ return {
47+ sidebarOpen : ! prevState . sidebarOpen
48+ }
49+ } )
50+ }
4051 return (
41- < div className = "overall_container" >
42- < div className = "main_navigation" >
43- < Navigation orgSettings = { this . state . org } user = { this . props . user } />
44- </ div >
45- < div className = "org_settings_view" >
46- < div className = "main_section" >
47- < div className = "left_nav" >
48- < p className = "header_text" > Community Settings</ p >
49- < LeftNav
50- data = { {
51- option : this . state . option ,
52- changeOption : this . changeOption . bind ( this ) ,
53- } }
54- />
55- </ div >
56- < div className = "right_section" >
57- { view === "profile" ? < OrgProfile /> : null }
58- { view === "permission" ? < OrgPermission /> : null }
59- { view === "settings" ? < OrgSetting /> : null }
60- { view === "authentication" ? < OrgAuth /> : null }
61- { view === "maintenance" ? < OrgMaintenance /> : null }
62- { view === "activity" ? (
63- < Users
64- handleOption = { { changeOption : this . changeOption . bind ( this ) } }
65- /> ) : null }
52+ < >
53+ < Navigation orgSettings = { this . state . org } user = { this . props . user } />
54+ < div className = "overall_container" >
55+ < div className = "org_settings_view" >
56+ < div className = "main_section" >
57+ < div className = "left_nav" >
58+ < p className = "header_text" > Community Settings</ p >
59+ < Desktop >
60+ < LeftNav
61+ data = { {
62+ option : this . state . option ,
63+ changeOption : this . changeOption . bind ( this ) ,
64+ } }
65+ />
66+ </ Desktop >
67+ < Mobile >
68+ < Accordion >
69+ < Accordion . Toggle onClick = { ( ) => toggleSidebar ( ) } variant = "outline-secondary" size = "sm" as = { Button } eventKey = "0" >
70+ { this . state . sidebarOpen ?"Close Menu" :"Setting Menu" }
71+ </ Accordion . Toggle >
72+ < Accordion . Collapse eventKey = "0" >
73+ < LeftNav
74+ data = { {
75+ option : this . state . option ,
76+ changeOption : this . changeOption . bind ( this ) ,
77+ } }
78+ />
79+ </ Accordion . Collapse >
80+ </ Accordion >
81+ </ Mobile >
82+ </ div >
83+ < div className = "right_section" >
84+ { view === "profile" ? < OrgProfile /> : null }
85+ { view === "permission" ? < OrgPermission /> : null }
86+ { view === "settings" ? < OrgSetting /> : null }
87+ { view === "authentication" ? < OrgAuth /> : null }
88+ { view === "maintenance" ? < OrgMaintenance /> : null }
89+ { view === "activity" ? (
90+ < Users
91+ handleOption = { { changeOption : this . changeOption . bind ( this ) } }
92+ /> ) : null }
93+ </ div >
6694 </ div >
6795 </ div >
6896 </ div >
69- </ div >
97+ </ >
7098 ) ;
7199 }
72100}
@@ -77,4 +105,4 @@ const mapStateToProps = (state) => ({
77105 user : state . user ,
78106 org : state . org
79107} )
80- export default connect ( mapStateToProps ) ( CommunitySetting ) ;
108+ export default connect ( mapStateToProps ) ( CommunitySetting ) ;
0 commit comments