@ndla/ui 15.1.3 → 16.0.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/Article/ArticleContent.js +2 -0
- package/es/Breadcrumb/ActionBreadcrumb.js +9 -4
- package/es/Breadcrumb/Breadcrumb.js +6 -5
- package/es/FileList/File.js +7 -12
- package/es/Filter/FilterButtons.js +13 -13
- package/es/Filter/FilterCarousel.js +32 -23
- package/es/MyNdla/Resource/Folder.js +9 -7
- package/es/Resource/BlockResource.js +7 -7
- package/es/Resource/ListResource.js +38 -25
- package/es/Resource/resourceComponents.js +17 -18
- package/es/ResourceGroup/ResourceGroup.js +8 -5
- package/es/ResourceGroup/ResourceItem.js +13 -13
- package/es/ResourceGroup/ResourceList.js +4 -4
- package/es/locale/messages-en.js +4 -4
- package/es/locale/messages-nb.js +4 -4
- package/es/locale/messages-nn.js +4 -4
- package/es/locale/messages-se.js +4 -4
- package/es/locale/messages-sma.js +4 -4
- package/lib/Article/ArticleContent.js +3 -0
- package/lib/Breadcrumb/ActionBreadcrumb.js +9 -4
- package/lib/Breadcrumb/Breadcrumb.d.ts +2 -1
- package/lib/Breadcrumb/Breadcrumb.js +6 -5
- package/lib/FileList/File.js +10 -14
- package/lib/Filter/FilterButtons.js +13 -13
- package/lib/Filter/FilterCarousel.js +31 -22
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.d.ts +5 -5
- package/lib/Frontpage/illustrations/FrontpageIllustrations.d.ts +2 -2
- package/lib/MultidisciplinarySubject/Illustrations.d.ts +7 -7
- package/lib/MyNdla/Resource/Folder.js +8 -6
- package/lib/Resource/BlockResource.js +6 -6
- package/lib/Resource/ListResource.js +34 -23
- package/lib/Resource/resourceComponents.d.ts +3 -3
- package/lib/Resource/resourceComponents.js +19 -20
- package/lib/ResourceGroup/ResourceGroup.d.ts +2 -1
- package/lib/ResourceGroup/ResourceGroup.js +8 -5
- package/lib/ResourceGroup/ResourceItem.d.ts +2 -2
- package/lib/ResourceGroup/ResourceItem.js +13 -13
- package/lib/ResourceGroup/ResourceList.d.ts +2 -2
- package/lib/ResourceGroup/ResourceList.js +4 -4
- package/lib/Search/ContentTypeResultStyles.d.ts +3 -3
- package/lib/SearchTypeResult/ActiveFilterContent.d.ts +1 -1
- package/lib/locale/messages-en.d.ts +4 -4
- package/lib/locale/messages-en.js +4 -4
- package/lib/locale/messages-nb.d.ts +4 -4
- package/lib/locale/messages-nb.js +4 -4
- package/lib/locale/messages-nn.d.ts +4 -4
- package/lib/locale/messages-nn.js +4 -4
- package/lib/locale/messages-se.d.ts +4 -4
- package/lib/locale/messages-se.js +4 -4
- package/lib/locale/messages-sma.d.ts +4 -4
- package/lib/locale/messages-sma.js +4 -4
- package/package.json +11 -11
- package/src/Article/ArticleContent.tsx +2 -0
- package/src/Breadcrumb/ActionBreadcrumb.tsx +15 -3
- package/src/Breadcrumb/Breadcrumb.tsx +10 -2
- package/src/FileList/File.tsx +8 -11
- package/src/Filter/FilterButtons.tsx +3 -4
- package/src/Filter/FilterCarousel.tsx +25 -22
- package/src/MyNdla/Resource/Folder.tsx +5 -1
- package/src/Resource/BlockResource.tsx +2 -2
- package/src/Resource/ListResource.tsx +56 -31
- package/src/Resource/resourceComponents.tsx +8 -9
- package/src/ResourceGroup/ResourceGroup.tsx +3 -0
- package/src/ResourceGroup/ResourceItem.tsx +3 -3
- package/src/ResourceGroup/ResourceList.tsx +3 -3
- package/src/locale/messages-en.ts +4 -4
- package/src/locale/messages-nb.ts +4 -4
- package/src/locale/messages-nn.ts +4 -4
- package/src/locale/messages-se.ts +4 -4
- package/src/locale/messages-sma.ts +4 -4
|
@@ -24,15 +24,14 @@ const StyledHeading = styled.h3`
|
|
|
24
24
|
`;
|
|
25
25
|
|
|
26
26
|
const StyledButtonsWrapper = styled.div`
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-wrap:
|
|
29
|
-
position: relative;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
30
29
|
`;
|
|
31
30
|
|
|
32
31
|
const StyledButtonElementWrapper = styled.div`
|
|
33
32
|
margin: 0 ${spacing.xsmall} ${spacing.xsmall} 0;
|
|
34
33
|
break-inside: avoid;
|
|
35
|
-
flex:
|
|
34
|
+
flex-shrink: 0;
|
|
36
35
|
`;
|
|
37
36
|
|
|
38
37
|
const StyledList = styled.ul`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React, { ReactChild, useLayoutEffect, useRef, useState } from 'react';
|
|
9
|
+
import React, { ReactChild, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import styled from '@emotion/styled';
|
|
12
12
|
import { css } from '@emotion/core';
|
|
@@ -31,7 +31,6 @@ const Inner = styled.div`
|
|
|
31
31
|
`;
|
|
32
32
|
|
|
33
33
|
const NavButton = styled('button')<{
|
|
34
|
-
hide?: boolean;
|
|
35
34
|
alignRight?: boolean;
|
|
36
35
|
}>`
|
|
37
36
|
box-sizing: border-box;
|
|
@@ -58,25 +57,12 @@ const NavButton = styled('button')<{
|
|
|
58
57
|
cursor: pointer;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
${(props) =>
|
|
62
|
-
props.hide &&
|
|
63
|
-
`
|
|
64
|
-
opacity: 0;
|
|
65
|
-
transform: translate(-40px, 0px);
|
|
66
|
-
`}
|
|
67
|
-
|
|
68
60
|
${(props) =>
|
|
69
61
|
props.alignRight &&
|
|
70
62
|
`
|
|
71
63
|
right: 2px;
|
|
72
64
|
left: unset;
|
|
73
|
-
`}
|
|
74
65
|
|
|
75
|
-
${(props) =>
|
|
76
|
-
props.alignRight &&
|
|
77
|
-
props.hide &&
|
|
78
|
-
`
|
|
79
|
-
transform: translate(40px, 0px);
|
|
80
66
|
`}
|
|
81
67
|
`;
|
|
82
68
|
|
|
@@ -94,7 +80,7 @@ const FilterCarousel = ({ children }: Props) => {
|
|
|
94
80
|
const innerRef: { current: HTMLDivElement | null } = useRef(null);
|
|
95
81
|
|
|
96
82
|
// Check if we need to show the nav buttons
|
|
97
|
-
|
|
83
|
+
const showButtons = () => {
|
|
98
84
|
if (carouselRef.current && innerRef.current) {
|
|
99
85
|
const carouselWidth = carouselRef.current.offsetWidth || 0;
|
|
100
86
|
const innerWidth = innerRef.current.scrollWidth;
|
|
@@ -106,8 +92,21 @@ const FilterCarousel = ({ children }: Props) => {
|
|
|
106
92
|
} else {
|
|
107
93
|
setHideNext(true);
|
|
108
94
|
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
useLayoutEffect(() => {
|
|
98
|
+
showButtons();
|
|
109
99
|
}, [children]);
|
|
110
100
|
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
const resetTranslateX = () => {
|
|
103
|
+
setTranslateX(0);
|
|
104
|
+
showButtons();
|
|
105
|
+
};
|
|
106
|
+
window.addEventListener('resize', resetTranslateX);
|
|
107
|
+
return () => window.removeEventListener('resize', resetTranslateX);
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
111
110
|
const updateIndex = (direction: string) => {
|
|
112
111
|
const carousel = carouselRef.current;
|
|
113
112
|
const inner = innerRef.current;
|
|
@@ -153,12 +152,16 @@ const FilterCarousel = ({ children }: Props) => {
|
|
|
153
152
|
{children}
|
|
154
153
|
</Inner>
|
|
155
154
|
</Carousel>
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
{!hideNext && (
|
|
156
|
+
<NavButton title={t('carousel.forward')} onClick={() => updateIndex('NEXT')} alignRight>
|
|
157
|
+
<ChevronRight style={{ width: '18px', height: '18px' }} aria-hidden title="" />
|
|
158
|
+
</NavButton>
|
|
159
|
+
)}
|
|
160
|
+
{translateX >= 1 && (
|
|
161
|
+
<NavButton title={t('carousel.back')} onClick={() => updateIndex('PREV')}>
|
|
162
|
+
<ChevronLeft style={{ width: '18px', height: '18px' }} aria-hidden title="" />
|
|
163
|
+
</NavButton>
|
|
164
|
+
)}
|
|
162
165
|
</div>
|
|
163
166
|
);
|
|
164
167
|
};
|
|
@@ -10,7 +10,7 @@ import styled from '@emotion/styled';
|
|
|
10
10
|
import React, { ReactNode } from 'react';
|
|
11
11
|
import { FolderOutlined } from '@ndla/icons/contentType';
|
|
12
12
|
import { FileDocumentOutline } from '@ndla/icons/common';
|
|
13
|
-
import { fonts, spacing, colors } from '@ndla/core';
|
|
13
|
+
import { fonts, spacing, colors, mq, breakpoints } from '@ndla/core';
|
|
14
14
|
import { css } from '@emotion/core';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import SafeLink from '@ndla/safelink';
|
|
@@ -110,6 +110,10 @@ const IconCountWrapper = styled.div<IconCountWrapperProps>`
|
|
|
110
110
|
opacity: 1;
|
|
111
111
|
}
|
|
112
112
|
`};
|
|
113
|
+
|
|
114
|
+
${mq.range({ until: breakpoints.tabletWide })} {
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
113
117
|
`;
|
|
114
118
|
|
|
115
119
|
const IconCount = ({ type, count, layoutType }: IconCountProps) => {
|
|
@@ -11,7 +11,7 @@ import React, { ReactNode } from 'react';
|
|
|
11
11
|
import SafeLink from '@ndla/safelink';
|
|
12
12
|
import { colors, fonts, spacing } from '@ndla/core';
|
|
13
13
|
import Image from '../Image';
|
|
14
|
-
import {
|
|
14
|
+
import { CompressedTags, ResourceImageProps, ResourceTitle, Row, TopicList } from './resourceComponents';
|
|
15
15
|
|
|
16
16
|
interface BlockResourceProps {
|
|
17
17
|
link: string;
|
|
@@ -90,7 +90,7 @@ const BlockResource = ({ link, title, tags, resourceImage, topics, description,
|
|
|
90
90
|
<TopicList topics={topics} />
|
|
91
91
|
<BlockDescription>{description}</BlockDescription>
|
|
92
92
|
<RightRow>
|
|
93
|
-
{tags &&
|
|
93
|
+
{tags && CompressedTags(tags)}
|
|
94
94
|
{actionMenu}
|
|
95
95
|
</RightRow>
|
|
96
96
|
</BlockInfoWrapper>
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
import styled from '@emotion/styled';
|
|
10
10
|
import React, { ReactNode } from 'react';
|
|
11
11
|
import SafeLink from '@ndla/safelink';
|
|
12
|
-
import { fonts, spacing, colors } from '@ndla/core';
|
|
12
|
+
import { fonts, spacing, colors, breakpoints, mq } from '@ndla/core';
|
|
13
13
|
import Image from '../Image';
|
|
14
|
-
import {
|
|
14
|
+
import { CompressedTags, ResourceImageProps, ResourceTitle, TopicList } from './resourceComponents';
|
|
15
15
|
|
|
16
16
|
const ResourceDescription = styled.p`
|
|
17
|
+
grid-area: description;
|
|
17
18
|
line-clamp: 2;
|
|
18
19
|
line-height: 1em;
|
|
19
20
|
height: 3.1em;
|
|
@@ -30,14 +31,26 @@ const ResourceDescription = styled.p`
|
|
|
30
31
|
|
|
31
32
|
const ResourceWrapper = styled(SafeLink)`
|
|
32
33
|
display: grid;
|
|
33
|
-
|
|
34
|
+
flex: 1;
|
|
35
|
+
grid-template-areas:
|
|
36
|
+
'image topicAndTitle tags'
|
|
37
|
+
'image description description';
|
|
38
|
+
grid-template-columns: auto 1fr auto;
|
|
39
|
+
${mq.range({ until: breakpoints.mobileWide })} {
|
|
40
|
+
grid-template-columns: auto 1fr;
|
|
41
|
+
grid-template-areas:
|
|
42
|
+
'image topicAndTitle'
|
|
43
|
+
'description description'
|
|
44
|
+
'tags tags';
|
|
45
|
+
}
|
|
46
|
+
|
|
34
47
|
text-decoration: none;
|
|
35
48
|
box-shadow: none;
|
|
36
49
|
padding: ${spacing.small};
|
|
37
50
|
border: 1px solid ${colors.brand.light};
|
|
38
51
|
border-radius: 2px;
|
|
39
52
|
color: ${colors.brand.greyDark};
|
|
40
|
-
gap: ${spacing.small};
|
|
53
|
+
gap: 0 ${spacing.small};
|
|
41
54
|
&:hover {
|
|
42
55
|
box-shadow: 1px 1px 6px 2px rgba(9, 55, 101, 0.08);
|
|
43
56
|
transition-duration: 0.2s;
|
|
@@ -52,27 +65,43 @@ const ResourceWrapper = styled(SafeLink)`
|
|
|
52
65
|
}
|
|
53
66
|
`;
|
|
54
67
|
|
|
55
|
-
const
|
|
56
|
-
|
|
68
|
+
const TagsandActionMenu = styled.div`
|
|
69
|
+
grid-area: tags;
|
|
57
70
|
display: flex;
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
align-items: center;
|
|
72
|
+
width: 100%;
|
|
60
73
|
overflow: hidden;
|
|
74
|
+
gap: ${spacing.small};
|
|
75
|
+
align-self: flex-start;
|
|
76
|
+
justify-self: flex-end;
|
|
77
|
+
justify-content: flex-end;
|
|
61
78
|
`;
|
|
62
79
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
80
|
+
const StyledImageWrapper = styled.div<StyledImageProps>`
|
|
81
|
+
grid-area: image;
|
|
82
|
+
width: ${(p) => (p.imageSize === 'normal' ? '136px' : '56px')};
|
|
83
|
+
height: ${(p) => (p.imageSize === 'normal' ? '96px' : '40px')};
|
|
84
|
+
${mq.range({ until: breakpoints.mobileWide })} {
|
|
85
|
+
width: 54px;
|
|
86
|
+
height: 40px;
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
66
89
|
|
|
67
|
-
const StyledImage = styled(Image)
|
|
90
|
+
const StyledImage = styled(Image)`
|
|
68
91
|
display: flex;
|
|
69
92
|
border-radius: 2px;
|
|
70
93
|
object-fit: cover;
|
|
71
|
-
width: ${(p) => (p.imageSize === 'normal' ? '136px' : '56px')};
|
|
72
|
-
min-width: ${(p) => (p.imageSize === 'normal' ? '136px' : '56px')};
|
|
73
|
-
height: ${(p) => (p.imageSize === 'normal' ? '96px' : '40px')};
|
|
74
94
|
`;
|
|
75
95
|
|
|
96
|
+
const TopicAndTitle = styled.div`
|
|
97
|
+
grid-area: topicAndTitle;
|
|
98
|
+
margin-top: ${spacing.xxsmall};
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
interface StyledImageProps {
|
|
102
|
+
imageSize: 'normal' | 'compact';
|
|
103
|
+
}
|
|
104
|
+
|
|
76
105
|
export interface ListResourceProps {
|
|
77
106
|
link: string;
|
|
78
107
|
title: string;
|
|
@@ -88,22 +117,18 @@ const ListResource = ({ link, title, tags, resourceImage, topics, description, a
|
|
|
88
117
|
|
|
89
118
|
return (
|
|
90
119
|
<ResourceWrapper to={link}>
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
<ResourceDescription>{description}</ResourceDescription>
|
|
104
|
-
</Row>
|
|
105
|
-
)}
|
|
106
|
-
</ResourceInfoWrapper>
|
|
120
|
+
<StyledImageWrapper imageSize={showDescription ? 'normal' : 'compact'}>
|
|
121
|
+
<StyledImage alt={resourceImage.alt} src={resourceImage.src} />
|
|
122
|
+
</StyledImageWrapper>
|
|
123
|
+
<TopicAndTitle>
|
|
124
|
+
<ResourceTitle>{title}</ResourceTitle>
|
|
125
|
+
<TopicList topics={topics} />
|
|
126
|
+
</TopicAndTitle>
|
|
127
|
+
{showDescription && <ResourceDescription>{description}</ResourceDescription>}
|
|
128
|
+
<TagsandActionMenu>
|
|
129
|
+
{tags && CompressedTags(tags)}
|
|
130
|
+
{actionMenu}
|
|
131
|
+
</TagsandActionMenu>
|
|
107
132
|
</ResourceWrapper>
|
|
108
133
|
);
|
|
109
134
|
};
|
|
@@ -31,6 +31,7 @@ export const ResourceTitle = styled.h2`
|
|
|
31
31
|
-webkit-line-clamp: 1;
|
|
32
32
|
line-clamp: 1;
|
|
33
33
|
-webkit-box-orient: vertical;
|
|
34
|
+
grid-area: resourceTitle;
|
|
34
35
|
`;
|
|
35
36
|
|
|
36
37
|
const StyledTagList = styled.ul`
|
|
@@ -57,6 +58,7 @@ const StyledTopicList = styled.ul`
|
|
|
57
58
|
margin: 0;
|
|
58
59
|
padding: 0;
|
|
59
60
|
overflow: hidden;
|
|
61
|
+
grid-area: topicList;
|
|
60
62
|
`;
|
|
61
63
|
|
|
62
64
|
const StyledTopicListElement = styled.li`
|
|
@@ -100,9 +102,8 @@ export const TagList = ({ tags }: TagListProps) => {
|
|
|
100
102
|
);
|
|
101
103
|
};
|
|
102
104
|
|
|
103
|
-
export const
|
|
104
|
-
const
|
|
105
|
-
const slicedTags = tags.slice(0, 3);
|
|
105
|
+
export const CompressedTags = (tags: string[]) => {
|
|
106
|
+
const visibleTags = tags.slice(0, 3);
|
|
106
107
|
const remainingTags = tags.slice(3, tags.length).map((tag) => {
|
|
107
108
|
return {
|
|
108
109
|
text: '#' + tag,
|
|
@@ -112,10 +113,10 @@ export const CompressTagsLength = (tags: string[]) => {
|
|
|
112
113
|
|
|
113
114
|
return (
|
|
114
115
|
<>
|
|
115
|
-
<TagList tags={
|
|
116
|
+
<TagList tags={visibleTags} />
|
|
116
117
|
{remainingTags.length > 0 && (
|
|
117
118
|
<MenuButton hideMenuIcon={true} menuItems={remainingTags}>
|
|
118
|
-
<TagCounterWrapper
|
|
119
|
+
<TagCounterWrapper>{`+${remainingTags.length}`}</TagCounterWrapper>
|
|
119
120
|
</MenuButton>
|
|
120
121
|
)}
|
|
121
122
|
</>
|
|
@@ -132,10 +133,8 @@ export const TopicList = ({ topics }: TopicListProps) => {
|
|
|
132
133
|
<StyledTopicList>
|
|
133
134
|
{topics.map((topic, i) => (
|
|
134
135
|
<StyledTopicListElement key={topic}>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
{i !== topics.length - 1 && <StyledTopicDivider>•</StyledTopicDivider>}
|
|
138
|
-
</>
|
|
136
|
+
{topic}
|
|
137
|
+
{i !== topics.length - 1 && <StyledTopicDivider>•</StyledTopicDivider>}
|
|
139
138
|
</StyledTopicListElement>
|
|
140
139
|
))}
|
|
141
140
|
</StyledTopicList>
|
|
@@ -37,6 +37,7 @@ type Props = {
|
|
|
37
37
|
invertedStyle?: boolean;
|
|
38
38
|
toggleAdditionalResources: () => void;
|
|
39
39
|
onToggleAddToFavorites: (id: string | number, add: string) => void;
|
|
40
|
+
showAddToFavoriteButton: boolean;
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
const ResourceGroup = ({
|
|
@@ -47,6 +48,7 @@ const ResourceGroup = ({
|
|
|
47
48
|
contentType,
|
|
48
49
|
invertedStyle,
|
|
49
50
|
onToggleAddToFavorites,
|
|
51
|
+
showAddToFavoriteButton = false,
|
|
50
52
|
}: Props & ResourceListProps) => (
|
|
51
53
|
<Wrapper>
|
|
52
54
|
{title && (
|
|
@@ -62,6 +64,7 @@ const ResourceGroup = ({
|
|
|
62
64
|
contentType={contentType}
|
|
63
65
|
resources={resources}
|
|
64
66
|
onToggleAddToFavorites={onToggleAddToFavorites}
|
|
67
|
+
showAddToFavoriteButton={showAddToFavoriteButton}
|
|
65
68
|
/>
|
|
66
69
|
) : null}
|
|
67
70
|
</Wrapper>
|
|
@@ -230,7 +230,7 @@ type Props = {
|
|
|
230
230
|
access?: 'teacher';
|
|
231
231
|
isFavorite?: boolean;
|
|
232
232
|
onToggleAddToFavorites: (id: string, add: boolean) => void;
|
|
233
|
-
|
|
233
|
+
showAddToFavoriteButton: boolean;
|
|
234
234
|
};
|
|
235
235
|
|
|
236
236
|
const ResourceItem = ({
|
|
@@ -247,7 +247,7 @@ const ResourceItem = ({
|
|
|
247
247
|
access,
|
|
248
248
|
onToggleAddToFavorites,
|
|
249
249
|
isFavorite,
|
|
250
|
-
|
|
250
|
+
showAddToFavoriteButton,
|
|
251
251
|
}: Props & Resource) => {
|
|
252
252
|
const { t } = useTranslation();
|
|
253
253
|
const hidden = additional ? !showAdditionalResources : false;
|
|
@@ -301,7 +301,7 @@ const ResourceItem = ({
|
|
|
301
301
|
)}
|
|
302
302
|
</>
|
|
303
303
|
)}
|
|
304
|
-
{
|
|
304
|
+
{showAddToFavoriteButton && (
|
|
305
305
|
<ArticleFavoritesButton
|
|
306
306
|
isFavorite={isFavorite}
|
|
307
307
|
articleId={id}
|
|
@@ -49,7 +49,7 @@ export type ResourceListProps = {
|
|
|
49
49
|
title?: string;
|
|
50
50
|
showAdditionalResources?: boolean;
|
|
51
51
|
onToggleAddToFavorites: (id: string, add: boolean) => void;
|
|
52
|
-
|
|
52
|
+
showAddToFavoriteButton: boolean;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const ResourceList = ({
|
|
@@ -59,7 +59,7 @@ const ResourceList = ({
|
|
|
59
59
|
contentType,
|
|
60
60
|
title,
|
|
61
61
|
showAdditionalResources,
|
|
62
|
-
|
|
62
|
+
showAddToFavoriteButton,
|
|
63
63
|
}: ResourceListProps) => {
|
|
64
64
|
const { t } = useTranslation();
|
|
65
65
|
const renderAdditionalResourceTrigger =
|
|
@@ -76,7 +76,7 @@ const ResourceList = ({
|
|
|
76
76
|
key={id}
|
|
77
77
|
contentType={contentType}
|
|
78
78
|
showAdditionalResources={showAdditionalResources}
|
|
79
|
-
|
|
79
|
+
showAddToFavoriteButton={showAddToFavoriteButton}
|
|
80
80
|
onToggleAddToFavorites={onToggleAddToFavorites}
|
|
81
81
|
{...resource}
|
|
82
82
|
contentTypeDescription={
|
|
@@ -1007,10 +1007,6 @@ const messages = {
|
|
|
1007
1007
|
terms: 'terms of use',
|
|
1008
1008
|
feide: 'We have retrieved this information from Feide',
|
|
1009
1009
|
newFavourite: 'Recently favourited',
|
|
1010
|
-
resource: {
|
|
1011
|
-
addToMyNdla: 'Add to My NDLA',
|
|
1012
|
-
addedToMyNdla: 'Added to My NDLA',
|
|
1013
|
-
},
|
|
1014
1010
|
storageInfo: {
|
|
1015
1011
|
title: 'How to save your favourite resources from NDLA',
|
|
1016
1012
|
text: 'When you wish to save a resource, you can do so by clicking the heart on the top right corner of the page. You will then get an option to store the resource in a folder',
|
|
@@ -1024,6 +1020,10 @@ const messages = {
|
|
|
1024
1020
|
text: 'When you save a resource, you will have the option to tag it with a keyword. This tag can be used to find the resource across folders. By selecting my tags on the menu to the left, you will see all the tags your have used. You can also see which resources are tagget with which keyword.',
|
|
1025
1021
|
},
|
|
1026
1022
|
},
|
|
1023
|
+
resource: {
|
|
1024
|
+
addToMyNdla: 'Add to My NDLA',
|
|
1025
|
+
addedToMyNdla: 'Added to My NDLA',
|
|
1026
|
+
},
|
|
1027
1027
|
},
|
|
1028
1028
|
snackbar: {
|
|
1029
1029
|
close: 'Close notification',
|
|
@@ -1005,10 +1005,6 @@ const messages = {
|
|
|
1005
1005
|
terms: 'vilkår for bruk',
|
|
1006
1006
|
newFavourite: 'Nylig lagt til',
|
|
1007
1007
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1008
|
-
resource: {
|
|
1009
|
-
addToMyNdla: 'Legg i Min NDLA',
|
|
1010
|
-
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1011
|
-
},
|
|
1012
1008
|
storageInfo: {
|
|
1013
1009
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1014
1010
|
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på hjertet øverst til høyre på siden. Du vil da få mulighet til å lagre ressursen i en mappe.',
|
|
@@ -1022,6 +1018,10 @@ const messages = {
|
|
|
1022
1018
|
text: 'Når du lagrer en ressurs får du mulighet til å tagge ressursen med et nøkkelord. Du kan senere bruke taggene til å finne tilbake til ressurser på tvers av mapper. Ved å velge mine tagger i venstremenyen får du oversikt over alle taggene du har brukt og du kan også her se hvilke ressurser som du har tagget med det bestemte nøkkelordet.',
|
|
1023
1019
|
},
|
|
1024
1020
|
},
|
|
1021
|
+
resource: {
|
|
1022
|
+
addToMyNdla: 'Legg i Min NDLA',
|
|
1023
|
+
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1024
|
+
},
|
|
1025
1025
|
},
|
|
1026
1026
|
snackbar: {
|
|
1027
1027
|
close: 'Lukk melding',
|
|
@@ -1006,10 +1006,6 @@ const messages = {
|
|
|
1006
1006
|
terms: 'vilkår for bruk',
|
|
1007
1007
|
newFavourite: 'Nylig lagt til',
|
|
1008
1008
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1009
|
-
resource: {
|
|
1010
|
-
addToMyNdla: 'Legg i Min NDLA',
|
|
1011
|
-
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1012
|
-
},
|
|
1013
1009
|
storageInfo: {
|
|
1014
1010
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1015
1011
|
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på hjertet øverst til høyre på siden. Du vil da få mulighet til å lagre ressursen i en mappe.',
|
|
@@ -1023,6 +1019,10 @@ const messages = {
|
|
|
1023
1019
|
text: 'Når du lagrer en ressurs får du mulighet til å tagge ressursen med et nøkkelord. Du kan senere bruke taggene til å finne tilbake til ressurser på tvers av mapper. Ved å velge mine tagger i venstremenyen får du oversikt over alle taggene du har brukt og du kan også her se hvilke ressurser som du har tagget med det bestemte nøkkelordet.',
|
|
1024
1020
|
},
|
|
1025
1021
|
},
|
|
1022
|
+
resource: {
|
|
1023
|
+
addToMyNdla: 'Legg i Min NDLA',
|
|
1024
|
+
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1025
|
+
},
|
|
1026
1026
|
},
|
|
1027
1027
|
snackbar: {
|
|
1028
1028
|
close: 'Lukk melding',
|
|
@@ -1005,10 +1005,6 @@ const messages = {
|
|
|
1005
1005
|
terms: 'vilkår for bruk',
|
|
1006
1006
|
newFavourite: 'Nylig lagt til',
|
|
1007
1007
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1008
|
-
resource: {
|
|
1009
|
-
addToMyNdla: 'Legg i Min NDLA',
|
|
1010
|
-
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1011
|
-
},
|
|
1012
1008
|
storageInfo: {
|
|
1013
1009
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1014
1010
|
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på hjertet øverst til høyre på siden. Du vil da få mulighet til å lagre ressursen i en mappe.',
|
|
@@ -1022,6 +1018,10 @@ const messages = {
|
|
|
1022
1018
|
text: 'Når du lagrer en ressurs får du mulighet til å tagge ressursen med et nøkkelord. Du kan senere bruke taggene til å finne tilbake til ressurser på tvers av mapper. Ved å velge mine tagger i venstremenyen får du oversikt over alle taggene du har brukt og du kan også her se hvilke ressurser som du har tagget med det bestemte nøkkelordet.',
|
|
1023
1019
|
},
|
|
1024
1020
|
},
|
|
1021
|
+
resource: {
|
|
1022
|
+
addToMyNdla: 'Legg i Min NDLA',
|
|
1023
|
+
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1024
|
+
},
|
|
1025
1025
|
},
|
|
1026
1026
|
snackbar: {
|
|
1027
1027
|
close: 'Lukk melding',
|
|
@@ -1005,10 +1005,6 @@ const messages = {
|
|
|
1005
1005
|
terms: 'vilkår for bruk',
|
|
1006
1006
|
newFavourite: 'Nylig lagt til',
|
|
1007
1007
|
feide: 'Dette henter vi om deg fra Feide',
|
|
1008
|
-
resource: {
|
|
1009
|
-
addToMyNdla: 'Legg i Min NDLA',
|
|
1010
|
-
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1011
|
-
},
|
|
1012
1008
|
storageInfo: {
|
|
1013
1009
|
title: 'Slik lagrer du dine favorittressurser fra NDLA',
|
|
1014
1010
|
text: 'Når du ønsker å lagre en ressurs, kan du gjøre dette ved å klikke på hjertet øverst til høyre på siden. Du vil da få mulighet til å lagre ressursen i en mappe.',
|
|
@@ -1022,6 +1018,10 @@ const messages = {
|
|
|
1022
1018
|
text: 'Når du lagrer en ressurs får du mulighet til å tagge ressursen med et nøkkelord. Du kan senere bruke taggene til å finne tilbake til ressurser på tvers av mapper. Ved å velge mine tagger i venstremenyen får du oversikt over alle taggene du har brukt og du kan også her se hvilke ressurser som du har tagget med det bestemte nøkkelordet.',
|
|
1023
1019
|
},
|
|
1024
1020
|
},
|
|
1021
|
+
resource: {
|
|
1022
|
+
addToMyNdla: 'Legg i Min NDLA',
|
|
1023
|
+
addedToMyNdla: 'Lagt i Min NDLA',
|
|
1024
|
+
},
|
|
1025
1025
|
},
|
|
1026
1026
|
snackbar: {
|
|
1027
1027
|
close: 'Lukk melding',
|