Skip to content

Commit 05e4444

Browse files
committed
feat: use featured item view in previewer
1 parent 7e94857 commit 05e4444

4 files changed

Lines changed: 22 additions & 11 deletions

File tree

src/sections/collection/featured-items/FeaturedItems.module.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@
137137
margin: 0;
138138
font-size: 14px;
139139
}
140+
141+
// Both of these are only beacuse block codes make card overflow
142+
:global .rte-code-block {
143+
white-space: pre-wrap;
144+
word-break: break-word;
145+
}
146+
147+
:global .rte-code-block code {
148+
white-space: pre-wrap;
149+
word-break: break-word;
150+
}
140151
}
141152

142153
.footer {
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@use 'sass:color';
2-
@import 'node_modules/@iqss/dataverse-design-system/src/lib/assets/styles/design-tokens/colors.module';
3-
41
.preview-carousel-accordion {
52
margin-bottom: 1rem;
63

@@ -10,7 +7,5 @@
107

118
.accordion-body {
129
padding: 0;
13-
padding-top: 2rem;
14-
background-color: color.adjust($dv-secondary-color, $lightness: 10%);
1510
}
1611
}

src/sections/edit-collection-featured-items/featured-items-form/preview-carousel/PreviewCarousel.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { useWatch } from 'react-hook-form'
22
import { useTranslation } from 'react-i18next'
33
import { Accordion } from '@iqss/dataverse-design-system'
4-
import { CollectionFeaturedItem } from '@/collection/domain/models/CollectionFeaturedItem'
4+
import {
5+
CollectionFeaturedItem,
6+
CustomFeaturedItem
7+
} from '@/collection/domain/models/CollectionFeaturedItem'
8+
import { FeaturedItemView } from '@/sections/featured-item/featured-item-view/FeaturedItemView'
59
import { FeaturedItemsFormHelper } from '../FeaturedItemsFormHelper'
610
import { FeaturedItemField } from '../../types'
711
import { Slider } from './slider/Slider'
@@ -26,10 +30,10 @@ export const PreviewCarousel = () => {
2630
dotLabel={tCollection('featuredItems.slider.dotLabel')}
2731
dataTestId="featured-items-slider"
2832
items={formFieldsToFeaturedItems.map((featuredItem) => (
29-
<div key={featuredItem.id}>
30-
Mock, here we need to use the Featured Item Page component or something similar.
31-
{/* <FeaturedItemCard featuredItem={featuredItem} key={featuredItem.id} /> */}
32-
</div>
33+
<FeaturedItemView
34+
key={featuredItem.id}
35+
featuredItem={featuredItem as CustomFeaturedItem}
36+
/>
3337
))}
3438
/>
3539
</Accordion.Body>

src/sections/edit-collection-featured-items/featured-items-form/preview-carousel/slider/Slider.module.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
flex: 0 0 100%;
3636
scroll-snap-align: start;
3737
justify-content: center;
38-
max-height: 100%;
38+
max-height: 70vh;
39+
padding-inline: 1.5rem;
3940
overflow-x: hidden;
4041
}
4142
}

0 commit comments

Comments
 (0)