diff --git a/src/components/LearningResourcesWidget/LearningResourcesWidget.scss b/src/components/LearningResourcesWidget/LearningResourcesWidget.scss index 354f29f..40cb513 100644 --- a/src/components/LearningResourcesWidget/LearningResourcesWidget.scss +++ b/src/components/LearningResourcesWidget/LearningResourcesWidget.scss @@ -1,7 +1,51 @@ .learningResources-learningResources { + container-type: inline-size; overflow-y: auto; } +.lrn-widg-l-flex-row { + border-bottom: 1px solid #d2d2d2; +} -.widget-learning-resources { - column-width: 300px; +@container (width > 700px) { + .lrn-widg-l-flex-row { + flex-direction: row; + padding: var(--pf-v5-global--spacer--sm) var(--pf-v5-global--spacer--sm) var(--pf-v5-global--spacer--sm) var(--pf-v5-global--spacer--md); + width: 100%; + .item-1 { + width: 50%; + } + .group { + width: 47%; + .item-2 { + flex-grow: 1; + } + .item-3 { + flex-shrink: 1; + min-width: 160px; + } + } + } +} +@container (width < 700px) { + .lrn-widg-l-flex-row { + padding-left: var(--pf-v5-global--spacer--sm); + flex-direction: column; + gap: 4px; + } + .item-1 { + padding-left: var(--pf-v5-global--spacer--md); + padding-top: var(--pf-v5-global--spacer--sm); + width: 100%; + } + .group { + padding-bottom: var(--pf-v5-global--spacer--sm); + flex-direction: row; + .item-2 { + padding-left: var(--pf-v5-global--spacer--md); + margin-right: 0; + } + .item-3 { + padding-left: var(--pf-v5-global--spacer--md); + } + } } \ No newline at end of file diff --git a/src/components/LearningResourcesWidget/LearningResourcesWidget.tsx b/src/components/LearningResourcesWidget/LearningResourcesWidget.tsx index 896745a..d488457 100644 --- a/src/components/LearningResourcesWidget/LearningResourcesWidget.tsx +++ b/src/components/LearningResourcesWidget/LearningResourcesWidget.tsx @@ -6,7 +6,6 @@ import { } from '@patternfly/react-core/dist/dynamic/components/Text'; import useChrome from '@redhat-cloud-services/frontend-components/useChrome'; import { Link } from 'react-router-dom'; -import { Gallery } from '@patternfly/react-core/dist/dynamic/layouts/Gallery'; import { Label } from '@patternfly/react-core/dist/dynamic/components/Label'; import LearningResourcesEmptyState from './EmptyState'; import useQuickStarts from '../../hooks/useQuickStarts'; @@ -58,31 +57,35 @@ const LearningResourcesWidget: React.FunctionComponent<{ {bookmarks.length === 0 ? ( ) : ( - + {bookmarks.map(({ spec, metadata }, index) => ( -
- - {metadata.externalDocumentation ? ( - - {spec.displayName} - - - - - ) : ( - - )} - - - + + + + {metadata.externalDocumentation ? ( + + {spec.displayName} + + + + + ) : ( + + )} + + + + {spec.type && ( - + )} - + {spec.link?.href ? getPathName(spec.link?.href) : ''} @@ -90,9 +93,9 @@ const LearningResourcesWidget: React.FunctionComponent<{ -
+
))} -
+ )} );