|
1 | 1 | import React from 'react' |
2 | 2 | import * as XLSX from 'xlsx'; |
3 | 3 | import moment from 'moment' |
| 4 | +import Split from 'react-split'; |
| 5 | + |
4 | 6 | import { useParams, useHistory } from 'react-router-dom' |
5 | 7 |
|
6 | 8 | import Paper from '@mui/material/Paper' |
@@ -89,6 +91,7 @@ import Candidates from './Candidates' |
89 | 91 | import SearchCandidates from './SearchCandidates' |
90 | 92 |
|
91 | 93 | import './MapProject.scss' |
| 94 | +import '../common/ResizablePanel.scss' |
92 | 95 |
|
93 | 96 | const MapProject = () => { |
94 | 97 | const { toggles, setAlert: baseSetAlert } = React.useContext(OperationsContext); |
@@ -1008,17 +1011,32 @@ const MapProject = () => { |
1008 | 1011 |
|
1009 | 1012 | return ( |
1010 | 1013 | <div className='col-xs-12 padding-0' style={{borderRadius: '10px', width: 'calc(100vw - 32px)'}}> |
1011 | | - <Paper component="div" className={isSplitView ? 'col-xs-6 split padding-0' : 'col-xs-12 split padding-0'} sx={{boxShadow: 'none', p: 0, backgroundColor: 'white', borderRadius: '10px', border: 'solid 0.3px', borderColor: 'surface.nv80', minHeight: 'calc(100vh - 100px) !important'}}> |
1012 | | - <Paper component="div" className='col-xs-12' sx={{backgroundColor: 'surface.main', boxShadow: 'none', padding: '4px 16px 8px 16px', borderRadius: '10px 10px 0 0', ...((isConfigureInSplitView || !configure) ? {} : {height: 'calc(100vh - 125px) !important', overflow: 'auto'})}}> |
1013 | | - { |
1014 | | - configure && !file?.name && |
1015 | | - <div className='col-xs-8 padding-0'> |
1016 | | - <ConfigurationForm |
1017 | | - project={project} |
1018 | | - handleFileUpload={handleFileUpload} |
1019 | | - file={file} |
1020 | | - owner={owner} |
1021 | | - setOwner={setOwner} |
| 1014 | + <Split |
| 1015 | + sizes={isSplitView ? [50, 50] : [100, 0]} // initial % widths |
| 1016 | + minSize={isSplitView ? 200 : 1000} |
| 1017 | + expandToMin={false} |
| 1018 | + gutterSize={isSplitView ? 6 : 0} |
| 1019 | + snapOffset={0} |
| 1020 | + direction="horizontal" |
| 1021 | + cursor="col-resize" |
| 1022 | + style={{ display: 'flex', height: 'calc(100vh - 100px)' }} |
| 1023 | + gutter={() => { |
| 1024 | + const gutter = document.createElement('div'); |
| 1025 | + gutter.className = 'gutter'; |
| 1026 | + return gutter; |
| 1027 | + }} |
| 1028 | + > |
| 1029 | + <Paper component="div" className={isSplitView ? 'col-xs-6 split padding-0' : 'col-xs-12 split padding-0'} sx={{boxShadow: 'none', p: 0, backgroundColor: 'white', borderRadius: '10px', border: 'solid 0.3px', borderColor: 'surface.nv80', minHeight: 'calc(100vh - 100px) !important'}}> |
| 1030 | + <Paper component="div" className='col-xs-12' sx={{backgroundColor: 'surface.main', boxShadow: 'none', padding: '4px 16px 8px 16px', borderRadius: '10px 10px 0 0', minWidth: '665px', ...((isConfigureInSplitView || !configure) ? {} : {height: 'calc(100vh - 125px) !important', overflow: 'auto'})}}> |
| 1031 | + { |
| 1032 | + configure && !file?.name && |
| 1033 | + <div className='col-xs-8 padding-0'> |
| 1034 | + <ConfigurationForm |
| 1035 | + project={project} |
| 1036 | + handleFileUpload={handleFileUpload} |
| 1037 | + file={file} |
| 1038 | + owner={owner} |
| 1039 | + setOwner={setOwner} |
1022 | 1040 | name={name} |
1023 | 1041 | setName={setName} |
1024 | 1042 | description={description} |
@@ -1102,7 +1120,7 @@ const MapProject = () => { |
1102 | 1120 | </Paper> |
1103 | 1121 | { |
1104 | 1122 | (Boolean(rows?.length) || selectedMatchBucket || ROW_STATES.includes(selectedRowStatus) || searchText) && |
1105 | | - <div className='col-xs-12' style={{padding: '0', width: '100%', height: 'calc(100vh - 170px)'}}> |
| 1123 | + <div className='col-xs-12' style={{padding: '0', width: '100%', height: 'calc(100vh - 170px)', minWidth: '665px'}}> |
1106 | 1124 | <div className='col-xs-12' style={{padding: '0 12px', display: 'flex', backgroundColor: SURFACE_COLORS.main, overflowX: 'auto'}}> |
1107 | 1125 | { |
1108 | 1126 | map(VIEWS, (state, view) => { |
@@ -1331,7 +1349,7 @@ const MapProject = () => { |
1331 | 1349 | </DialogActions> |
1332 | 1350 | </Dialog> |
1333 | 1351 | </Paper> |
1334 | | - <Paper component="div" className={isSplitView ? 'col-xs-6 split padding-0 split-appear' : 'col-xs-6 padding-0'} sx={{width: isSplitView ? 'calc(50% - 16px) !important' : 0, marginLeft: '16px', boxShadow: 'none', p: 0, backgroundColor: WHITE, borderRadius: '10px', border: 'solid 0.3px', borderColor: 'surface.nv80', opacity: isSplitView ? 1 : 0, height: 'calc(100vh - 100px) !important', overflow: 'auto'}}> |
| 1352 | + <Paper component="div" className={isSplitView ? 'col-xs-6 split padding-0 split-appear' : 'col-xs-6 padding-0'} sx={{boxShadow: 'none', p: 0, backgroundColor: WHITE, borderRadius: '10px', border: 'solid 0.3px', borderColor: 'surface.nv80', opacity: isSplitView ? 1 : 0, height: 'calc(100vh - 100px) !important', overflow: 'auto'}}> |
1335 | 1353 | { |
1336 | 1354 | configure && file?.name ? |
1337 | 1355 | <div className='col-xs-12'> |
@@ -1490,7 +1508,8 @@ const MapProject = () => { |
1490 | 1508 | </> |
1491 | 1509 | ) |
1492 | 1510 | } |
1493 | | - </Paper> |
| 1511 | + </Paper> |
| 1512 | + </Split> |
1494 | 1513 | <Menu |
1495 | 1514 | id="matching-algo" |
1496 | 1515 | anchorEl={algoMenuAnchorEl} |
|
0 commit comments