File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/components/modal-design-library Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 3939 .ugb-modal-design-library__wrapper {
4040 display : grid ;
4141 grid-template-columns : 300px auto ;
42- grid-template-rows : auto ;
42+ grid-template-rows : auto auto 80 px ;
4343 flex : 1 ;
4444 height : 100% ;
4545 }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export const ModalDesignLibrary = props => {
5353
5454 const [ isMultiSelectBusy , setIsMultiSelectBusy ] = useState ( false )
5555
56- const [ selectedTab , _setSelectedTab ] = useLocalStorage ( 'stk__design_library__block-list__view_by' , 'patterns' )
56+ const [ selectedTab , setSelectedTab ] = useLocalStorage ( 'stk__design_library__block-list__view_by' , 'patterns' )
5757 const [ selectedCategory , setSelectedCategory ] = useLocalStorage ( 'stk__design_library__block-list__selected' , '' )
5858 const [ selectedPlan , setSelectedPlan ] = useLocalStorage ( 'stk__design_library__view-plan' , PLAN_OPTIONS [ 0 ] )
5959
@@ -68,6 +68,17 @@ export const ModalDesignLibrary = props => {
6868
6969 const openDropdownRef = useRef ( null )
7070
71+ // For version 4, the default tab is now 'patterns' and for category, we use '' instead of 'All'.
72+ // So we need to update the local storage values here.
73+ useEffect ( ( ) => {
74+ const version = window . localStorage . getItem ( 'stk__design_library__version' )
75+ if ( ! version ) {
76+ window . localStorage . setItem ( 'stk__design_library__version' , 'v4' )
77+ setSelectedTab ( 'patterns' )
78+ setSelectedCategory ( '' )
79+ }
80+ } , [ ] )
81+
7182 // Update the designs on the sidebar. (this will trigger the display designs update next)
7283 useEffect ( ( ) => {
7384 if ( doReset ) {
You can’t perform that action at this time.
0 commit comments