Skip to content

Commit 9ecdfd8

Browse files
committed
add fixes
- fix footer size when there are no designs - fix designs not showing up unless a category is selected
1 parent 2ac2d58 commit 9ecdfd8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/components/modal-design-library/editor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
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 80px;
4343
flex: 1;
4444
height: 100%;
4545
}

src/components/modal-design-library/modal.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff 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 ) {

0 commit comments

Comments
 (0)