@@ -13,6 +13,9 @@ import {
1313import getSortedCollections from '../selectors/collections' ;
1414import QuickAddList from './QuickAddList' ;
1515import { remSize } from '../../../theme' ;
16+ import { Overlay } from '../../App/components/Overlay' ;
17+ import CollectionCreate from '../../User/components/CollectionCreate' ;
18+ import { Button } from '../../../common/Button' ;
1619
1720export const CollectionAddSketchWrapper = styled . div `
1821 width: ${ remSize ( 600 ) } ;
@@ -40,10 +43,11 @@ const AddToCollectionList = ({ projectId }) => {
4043 const loading = useSelector ( ( state ) => state . loading ) ;
4144 const [ hasLoadedData , setHasLoadedData ] = useState ( false ) ;
4245 const showLoader = loading && ! hasLoadedData ;
46+ const [ createCollectionVisible , setCreateCollectionVisible ] = useState ( false ) ;
4347
4448 useEffect ( ( ) => {
4549 dispatch ( getCollections ( username ) ) . then ( ( ) => setHasLoadedData ( true ) ) ;
46- } , [ dispatch , username ] ) ;
50+ } , [ dispatch , username , createCollectionVisible ] ) ;
4751
4852 const handleCollectionAdd = ( collection ) => {
4953 dispatch ( addToCollection ( collection . id , projectId ) ) ;
@@ -80,6 +84,19 @@ const AddToCollectionList = ({ projectId }) => {
8084 < Helmet >
8185 < title > { t ( 'AddToCollectionList.Title' ) } </ title >
8286 </ Helmet >
87+ < Button onClick = { ( ) => setCreateCollectionVisible ( true ) } >
88+ { t ( 'DashboardView.CreateCollection' ) }
89+ </ Button >
90+
91+ { createCollectionVisible && (
92+ < Overlay
93+ title = { t ( 'DashboardView.CreateCollectionOverlay' ) }
94+ closeOverlay = { ( ) => setCreateCollectionVisible ( false ) }
95+ isCompactHeight
96+ >
97+ < CollectionCreate />
98+ </ Overlay >
99+ ) }
83100 { getContent ( ) }
84101 </ QuickAddWrapper >
85102 </ CollectionAddSketchWrapper >
0 commit comments