Skip to content

Commit f815e38

Browse files
committed
fix: responsiveness on library authoring sidebar
1 parent 82a3b7c commit f815e38

File tree

6 files changed

+17
-29
lines changed

6 files changed

+17
-29
lines changed

src/index.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ body {
6161
background-color: $light-100;
6262
}
6363
}
64+
65+
mark {
66+
padding: 0;
67+
}

src/library-authoring/LibraryAuthoringPage.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
}
1212

1313
.library-authoring-sidebar {
14-
min-width: 300px;
15-
max-width: map-get($grid-breakpoints, "sm");
1614
z-index: 1001; // to appear over header
15+
flex: 450px 0 0;
1716
position: sticky;
1817
top: 0;
1918
right: 0;

src/library-authoring/LibraryCollections.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { CardGrid } from '@openedx/paragon';
2-
31
import { useLoadOnScroll } from '../hooks';
42
import { useSearchContext } from '../search-manager';
53
import { NoComponents, NoSearchResults } from './EmptyStates';
@@ -41,22 +39,14 @@ const LibraryCollections = ({ variant }: LibraryCollectionsProps) => {
4139
}
4240

4341
return (
44-
<CardGrid
45-
columnSizes={{
46-
sm: 12,
47-
md: 6,
48-
lg: 4,
49-
xl: 3,
50-
}}
51-
hasEqualColumnHeights
52-
>
42+
<div className="library-cards-grid">
5343
{ collectionList.map((collectionHit) => (
5444
<CollectionCard
5545
key={collectionHit.id}
5646
collectionHit={collectionHit}
5747
/>
5848
)) }
59-
</CardGrid>
49+
</div>
6050
);
6151
};
6252

src/library-authoring/components/ComponentCard.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
.library-component-card {
2-
.pgn__card {
3-
height: 100%;
4-
}
52

63
.library-component-header {
74
border-top-left-radius: .375rem;

src/library-authoring/components/LibraryComponents.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useMemo } from 'react';
2-
import { CardGrid } from '@openedx/paragon';
32

43
import { useLoadOnScroll } from '../../hooks';
54
import { useSearchContext } from '../../search-manager';
@@ -56,23 +55,15 @@ const LibraryComponents = ({ libraryId, variant }: LibraryComponentsProps) => {
5655
}
5756

5857
return (
59-
<CardGrid
60-
columnSizes={{
61-
sm: 12,
62-
md: 6,
63-
lg: 4,
64-
xl: 3,
65-
}}
66-
hasEqualColumnHeights
67-
>
58+
<div className="library-cards-grid">
6859
{ componentList.map((contentHit) => (
6960
<ComponentCard
7061
key={contentHit.id}
7162
contentHit={contentHit}
7263
blockTypeDisplayName={blockTypes[contentHit.blockType]?.displayName ?? ''}
7364
/>
7465
)) }
75-
</CardGrid>
66+
</div>
7667
);
7768
};
7869

src/library-authoring/index.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
@import "./component-info/ComponentPreview";
22
@import "./components/ComponentCard";
33
@import "./generic";
4-
@import "./LibraryAuthoringPage";
4+
@import "./LibraryAuthoringPage";
5+
6+
.library-cards-grid {
7+
display: grid;
8+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
9+
grid-gap: 2rem;
10+
justify-items: center;
11+
}

0 commit comments

Comments
 (0)