@ndla/ui 34.0.0 → 34.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Figure/Figure.js +3 -2
- package/es/FileList/File.js +6 -6
- package/es/LanguageSelector/LanguageSelector.js +67 -99
- package/es/NDLAFilm/AboutNdlaFilm.js +13 -12
- package/es/NDLAFilm/AllMoviesAlphabetically.js +79 -144
- package/es/NDLAFilm/FilmContentCard.js +41 -26
- package/es/NDLAFilm/FilmContentCardTags.js +5 -3
- package/es/NDLAFilm/FilmMovieList.js +13 -8
- package/es/NDLAFilm/FilmMovieSearch.js +6 -5
- package/es/NDLAFilm/FilmSlideshow.js +44 -20
- package/es/NDLAFilm/filmStyles.js +2 -2
- package/es/ResourceGroup/ResourceItem.js +72 -48
- package/es/ResourceGroup/ResourceList.js +4 -3
- package/es/Search/ActiveFilterContent.js +6 -5
- package/es/Search/ContentTypeResult.js +6 -3
- package/es/SearchTypeResult/ActiveFilterContent.js +9 -10
- package/es/Topic/Topic.js +171 -213
- package/es/all.css +1 -1
- package/es/locale/messages-en.js +3 -1
- package/es/locale/messages-nb.js +3 -1
- package/es/locale/messages-nn.js +7 -5
- package/es/locale/messages-se.js +2 -0
- package/es/locale/messages-sma.js +3 -1
- package/lib/Figure/Figure.d.ts +2 -1
- package/lib/Figure/Figure.js +3 -2
- package/lib/FileList/File.js +6 -6
- package/lib/LanguageSelector/LanguageSelector.d.ts +6 -15
- package/lib/LanguageSelector/LanguageSelector.js +64 -99
- package/lib/NDLAFilm/AboutNdlaFilm.js +11 -14
- package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +1 -2
- package/lib/NDLAFilm/AllMoviesAlphabetically.js +77 -142
- package/lib/NDLAFilm/FilmContentCard.d.ts +7 -0
- package/lib/NDLAFilm/FilmContentCard.js +41 -26
- package/lib/NDLAFilm/FilmContentCardTags.d.ts +2 -1
- package/lib/NDLAFilm/FilmContentCardTags.js +5 -3
- package/lib/NDLAFilm/FilmMovieList.js +12 -7
- package/lib/NDLAFilm/FilmMovieSearch.js +5 -4
- package/lib/NDLAFilm/FilmSlideshow.js +44 -20
- package/lib/NDLAFilm/filmStyles.js +2 -2
- package/lib/Resource/resourceComponents.d.ts +1 -1
- package/lib/ResourceGroup/ResourceItem.d.ts +2 -2
- package/lib/ResourceGroup/ResourceItem.js +72 -48
- package/lib/ResourceGroup/ResourceList.js +4 -3
- package/lib/Search/ActiveFilterContent.d.ts +1 -1
- package/lib/Search/ActiveFilterContent.js +9 -5
- package/lib/Search/ContentTypeResult.js +6 -3
- package/lib/SearchTypeResult/ActiveFilterContent.d.ts +1 -1
- package/lib/SearchTypeResult/ActiveFilterContent.js +12 -10
- package/lib/Topic/Topic.js +170 -215
- package/lib/all.css +1 -1
- package/lib/locale/messages-en.d.ts +2 -0
- package/lib/locale/messages-en.js +3 -1
- package/lib/locale/messages-nb.d.ts +2 -0
- package/lib/locale/messages-nb.js +3 -1
- package/lib/locale/messages-nn.d.ts +4 -2
- package/lib/locale/messages-nn.js +7 -5
- package/lib/locale/messages-se.d.ts +2 -0
- package/lib/locale/messages-se.js +2 -0
- package/lib/locale/messages-sma.d.ts +2 -0
- package/lib/locale/messages-sma.js +3 -1
- package/package.json +15 -14
- package/src/Figure/Figure.tsx +6 -2
- package/src/FileList/File.tsx +4 -4
- package/src/LanguageSelector/LanguageSelector.stories.tsx +48 -0
- package/src/LanguageSelector/LanguageSelector.tsx +70 -149
- package/src/NDLAFilm/AboutNdlaFilm.tsx +11 -14
- package/src/NDLAFilm/AllMoviesAlphabetically.tsx +44 -160
- package/src/NDLAFilm/FilmContentCard.tsx +40 -21
- package/src/NDLAFilm/FilmContentCardTags.tsx +3 -2
- package/src/NDLAFilm/FilmMovieList.tsx +14 -7
- package/src/NDLAFilm/FilmMovieSearch.tsx +2 -2
- package/src/NDLAFilm/FilmSlideshow.tsx +49 -40
- package/src/NDLAFilm/filmStyles.ts +1 -1
- package/src/ResourceGroup/ResourceItem.tsx +79 -94
- package/src/ResourceGroup/ResourceList.tsx +2 -0
- package/src/Search/ActiveFilterContent.tsx +4 -3
- package/src/Search/ContentTypeResult.tsx +3 -1
- package/src/SearchTypeResult/ActiveFilterContent.tsx +7 -8
- package/src/Topic/Topic.tsx +166 -193
- package/src/locale/messages-en.ts +3 -1
- package/src/locale/messages-nb.ts +3 -1
- package/src/locale/messages-nn.ts +5 -4
- package/src/locale/messages-se.ts +2 -0
- package/src/locale/messages-sma.ts +3 -1
- package/src/main.scss +0 -1
- package/es/LanguageSelector/LanguageSelectorContent.js +0 -61
- package/es/Subject/SubjectCarousel.js +0 -133
- package/lib/LanguageSelector/LanguageSelectorContent.d.ts +0 -15
- package/lib/LanguageSelector/LanguageSelectorContent.js +0 -68
- package/lib/Subject/SubjectCarousel.d.ts +0 -18
- package/lib/Subject/SubjectCarousel.js +0 -138
- package/src/LanguageSelector/LanguageSelectorContent.tsx +0 -80
- package/src/NDLAFilm/component.film-movielist.scss +0 -105
- package/src/Subject/SubjectCarousel.tsx +0 -162
package/src/Topic/Topic.tsx
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React, { ReactNode, MouseEvent } from 'react';
|
|
9
|
+
import React, { ReactNode, MouseEvent, ComponentType } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { animations, breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
12
12
|
|
|
13
13
|
import parse from 'html-react-parser';
|
|
14
14
|
import { ChevronDown, ChevronUp, PlayCircleFilled } from '@ndla/icons/common';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
15
|
+
import { ModalCloseButton, ModalV2, ModalHeaderV2 } from '@ndla/modal';
|
|
16
|
+
import { ButtonV2 } from '@ndla/button';
|
|
17
17
|
import { CursorClick, ExpandTwoArrows } from '@ndla/icons/action';
|
|
18
18
|
import { css } from '@emotion/react';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
@@ -26,30 +26,31 @@ import { MessageBox } from '../Messages';
|
|
|
26
26
|
type InvertItProps = {
|
|
27
27
|
invertedStyle?: boolean;
|
|
28
28
|
};
|
|
29
|
-
type FrameProps = {
|
|
30
|
-
frame?: boolean;
|
|
31
|
-
};
|
|
32
29
|
|
|
33
|
-
const Wrapper = styled.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
const Wrapper = styled.div`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
gap: ${spacing.small};
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const frameStyle = css`
|
|
37
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
38
|
+
padding: 40px 40px;
|
|
39
|
+
border: 2px solid ${colors.brand.neutral7};
|
|
40
|
+
}
|
|
41
|
+
${mq.range({ from: breakpoints.desktop })} {
|
|
42
|
+
padding: 40px 80px;
|
|
43
|
+
}
|
|
44
|
+
${mq.range({ from: '1180px' })} {
|
|
45
|
+
padding: 60px 160px;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const _invertedStyle = css`
|
|
50
|
+
color: ${colors.white};
|
|
48
51
|
`;
|
|
49
52
|
|
|
50
53
|
const TopicHeaderVisualElementWrapper = styled.div`
|
|
51
|
-
float: right;
|
|
52
|
-
margin-left: ${spacing.normal};
|
|
53
54
|
position: relative;
|
|
54
55
|
width: 100px;
|
|
55
56
|
height: 100px;
|
|
@@ -57,7 +58,7 @@ const TopicHeaderVisualElementWrapper = styled.div`
|
|
|
57
58
|
width: 150px;
|
|
58
59
|
height: 150px;
|
|
59
60
|
}
|
|
60
|
-
${mq.range({ from: breakpoints.
|
|
61
|
+
${mq.range({ from: breakpoints.tabletWide })} {
|
|
61
62
|
width: 200px;
|
|
62
63
|
height: 200px;
|
|
63
64
|
}
|
|
@@ -68,10 +69,11 @@ const ShowVisualElementWrapper = styled.div`
|
|
|
68
69
|
width: 100%;
|
|
69
70
|
height: 100%;
|
|
70
71
|
overflow: hidden;
|
|
72
|
+
aspect-ratio: 1;
|
|
71
73
|
-webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari fix */
|
|
72
74
|
`;
|
|
73
75
|
|
|
74
|
-
const VisualElementButton = styled(
|
|
76
|
+
const VisualElementButton = styled(ButtonV2)`
|
|
75
77
|
color: ${colors.brand.secondary};
|
|
76
78
|
width: 100%;
|
|
77
79
|
height: 100%;
|
|
@@ -79,6 +81,7 @@ const VisualElementButton = styled(Button)`
|
|
|
79
81
|
|
|
80
82
|
const TopicHeaderImage = styled.img`
|
|
81
83
|
border-radius: 50%;
|
|
84
|
+
aspect-ratio: 1;
|
|
82
85
|
width: 100%;
|
|
83
86
|
height: 100%;
|
|
84
87
|
object-fit: cover;
|
|
@@ -94,6 +97,10 @@ const ExpandVisualElementButton = styled.span`
|
|
|
94
97
|
right: -10px;
|
|
95
98
|
bottom: -4px;
|
|
96
99
|
transition: all ${animations.durations.fast};
|
|
100
|
+
svg {
|
|
101
|
+
width: 24px;
|
|
102
|
+
height: 24px;
|
|
103
|
+
}
|
|
97
104
|
${VisualElementButton}:hover & {
|
|
98
105
|
right: 10px;
|
|
99
106
|
}
|
|
@@ -118,62 +125,28 @@ const TopicHeaderOverlay = styled.div`
|
|
|
118
125
|
}
|
|
119
126
|
`;
|
|
120
127
|
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
const TopicIntroductionWrapper = styled.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
gap: ${spacing.xsmall};
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
`;
|
|
133
|
+
|
|
134
|
+
const HeadingWrapper = styled.hgroup`
|
|
124
135
|
display: flex;
|
|
125
136
|
flex-wrap: wrap;
|
|
126
137
|
align-items: center;
|
|
127
|
-
${
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
${fonts.sizes('32px', '28px')};
|
|
131
|
-
margin: 40px 0 0;
|
|
138
|
+
gap: ${spacing.small};
|
|
139
|
+
h1 {
|
|
140
|
+
margin: 0;
|
|
132
141
|
}
|
|
133
|
-
|
|
134
|
-
${mq.range({ from: breakpoints.desktop })} {
|
|
135
|
-
margin: 50px 0 0;
|
|
136
|
-
${fonts.sizes('38px', '48px')};
|
|
137
|
-
}
|
|
138
|
-
${(props) =>
|
|
139
|
-
props.invertedStyle &&
|
|
140
|
-
css`
|
|
141
|
-
color: #fff;
|
|
142
|
-
`}
|
|
143
|
-
`;
|
|
144
|
-
|
|
145
|
-
const StyledHeadingText = styled.span`
|
|
146
|
-
margin-right: 28px;
|
|
147
|
-
`;
|
|
148
|
-
|
|
149
|
-
const StyledAdditionalResourceMark = styled.span`
|
|
150
|
-
text-align: center;
|
|
151
|
-
display: inline-block;
|
|
152
|
-
line-height: 18px;
|
|
153
|
-
width: 20px;
|
|
154
|
-
height: 20px;
|
|
155
|
-
border: 1px solid ${colors.brand.dark};
|
|
156
|
-
border-radius: 100px;
|
|
157
|
-
margin-right: 7px;
|
|
158
|
-
`;
|
|
159
|
-
const StyledAdditionalResource = styled.span`
|
|
160
|
-
font-weight: ${fonts.weight.semibold};
|
|
161
|
-
${fonts.sizes('12px', '15px')};
|
|
162
|
-
color: ${colors.brand.dark};
|
|
163
142
|
`;
|
|
164
143
|
|
|
165
|
-
const TopicIntroduction = styled.div
|
|
144
|
+
const TopicIntroduction = styled.div`
|
|
166
145
|
font-weight: ${fonts.weight.light};
|
|
167
146
|
max-width: 612px;
|
|
168
|
-
margin-top: ${spacing.xsmall};
|
|
169
147
|
${mq.range({ from: breakpoints.tablet })} {
|
|
170
148
|
${fonts.sizes('22px', '32px')};
|
|
171
149
|
}
|
|
172
|
-
${(props) =>
|
|
173
|
-
props.invertedStyle &&
|
|
174
|
-
css`
|
|
175
|
-
color: #fff;
|
|
176
|
-
`}
|
|
177
150
|
`;
|
|
178
151
|
|
|
179
152
|
const StyledButtonWrapper = styled.div<InvertItProps>`
|
|
@@ -193,22 +166,32 @@ const StyledButtonWrapper = styled.div<InvertItProps>`
|
|
|
193
166
|
`}
|
|
194
167
|
`;
|
|
195
168
|
|
|
169
|
+
const AdditionalIcon = styled.span`
|
|
170
|
+
padding: 1px;
|
|
171
|
+
border: 1px solid currentColor;
|
|
172
|
+
border-radius: 100%;
|
|
173
|
+
font-size: 15px;
|
|
174
|
+
width: 25px;
|
|
175
|
+
text-align: center;
|
|
176
|
+
`;
|
|
177
|
+
|
|
196
178
|
const StyledContentWrapper = styled.div<InvertItProps>`
|
|
197
179
|
padding-top: ${spacing.normal};
|
|
198
|
-
margin-top: 0;
|
|
199
180
|
border-left: 6px solid ${colors.brand.light};
|
|
200
|
-
|
|
201
|
-
${
|
|
202
|
-
props.invertedStyle &&
|
|
203
|
-
css`
|
|
204
|
-
background: #fff;
|
|
205
|
-
`}
|
|
181
|
+
color: ${colors.text.primary};
|
|
182
|
+
background-color: ${colors.white};
|
|
206
183
|
`;
|
|
207
184
|
|
|
208
|
-
const
|
|
209
|
-
padding
|
|
185
|
+
const ModalHeader = styled(ModalHeaderV2)`
|
|
186
|
+
padding: ${spacing.small} ${spacing.nsmall};
|
|
210
187
|
`;
|
|
211
188
|
|
|
189
|
+
const icons: Record<VisualElementProps['type'], ComponentType> = {
|
|
190
|
+
image: ExpandTwoArrows,
|
|
191
|
+
video: PlayCircleFilled,
|
|
192
|
+
other: CursorClick,
|
|
193
|
+
};
|
|
194
|
+
|
|
212
195
|
type VisualElementProps = {
|
|
213
196
|
type: 'image' | 'video' | 'other';
|
|
214
197
|
element: ReactNode;
|
|
@@ -257,124 +240,114 @@ const Topic = ({
|
|
|
257
240
|
children,
|
|
258
241
|
}: TopicProps) => {
|
|
259
242
|
const { t } = useTranslation();
|
|
243
|
+
const contentId = `expanded-description-${id}`;
|
|
244
|
+
const testId = 'nav-topic-about';
|
|
245
|
+
const VisualElementIcon = topic?.visualElement?.type ? icons[topic.visualElement.type] : null;
|
|
246
|
+
const wrapperStyle = [frame ? frameStyle : undefined, invertedStyle ? _invertedStyle : undefined];
|
|
247
|
+
if (isLoading || !topic) {
|
|
248
|
+
return (
|
|
249
|
+
<Wrapper css={wrapperStyle} data-testid={testId}>
|
|
250
|
+
{isLoading ? <Loader /> : null}
|
|
251
|
+
</Wrapper>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
260
255
|
return (
|
|
261
|
-
<Wrapper
|
|
262
|
-
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
{(onClose: () => void) => (
|
|
309
|
-
<>
|
|
310
|
-
<ModalHeader>
|
|
311
|
-
<ModalCloseButton onClick={onClose} title={t('modal.closeModal')} />
|
|
312
|
-
</ModalHeader>
|
|
313
|
-
<ModalBody modifier="no-side-padding-mobile">
|
|
314
|
-
{topic.visualElement && topic.visualElement.element}
|
|
315
|
-
</ModalBody>
|
|
316
|
-
</>
|
|
317
|
-
)}
|
|
318
|
-
</Modal>
|
|
319
|
-
</>
|
|
320
|
-
) : (
|
|
321
|
-
<TopicHeaderImage
|
|
322
|
-
src={`${topic.image.url}?${makeSrcQueryString(400, topic.image.crop, topic.image.focalPoint)}`}
|
|
323
|
-
alt={topic.image.alt}
|
|
324
|
-
/>
|
|
325
|
-
)}
|
|
326
|
-
</TopicHeaderVisualElementWrapper>
|
|
327
|
-
)}
|
|
328
|
-
<TopicHeading invertedStyle={invertedStyle} id={id} tabIndex={-1}>
|
|
329
|
-
<StyledHeadingText>{topic.title}</StyledHeadingText>
|
|
330
|
-
{isAdditionalTopic && (
|
|
331
|
-
<StyledAdditionalResource>
|
|
332
|
-
<StyledAdditionalResourceMark>T</StyledAdditionalResourceMark>
|
|
333
|
-
{t('navigation.additionalTopic')}
|
|
334
|
-
</StyledAdditionalResource>
|
|
256
|
+
<Wrapper css={wrapperStyle} data-testid={testId}>
|
|
257
|
+
<TopicIntroductionWrapper>
|
|
258
|
+
<div>
|
|
259
|
+
<HeadingWrapper>
|
|
260
|
+
<h1 id={id} tabIndex={-1}>
|
|
261
|
+
{topic.title}
|
|
262
|
+
</h1>
|
|
263
|
+
{isAdditionalTopic && (
|
|
264
|
+
<>
|
|
265
|
+
<AdditionalIcon aria-hidden="true">T</AdditionalIcon>
|
|
266
|
+
<span>{t('navigation.additionalTopic')}</span>
|
|
267
|
+
</>
|
|
268
|
+
)}
|
|
269
|
+
</HeadingWrapper>
|
|
270
|
+
<TopicIntroduction>
|
|
271
|
+
{renderMarkdown ? parse(renderMarkdown(topic.introduction)) : topic.introduction}
|
|
272
|
+
</TopicIntroduction>
|
|
273
|
+
</div>
|
|
274
|
+
{topic.image && (
|
|
275
|
+
<TopicHeaderVisualElementWrapper>
|
|
276
|
+
{topic.visualElement ? (
|
|
277
|
+
<ModalV2
|
|
278
|
+
label={t('topicPage.imageModal')}
|
|
279
|
+
activateButton={
|
|
280
|
+
<VisualElementButton
|
|
281
|
+
variant="stripped"
|
|
282
|
+
title={topic.visualElement.type === 'image' ? t('image.largeSize') : t('visualElement.show')}>
|
|
283
|
+
<ShowVisualElementWrapper>
|
|
284
|
+
<TopicHeaderImage
|
|
285
|
+
src={`${topic.image.url}?${makeSrcQueryString(800, topic.image.crop, topic.image.focalPoint)}`}
|
|
286
|
+
alt={topic.image.alt}
|
|
287
|
+
/>
|
|
288
|
+
<TopicHeaderOverlay />
|
|
289
|
+
</ShowVisualElementWrapper>
|
|
290
|
+
<ExpandVisualElementButton>{VisualElementIcon && <VisualElementIcon />}</ExpandVisualElementButton>
|
|
291
|
+
</VisualElementButton>
|
|
292
|
+
}
|
|
293
|
+
animation="subtle"
|
|
294
|
+
animationDuration={50}
|
|
295
|
+
size="large">
|
|
296
|
+
{(onClose: () => void) => (
|
|
297
|
+
<>
|
|
298
|
+
<ModalHeader>
|
|
299
|
+
<ModalCloseButton onClick={onClose} title={t('modal.closeModal')} />
|
|
300
|
+
</ModalHeader>
|
|
301
|
+
{topic.visualElement && topic.visualElement.element}
|
|
302
|
+
</>
|
|
335
303
|
)}
|
|
336
|
-
</
|
|
337
|
-
|
|
338
|
-
<
|
|
339
|
-
{
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
<StyledNavigationBoxWrapper>
|
|
364
|
-
<NavigationBox
|
|
365
|
-
colorMode="light"
|
|
366
|
-
heading={t('navigation.topics')}
|
|
367
|
-
items={subTopics}
|
|
368
|
-
onClick={onSubTopicSelected}
|
|
369
|
-
invertedStyle={invertedStyle}
|
|
370
|
-
/>
|
|
371
|
-
</StyledNavigationBoxWrapper>
|
|
304
|
+
</ModalV2>
|
|
305
|
+
) : (
|
|
306
|
+
<TopicHeaderImage
|
|
307
|
+
src={`${topic.image.url}?${makeSrcQueryString(400, topic.image.crop, topic.image.focalPoint)}`}
|
|
308
|
+
alt={topic.image.alt}
|
|
309
|
+
/>
|
|
310
|
+
)}
|
|
311
|
+
</TopicHeaderVisualElementWrapper>
|
|
312
|
+
)}
|
|
313
|
+
</TopicIntroductionWrapper>
|
|
314
|
+
{messageBox && <MessageBox>{messageBox}</MessageBox>}
|
|
315
|
+
<div>
|
|
316
|
+
{onToggleShowContent && (
|
|
317
|
+
<StyledButtonWrapper invertedStyle={invertedStyle}>
|
|
318
|
+
<ButtonV2
|
|
319
|
+
aria-expanded={!!showContent}
|
|
320
|
+
aria-controls={contentId}
|
|
321
|
+
variant="link"
|
|
322
|
+
onClick={() => onToggleShowContent()}>
|
|
323
|
+
{showContent ? (
|
|
324
|
+
<>
|
|
325
|
+
{t('navigation.showShorterDescription')} <ChevronUp />
|
|
326
|
+
</>
|
|
327
|
+
) : (
|
|
328
|
+
<>
|
|
329
|
+
{t('navigation.showLongerDescription')} <ChevronDown />
|
|
330
|
+
</>
|
|
372
331
|
)}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
332
|
+
</ButtonV2>
|
|
333
|
+
</StyledButtonWrapper>
|
|
334
|
+
)}
|
|
335
|
+
{showContent && (
|
|
336
|
+
<StyledContentWrapper id={contentId} invertedStyle={invertedStyle}>
|
|
337
|
+
{children}
|
|
338
|
+
</StyledContentWrapper>
|
|
339
|
+
)}
|
|
340
|
+
</div>
|
|
341
|
+
{subTopics && subTopics.length !== 0 && (
|
|
342
|
+
<NavigationBox
|
|
343
|
+
colorMode="light"
|
|
344
|
+
heading={t('navigation.topics')}
|
|
345
|
+
items={subTopics}
|
|
346
|
+
onClick={onSubTopicSelected}
|
|
347
|
+
invertedStyle={invertedStyle}
|
|
348
|
+
/>
|
|
377
349
|
)}
|
|
350
|
+
{topic.resources}
|
|
378
351
|
</Wrapper>
|
|
379
352
|
);
|
|
380
353
|
};
|
|
@@ -442,7 +442,7 @@ const messages = {
|
|
|
442
442
|
article: {
|
|
443
443
|
edition: 'Edition',
|
|
444
444
|
publisher: 'Publisher',
|
|
445
|
-
lastUpdated: 'Last
|
|
445
|
+
lastUpdated: 'Last revised date',
|
|
446
446
|
closeLabel: 'Close',
|
|
447
447
|
useContent: 'Cite or use',
|
|
448
448
|
additionalLabel: 'Additional content',
|
|
@@ -772,6 +772,7 @@ const messages = {
|
|
|
772
772
|
copyCode: 'Copy code',
|
|
773
773
|
},
|
|
774
774
|
ndlaFilm: {
|
|
775
|
+
heading: 'NDLA film',
|
|
775
776
|
slideBackwardsLabel: 'Scroll backwards',
|
|
776
777
|
slideForwardsLabel: 'Scroll forwards',
|
|
777
778
|
movieMatchInCategory: 'Matches',
|
|
@@ -818,6 +819,7 @@ const messages = {
|
|
|
818
819
|
shortFilm: 'Short film',
|
|
819
820
|
all: 'All movies A-Z',
|
|
820
821
|
},
|
|
822
|
+
allMovieGroupTitleLabel: 'Movies starting with {{letter}}',
|
|
821
823
|
moreAboutNdlaFilm: {
|
|
822
824
|
header: 'NDLA Film',
|
|
823
825
|
firstParagraph:
|
|
@@ -439,7 +439,7 @@ const messages = {
|
|
|
439
439
|
'Utgåtte fag undervises det ikke i lenger, men det kan fortsatt være mulig å ta eksamen i faga som privatist.',
|
|
440
440
|
},
|
|
441
441
|
article: {
|
|
442
|
-
lastUpdated: 'Sist oppdatert',
|
|
442
|
+
lastUpdated: 'Sist faglig oppdatert',
|
|
443
443
|
edition: 'Utgave',
|
|
444
444
|
publisher: 'Utgiver',
|
|
445
445
|
useContent: 'Regler for bruk',
|
|
@@ -771,6 +771,7 @@ const messages = {
|
|
|
771
771
|
copyCode: 'Kopier kode til utklippstavle',
|
|
772
772
|
},
|
|
773
773
|
ndlaFilm: {
|
|
774
|
+
heading: 'NDLA film',
|
|
774
775
|
slideBackwardsLabel: 'Scroll bakover',
|
|
775
776
|
slideForwardsLabel: 'Scroll fremover',
|
|
776
777
|
movieMatchInCategory: 'Treff',
|
|
@@ -817,6 +818,7 @@ const messages = {
|
|
|
817
818
|
shortFilm: 'Kortfilm',
|
|
818
819
|
all: 'Alle filmer A-Å',
|
|
819
820
|
},
|
|
821
|
+
allMovieGroupTitleLabel: 'Filmer som starter på {{letter}}',
|
|
820
822
|
moreAboutNdlaFilm: {
|
|
821
823
|
header: 'NDLA Film',
|
|
822
824
|
firstParagraph:
|
|
@@ -305,6 +305,7 @@ const messages = {
|
|
|
305
305
|
name: 'Følg oss',
|
|
306
306
|
},
|
|
307
307
|
},
|
|
308
|
+
errorDescription: 'Orsak, ein feil oppstod under lasting av faga.',
|
|
308
309
|
film: {
|
|
309
310
|
header: 'NDLA film',
|
|
310
311
|
text: 'NDLA film er ei teneste i samarbeid med Norgesfilm. Denne tenesta lar deg sjå ei rekkje spelefilmar, kortfilmar, dokumentarar og seriar. Du kan òg sjå undervisningsfilm og filmklipp. Velkomen inn i filmen si verd!',
|
|
@@ -312,7 +313,6 @@ const messages = {
|
|
|
312
313
|
linkLabel: 'Gå til NDLA film',
|
|
313
314
|
},
|
|
314
315
|
blog: 'Frå bloggen',
|
|
315
|
-
errorDescription: 'Orsak, ein feil oppstod under lasting av faga.',
|
|
316
316
|
},
|
|
317
317
|
toolboxPage: {
|
|
318
318
|
introduction:
|
|
@@ -373,7 +373,6 @@ const messages = {
|
|
|
373
373
|
[contentTypes.SUBJECT_MATERIAL]: 'Vis mindre fagstoff',
|
|
374
374
|
[contentTypes.TASKS_AND_ACTIVITIES]: 'Vis færre oppgåver og aktivitetar',
|
|
375
375
|
[contentTypes.LEARNING_PATH]: 'Vis færre læringsstiar',
|
|
376
|
-
[contentTypes.LEARNING_PATH]: 'Vis færre læringsstiar',
|
|
377
376
|
[contentTypes.ASSESSMENT_RESOURCES]: 'Vis færre vurderingsressursar',
|
|
378
377
|
[contentTypes.SOURCE_MATERIAL]: 'Vis færre kjeldemateriale',
|
|
379
378
|
[contentTypes.EXTERNAL_LEARNING_RESOURCES]: 'Vis færre eksterne læringsressursar',
|
|
@@ -398,8 +397,8 @@ const messages = {
|
|
|
398
397
|
error: 'Orsak, ein del av innhaldet kunne ikkje visast.',
|
|
399
398
|
noCoreResourcesAvailableUnspecific: 'Det er ikkje noko kjernestoff tilgjengeleg.',
|
|
400
399
|
noCoreResourcesAvailable: 'Det er ikkje noko kjernestoff tilgjengeleg for {{name}}.',
|
|
401
|
-
toggleFilterLabel: 'Tilleggsressursar',
|
|
402
400
|
activateAdditionalResources: 'Tilleggsressursar',
|
|
401
|
+
toggleFilterLabel: 'Tilleggsressursar',
|
|
403
402
|
label: 'Læringsressursar',
|
|
404
403
|
allResources: 'Ressursar',
|
|
405
404
|
shortcutButtonText: 'Lærestoff',
|
|
@@ -440,7 +439,7 @@ const messages = {
|
|
|
440
439
|
'Utgåtte fag blir det ikkje undervist i lenger, men det kan framleis vere mogleg å ta eksamen i faget som privatist.',
|
|
441
440
|
},
|
|
442
441
|
article: {
|
|
443
|
-
lastUpdated: 'Sist oppdatert',
|
|
442
|
+
lastUpdated: 'Sist faglig oppdatert',
|
|
444
443
|
edition: 'Utgåve',
|
|
445
444
|
publisher: 'Utgjevar',
|
|
446
445
|
closeLabel: 'Lukk',
|
|
@@ -772,6 +771,7 @@ const messages = {
|
|
|
772
771
|
copyCode: 'Kopier kode til utklippstavle',
|
|
773
772
|
},
|
|
774
773
|
ndlaFilm: {
|
|
774
|
+
heading: 'NDLA film',
|
|
775
775
|
slideBackwardsLabel: 'Scroll bakover',
|
|
776
776
|
slideForwardsLabel: 'Scroll framover',
|
|
777
777
|
movieMatchInCategory: 'Treff',
|
|
@@ -818,6 +818,7 @@ const messages = {
|
|
|
818
818
|
shortFilm: 'Kortfilm',
|
|
819
819
|
all: 'Alle filmar A-Å',
|
|
820
820
|
},
|
|
821
|
+
allMovieGroupTitleLabel: 'Filmar som startar på {{letter}}',
|
|
821
822
|
moreAboutNdlaFilm: {
|
|
822
823
|
header: 'NDLA Film',
|
|
823
824
|
firstParagraph:
|
|
@@ -772,6 +772,7 @@ const messages = {
|
|
|
772
772
|
copyCode: 'Máŋge koda vuorkátávvalii',
|
|
773
773
|
},
|
|
774
774
|
ndlaFilm: {
|
|
775
|
+
heading: 'NDLA film',
|
|
775
776
|
slideBackwardsLabel: 'Rulle maŋos',
|
|
776
777
|
slideForwardsLabel: 'Rulle ovddas',
|
|
777
778
|
movieMatchInCategory: 'Deaivan',
|
|
@@ -818,6 +819,7 @@ const messages = {
|
|
|
818
819
|
shortFilm: 'Oanehis filbma',
|
|
819
820
|
all: 'Buot filmmat A-Å',
|
|
820
821
|
},
|
|
822
|
+
allMovieGroupTitleLabel: 'Filmar som startar på {{letter}}',
|
|
821
823
|
moreAboutNdlaFilm: {
|
|
822
824
|
header: 'NDLA Filbma',
|
|
823
825
|
firstParagraph:
|
|
@@ -440,7 +440,7 @@ const messages = {
|
|
|
440
440
|
'Utgåtte fag undervises det ikke i lenger, men det kan fortsatt være mulig å ta eksamen i faga som privatist.',
|
|
441
441
|
},
|
|
442
442
|
article: {
|
|
443
|
-
lastUpdated: 'Sist oppdatert',
|
|
443
|
+
lastUpdated: 'Sist faglig oppdatert',
|
|
444
444
|
edition: 'Utgave',
|
|
445
445
|
publisher: 'Utgiver',
|
|
446
446
|
useContent: 'Regler for bruk',
|
|
@@ -772,6 +772,7 @@ const messages = {
|
|
|
772
772
|
copyCode: 'Kopier kode til utklippstavle',
|
|
773
773
|
},
|
|
774
774
|
ndlaFilm: {
|
|
775
|
+
heading: 'NDLA film',
|
|
775
776
|
slideBackwardsLabel: 'Scroll bakover',
|
|
776
777
|
slideForwardsLabel: 'Scroll fremover',
|
|
777
778
|
movieMatchInCategory: 'Treff',
|
|
@@ -818,6 +819,7 @@ const messages = {
|
|
|
818
819
|
shortFilm: 'Kortfilm',
|
|
819
820
|
all: 'Alle filmer A-Å',
|
|
820
821
|
},
|
|
822
|
+
allMovieGroupTitleLabel: 'Filmar som startar på {{letter}}',
|
|
821
823
|
moreAboutNdlaFilm: {
|
|
822
824
|
header: 'NDLA Film',
|
|
823
825
|
firstParagraph:
|
package/src/main.scss
CHANGED