Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: responsiveness on library authoring sidebar [FC-0062] #1293

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ body {
background-color: $light-100;
}
}

mark {
padding: 0;
}
rpenido marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 1 addition & 2 deletions src/library-authoring/LibraryAuthoringPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
}

.library-authoring-sidebar {
min-width: 300px;
max-width: map-get($grid-breakpoints, "sm");
z-index: 1001; // to appear over header
flex: 450px 0 0;
position: sticky;
top: 0;
right: 0;
Expand Down
14 changes: 2 additions & 12 deletions src/library-authoring/LibraryCollections.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CardGrid } from '@openedx/paragon';

import { useLoadOnScroll } from '../hooks';
import { useSearchContext } from '../search-manager';
import { NoComponents, NoSearchResults } from './EmptyStates';
Expand Down Expand Up @@ -41,22 +39,14 @@ const LibraryCollections = ({ variant }: LibraryCollectionsProps) => {
}

return (
<CardGrid
columnSizes={{
sm: 12,
md: 6,
lg: 4,
xl: 3,
}}
hasEqualColumnHeights
>
<div className="library-cards-grid">
{ collectionList.map((collectionHit) => (
<CollectionCard
key={collectionHit.id}
collectionHit={collectionHit}
/>
)) }
</CardGrid>
</div>
);
};

Expand Down
4 changes: 0 additions & 4 deletions src/library-authoring/components/ComponentCard.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.library-component-card {
.pgn__card {
height: 100%;
}

.library-component-header {
border-top-left-radius: .375rem;
border-top-right-radius: .375rem;
Expand Down
13 changes: 2 additions & 11 deletions src/library-authoring/components/LibraryComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useMemo } from 'react';
import { CardGrid } from '@openedx/paragon';

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

return (
<CardGrid
columnSizes={{
sm: 12,
md: 6,
lg: 4,
xl: 3,
}}
hasEqualColumnHeights
>
<div className="library-cards-grid">
{ componentList.map((contentHit) => (
<ComponentCard
key={contentHit.id}
contentHit={contentHit}
blockTypeDisplayName={blockTypes[contentHit.blockType]?.displayName ?? ''}
/>
)) }
</CardGrid>
</div>
);
};

Expand Down
9 changes: 8 additions & 1 deletion src/library-authoring/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
@import "./component-info/ComponentPreview";
@import "./components/ComponentCard";
@import "./generic";
@import "./LibraryAuthoringPage";
@import "./LibraryAuthoringPage";

.library-cards-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
grid-gap: 2rem;
justify-items: center;
}