@ndla/ui 30.1.0 → 30.2.1

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.
Files changed (333) hide show
  1. package/es/Article/ArticleHeaderWrapper.js +75 -112
  2. package/es/Footer/FooterLinks.js +13 -10
  3. package/es/Frontpage/FrontpageFilm.js +11 -8
  4. package/es/Frontpage/FrontpageMultidisciplinarySubject.js +13 -10
  5. package/es/Frontpage/FrontpageToolbox.js +11 -8
  6. package/es/LearningPaths/LearningPathLastStepNavigation.js +11 -8
  7. package/es/LearningPaths/LearningPathMenuAside.js +13 -10
  8. package/es/LearningPaths/LearningPathMobileHeader.js +8 -6
  9. package/es/LearningPaths/LearningPathMobileStepInfo.js +8 -5
  10. package/es/Masthead/MastheadSearchModal.js +10 -7
  11. package/es/Messages/MessageBox.js +11 -12
  12. package/es/MyNdla/Resource/Folder.js +118 -57
  13. package/es/NDLAFilm/CategorySelect.js +106 -146
  14. package/es/Resource/BlockResource.js +45 -30
  15. package/es/Resource/ListResource.js +46 -41
  16. package/es/Resource/resourceComponents.js +29 -34
  17. package/es/SearchTypeResult/ActiveFilterContent.js +9 -6
  18. package/es/SearchTypeResult/SearchHeader.js +14 -12
  19. package/es/SearchTypeResult/SearchNotionsResult.js +5 -6
  20. package/es/SearchTypeResult/SearchTypeHeader.js +17 -15
  21. package/es/Subject/SubjectCarousel.js +11 -8
  22. package/es/ToolboxPage/ToolboxInfo.js +9 -6
  23. package/es/User/UserInfo.js +23 -2
  24. package/es/User/parseUserObject.js +22 -12
  25. package/es/locale/messages-en.js +5 -1
  26. package/es/locale/messages-nb.js +5 -1
  27. package/es/locale/messages-nn.js +5 -1
  28. package/es/locale/messages-se.js +33 -29
  29. package/es/locale/messages-sma.js +5 -1
  30. package/es/utils/createUniversalPortal.js +1 -1
  31. package/lib/Animation/DisplayOnPageYOffset.d.ts +2 -2
  32. package/lib/Animation/Fade.d.ts +2 -2
  33. package/lib/Article/Article.d.ts +3 -3
  34. package/lib/Article/ArticleAccessMessage.d.ts +1 -1
  35. package/lib/Article/ArticleByline.d.ts +1 -1
  36. package/lib/Article/ArticleContent.d.ts +1 -1
  37. package/lib/Article/ArticleFootNotes.d.ts +1 -1
  38. package/lib/Article/ArticleHeaderWrapper.d.ts +4 -5
  39. package/lib/Article/ArticleHeaderWrapper.js +73 -108
  40. package/lib/Article/ArticleNotions.d.ts +1 -1
  41. package/lib/Article/ArticleSideBar.d.ts +1 -1
  42. package/lib/Aside/Aside.d.ts +1 -1
  43. package/lib/AudioPlayer/AudioPlayer.d.ts +1 -1
  44. package/lib/AudioPlayer/Controls.d.ts +1 -1
  45. package/lib/AudioPlayer/SpeechControl.d.ts +1 -1
  46. package/lib/AuthorInfo/AuthorInfo.d.ts +1 -1
  47. package/lib/BannerCard/BannerCard.d.ts +1 -1
  48. package/lib/BlogPosts/BlogPost.d.ts +1 -1
  49. package/lib/BlogPosts/BlogPostWrapper.d.ts +1 -1
  50. package/lib/Breadcrumb/ActionBreadcrumb.d.ts +1 -1
  51. package/lib/Breadcrumb/Breadcrumb.d.ts +1 -1
  52. package/lib/Breadcrumb/HeaderBreadcrumb.d.ts +1 -1
  53. package/lib/Breadcrumb/HomeBreadcrumb.d.ts +1 -1
  54. package/lib/Breadcrumblist/Breadcrumblist.d.ts +1 -1
  55. package/lib/CompetenceGoalTab/CompetenceGoalItem.d.ts +1 -1
  56. package/lib/CompetenceGoalTab/CompetenceGoalTab.d.ts +1 -1
  57. package/lib/CompetenceGoalTab/CompetenceItem.d.ts +1 -1
  58. package/lib/CompetenceGoalTab/SearchButton.d.ts +1 -1
  59. package/lib/CompetenceGoals/CompetenceGoalsDialog.d.ts +1 -1
  60. package/lib/ComponentCursor/ComponentCursor.d.ts +1 -1
  61. package/lib/ContentCard/ContentCard.d.ts +1 -1
  62. package/lib/ContentLoader/index.d.ts +1 -1
  63. package/lib/ContentPlaceholder/ContentPlaceholder.d.ts +1 -1
  64. package/lib/ContentTypeBadge/ContentTypeBadge.d.ts +9 -9
  65. package/lib/CopyParagraphButton/CopyParagraphButton.d.ts +1 -1
  66. package/lib/CreatedBy/CreatedBy.d.ts +1 -1
  67. package/lib/Dialog/Dialog.d.ts +1 -1
  68. package/lib/ErrorMessage/ErrorMessage.d.ts +1 -1
  69. package/lib/ErrorMessage/ErrorResourceAccessDenied.d.ts +1 -1
  70. package/lib/FactBox/FactBox.d.ts +1 -1
  71. package/lib/Figure/Figure.d.ts +2 -2
  72. package/lib/Figure/FigureBylineExpandButton.d.ts +1 -1
  73. package/lib/Figure/FigureExpandButton.d.ts +1 -1
  74. package/lib/Figure/FigureLicense.d.ts +2 -2
  75. package/lib/Figure/FigureLicenseDialog.d.ts +1 -1
  76. package/lib/Figure/FigureOpenDialogButton.d.ts +1 -1
  77. package/lib/FileList/File.d.ts +1 -1
  78. package/lib/FileList/FileList.d.ts +1 -1
  79. package/lib/Filter/FilterButtons.d.ts +1 -1
  80. package/lib/Filter/FilterCarousel.d.ts +1 -1
  81. package/lib/Filter/FilterList.d.ts +1 -1
  82. package/lib/Filter/FilterListPhone.d.ts +1 -1
  83. package/lib/Filter/ToggleItem.d.ts +1 -1
  84. package/lib/Footer/EditorName.d.ts +1 -1
  85. package/lib/Footer/Footer.d.ts +1 -1
  86. package/lib/Footer/FooterAuth.d.ts +1 -1
  87. package/lib/Footer/FooterLinks.d.ts +3 -4
  88. package/lib/Footer/FooterLinks.js +12 -10
  89. package/lib/Footer/FooterPrivacy.d.ts +1 -1
  90. package/lib/Footer/FooterText.d.ts +1 -1
  91. package/lib/Footer/privacy_en.d.ts +1 -1
  92. package/lib/Footer/privacy_nb.d.ts +1 -1
  93. package/lib/Footer/privacy_nn.d.ts +1 -1
  94. package/lib/Frontpage/FrontpageAllSubjects.d.ts +1 -1
  95. package/lib/Frontpage/FrontpageFilm.d.ts +2 -4
  96. package/lib/Frontpage/FrontpageFilm.js +10 -8
  97. package/lib/Frontpage/FrontpageHeader.d.ts +1 -1
  98. package/lib/Frontpage/FrontpageInfo.d.ts +1 -1
  99. package/lib/Frontpage/FrontpageMultidisciplinarySubject.d.ts +7 -8
  100. package/lib/Frontpage/FrontpageMultidisciplinarySubject.js +12 -10
  101. package/lib/Frontpage/FrontpageProgramMenu.d.ts +1 -1
  102. package/lib/Frontpage/FrontpageSearch.d.ts +1 -1
  103. package/lib/Frontpage/FrontpageToolbox.d.ts +2 -4
  104. package/lib/Frontpage/FrontpageToolbox.js +10 -8
  105. package/lib/Frontpage/illustrations/Fellesfag.d.ts +1 -1
  106. package/lib/Frontpage/illustrations/FrontpageHeaderIllustration.d.ts +1 -1
  107. package/lib/Frontpage/illustrations/FrontpageIllustrations.d.ts +2 -2
  108. package/lib/Frontpage/illustrations/FrontpageSubjectIllustration.d.ts +1 -1
  109. package/lib/Frontpage/illustrations/MenuFellesfag.d.ts +1 -1
  110. package/lib/Frontpage/illustrations/MenuStudiespesialiserende.d.ts +1 -1
  111. package/lib/Frontpage/illustrations/MenuYrkesfag.d.ts +1 -1
  112. package/lib/Frontpage/illustrations/Studiespesialiserende.d.ts +1 -1
  113. package/lib/Frontpage/illustrations/Yrkesfag.d.ts +1 -1
  114. package/lib/Frontpage/illustrations/index.d.ts +6 -6
  115. package/lib/Hero/Hero.d.ts +8 -8
  116. package/lib/Image/Image.d.ts +2 -2
  117. package/lib/Image/ImageLink.d.ts +1 -1
  118. package/lib/Image/LazyLoadImage.d.ts +1 -1
  119. package/lib/InfoBlock/InfoBlock.d.ts +1 -1
  120. package/lib/InfoBox/InfoBox.d.ts +1 -1
  121. package/lib/InfoWidget/InfoWidget.d.ts +1 -1
  122. package/lib/LanguageSelector/LanguageSelector.d.ts +1 -1
  123. package/lib/LanguageSelector/LanguageSelectorContent.d.ts +1 -1
  124. package/lib/Layout/Content.d.ts +2 -2
  125. package/lib/Layout/LayoutItem.d.ts +1 -1
  126. package/lib/Layout/OneColumn.d.ts +1 -1
  127. package/lib/Layout/PageContainer.d.ts +1 -1
  128. package/lib/LearningPaths/LearningPathContent.d.ts +1 -1
  129. package/lib/LearningPaths/LearningPathInformation.d.ts +1 -1
  130. package/lib/LearningPaths/LearningPathLastStepNavigation.d.ts +3 -4
  131. package/lib/LearningPaths/LearningPathLastStepNavigation.js +10 -8
  132. package/lib/LearningPaths/LearningPathMenu.d.ts +1 -1
  133. package/lib/LearningPaths/LearningPathMenuAside.d.ts +2 -4
  134. package/lib/LearningPaths/LearningPathMenuAside.js +12 -10
  135. package/lib/LearningPaths/LearningPathMenuAsideCopyright.d.ts +1 -1
  136. package/lib/LearningPaths/LearningPathMenuContent.d.ts +1 -1
  137. package/lib/LearningPaths/LearningPathMenuIntro.d.ts +1 -1
  138. package/lib/LearningPaths/LearningPathMenuModalWrapper.d.ts +1 -1
  139. package/lib/LearningPaths/LearningPathMobileHeader.d.ts +2 -4
  140. package/lib/LearningPaths/LearningPathMobileHeader.js +7 -6
  141. package/lib/LearningPaths/LearningPathMobileStepInfo.d.ts +2 -4
  142. package/lib/LearningPaths/LearningPathMobileStepInfo.js +7 -5
  143. package/lib/LearningPaths/LearningPathSticky.d.ts +3 -3
  144. package/lib/LearningPaths/LearningPathWrapper.d.ts +1 -1
  145. package/lib/Logo/Logo.d.ts +1 -1
  146. package/lib/Logo/SvgLogo.d.ts +1 -1
  147. package/lib/Masthead/Masthead.d.ts +2 -2
  148. package/lib/Masthead/MastheadAuthModal.d.ts +1 -1
  149. package/lib/Masthead/MastheadSearchModal.d.ts +3 -4
  150. package/lib/Masthead/MastheadSearchModal.js +9 -7
  151. package/lib/Masthead/SkipToMainContent.d.ts +1 -1
  152. package/lib/MediaList/MediaList.d.ts +8 -8
  153. package/lib/Messages/MessageBanner.d.ts +1 -1
  154. package/lib/Messages/MessageBox.d.ts +2 -5
  155. package/lib/Messages/MessageBox.js +10 -14
  156. package/lib/Messages/MessageBoxTag.d.ts +1 -1
  157. package/lib/MultidisciplinarySubject/Illustrations.d.ts +7 -7
  158. package/lib/MultidisciplinarySubject/List.d.ts +1 -1
  159. package/lib/MultidisciplinarySubject/ListItem.d.ts +1 -1
  160. package/lib/MultidisciplinarySubject/MultidisciplinarySubject.d.ts +1 -1
  161. package/lib/MultidisciplinarySubject/MultidisciplinarySubjectHeader.d.ts +1 -1
  162. package/lib/MyNdla/Resource/Folder.d.ts +2 -2
  163. package/lib/MyNdla/Resource/Folder.js +115 -57
  164. package/lib/MyNdla/Resource/FolderInput.d.ts +1 -1
  165. package/lib/NDLAFilm/AboutNdlaFilm.d.ts +1 -1
  166. package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +1 -1
  167. package/lib/NDLAFilm/CategorySelect.d.ts +10 -5
  168. package/lib/NDLAFilm/CategorySelect.js +99 -145
  169. package/lib/NDLAFilm/FilmContentCard.d.ts +1 -1
  170. package/lib/NDLAFilm/FilmContentCardTags.d.ts +1 -1
  171. package/lib/NDLAFilm/FilmMovieList.d.ts +1 -1
  172. package/lib/NDLAFilm/FilmMovieSearch.d.ts +1 -1
  173. package/lib/NDLAFilm/FilmSlideshow.d.ts +1 -1
  174. package/lib/NDLAFilm/MovieGrid.d.ts +1 -1
  175. package/lib/NDLAFilm/NavigationArrow.d.ts +2 -2
  176. package/lib/NDLAFilm/SlideshowIndicator.d.ts +1 -1
  177. package/lib/NDLAFilm/VisualElement.d.ts +1 -1
  178. package/lib/NDLAFilm/filmStyles.d.ts +2 -2
  179. package/lib/Navigation/NavigationBox.d.ts +1 -1
  180. package/lib/Navigation/NavigationHeading.d.ts +1 -1
  181. package/lib/Navigation/NavigationTopicAbout.d.ts +1 -1
  182. package/lib/NoContentBox/NoContentBox.d.ts +1 -1
  183. package/lib/Notion/ConceptNotion.d.ts +1 -1
  184. package/lib/Notion/FigureNotion.d.ts +1 -1
  185. package/lib/Notion/Notion.d.ts +1 -1
  186. package/lib/Notion/NotionImage.d.ts +1 -1
  187. package/lib/Notion/NotionVisualElement.d.ts +1 -1
  188. package/lib/Portrait/Portrait.d.ts +1 -1
  189. package/lib/Programme/Programme.d.ts +1 -1
  190. package/lib/Programme/ProgrammeSubjects.d.ts +1 -1
  191. package/lib/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
  192. package/lib/RelatedArticleList/RelatedArticleList.d.ts +2 -2
  193. package/lib/Resource/BlockResource.d.ts +2 -2
  194. package/lib/Resource/BlockResource.js +44 -30
  195. package/lib/Resource/ListResource.d.ts +1 -1
  196. package/lib/Resource/ListResource.js +40 -36
  197. package/lib/Resource/resourceComponents.d.ts +7 -7
  198. package/lib/Resource/resourceComponents.js +28 -31
  199. package/lib/ResourceBox/ResourceBox.d.ts +1 -1
  200. package/lib/ResourceGroup/ResourceGroup.d.ts +1 -1
  201. package/lib/ResourceGroup/ResourceItem.d.ts +1 -1
  202. package/lib/ResourceGroup/ResourceList.d.ts +1 -1
  203. package/lib/ResourcesWrapper/ResourcesTitle.d.ts +1 -1
  204. package/lib/ResourcesWrapper/ResourcesTopicTitle.d.ts +1 -1
  205. package/lib/ResourcesWrapper/ResourcesWrapper.d.ts +1 -1
  206. package/lib/Search/ActiveFilterContent.d.ts +2 -2
  207. package/lib/Search/ActiveFilters.d.ts +1 -1
  208. package/lib/Search/ContentTypeResult.d.ts +1 -1
  209. package/lib/Search/ContentTypeResultStyles.d.ts +6 -6
  210. package/lib/Search/LoadingWrapper.d.ts +1 -1
  211. package/lib/Search/SearchField.d.ts +1 -1
  212. package/lib/Search/SearchFieldForm.d.ts +1 -1
  213. package/lib/Search/SearchResult.d.ts +2 -2
  214. package/lib/Search/SearchResultSleeve.d.ts +1 -1
  215. package/lib/Search/ToggleSearchButton.d.ts +1 -1
  216. package/lib/SearchTypeResult/ActiveFilterContent.d.ts +3 -4
  217. package/lib/SearchTypeResult/ActiveFilterContent.js +8 -6
  218. package/lib/SearchTypeResult/ActiveFilters.d.ts +1 -1
  219. package/lib/SearchTypeResult/PopupFilter.d.ts +1 -1
  220. package/lib/SearchTypeResult/ResultNavigation.d.ts +1 -1
  221. package/lib/SearchTypeResult/SearchFieldHeader.d.ts +1 -1
  222. package/lib/SearchTypeResult/SearchFilterContent.d.ts +1 -1
  223. package/lib/SearchTypeResult/SearchHeader.d.ts +3 -4
  224. package/lib/SearchTypeResult/SearchHeader.js +13 -12
  225. package/lib/SearchTypeResult/SearchItem.d.ts +1 -1
  226. package/lib/SearchTypeResult/SearchItemList.d.ts +1 -1
  227. package/lib/SearchTypeResult/SearchItems.d.ts +1 -1
  228. package/lib/SearchTypeResult/SearchNotionItem.d.ts +1 -1
  229. package/lib/SearchTypeResult/SearchNotionsResult.d.ts +3 -4
  230. package/lib/SearchTypeResult/SearchNotionsResult.js +5 -6
  231. package/lib/SearchTypeResult/SearchSubjectItem.d.ts +1 -1
  232. package/lib/SearchTypeResult/SearchSubjectResult.d.ts +1 -1
  233. package/lib/SearchTypeResult/SearchTypeHeader.d.ts +1 -2
  234. package/lib/SearchTypeResult/SearchTypeHeader.js +15 -12
  235. package/lib/SearchTypeResult/SearchTypeResult.d.ts +1 -1
  236. package/lib/SearchTypeResult/SearchViewType.d.ts +1 -1
  237. package/lib/SearchTypeResult/components/ItemContexts.d.ts +1 -1
  238. package/lib/SearchTypeResult/components/ItemResourceHeader.d.ts +1 -1
  239. package/lib/SearchTypeResult/components/ItemTopicHeader.d.ts +1 -1
  240. package/lib/SearchTypeResult/components/SubjectFilters.d.ts +1 -1
  241. package/lib/SectionHeading/SectionHeading.d.ts +1 -1
  242. package/lib/SnackBar/DefaultSnackbar.d.ts +1 -1
  243. package/lib/SnackBar/SnackbarProvider.d.ts +2 -2
  244. package/lib/Subject/Subject.d.ts +8 -8
  245. package/lib/Subject/SubjectAbout.d.ts +1 -1
  246. package/lib/Subject/SubjectArchive.d.ts +1 -1
  247. package/lib/Subject/SubjectBanner.d.ts +1 -1
  248. package/lib/Subject/SubjectCarousel.d.ts +2 -4
  249. package/lib/Subject/SubjectCarousel.js +10 -8
  250. package/lib/Subject/SubjectHeader.d.ts +1 -1
  251. package/lib/Subject/SubjectLinks.d.ts +1 -1
  252. package/lib/Subject/SubjectNewContent.d.ts +1 -1
  253. package/lib/Subject/SubjectShortcuts.d.ts +1 -1
  254. package/lib/Subject/SubjectSocial.d.ts +2 -2
  255. package/lib/Table/Table.d.ts +1 -1
  256. package/lib/TagSelector/Control.d.ts +1 -1
  257. package/lib/TagSelector/DropdownIndicator.d.ts +1 -1
  258. package/lib/TagSelector/Input.d.ts +1 -1
  259. package/lib/TagSelector/Menu.d.ts +1 -1
  260. package/lib/TagSelector/MenuList.d.ts +2 -2
  261. package/lib/TagSelector/Option.d.ts +1 -1
  262. package/lib/TagSelector/SelectContainer.d.ts +1 -1
  263. package/lib/TagSelector/TagSelector.d.ts +1 -1
  264. package/lib/TagSelector/ValueButton.d.ts +2 -2
  265. package/lib/ToolboxPage/ToolboxInfo.d.ts +3 -4
  266. package/lib/ToolboxPage/ToolboxInfo.js +8 -6
  267. package/lib/Topic/Loader.d.ts +1 -1
  268. package/lib/Topic/Topic.d.ts +1 -1
  269. package/lib/TopicIntroductionList/TopicIntroduction.d.ts +1 -1
  270. package/lib/TopicIntroductionList/TopicIntroductionList.d.ts +1 -1
  271. package/lib/TopicIntroductionList/TopicIntroductionShortcuts.d.ts +1 -1
  272. package/lib/TopicIntroductionList/TopicShortcutItem.d.ts +1 -1
  273. package/lib/Translation/Translation.d.ts +1 -1
  274. package/lib/Translation/TranslationBox.d.ts +1 -1
  275. package/lib/Translation/TranslationLine.d.ts +1 -1
  276. package/lib/TreeStructure/AddFolderButton.d.ts +1 -1
  277. package/lib/TreeStructure/FolderItem.d.ts +1 -1
  278. package/lib/TreeStructure/FolderItems.d.ts +1 -1
  279. package/lib/TreeStructure/NavigationLink.d.ts +1 -1
  280. package/lib/TreeStructure/TreeStructure.d.ts +1 -1
  281. package/lib/TreeStructure/helperFunctions.d.ts +1 -1
  282. package/lib/User/AuthModal.d.ts +1 -1
  283. package/lib/User/UserInfo.d.ts +1 -1
  284. package/lib/User/UserInfo.js +23 -2
  285. package/lib/User/apiTypes.d.ts +10 -2
  286. package/lib/User/parseUserObject.d.ts +2 -1
  287. package/lib/User/parseUserObject.js +22 -12
  288. package/lib/locale/LocaleProvider.d.ts +1 -1
  289. package/lib/locale/messages-en.d.ts +4 -0
  290. package/lib/locale/messages-en.js +5 -1
  291. package/lib/locale/messages-nb.d.ts +4 -0
  292. package/lib/locale/messages-nb.js +5 -1
  293. package/lib/locale/messages-nn.d.ts +4 -0
  294. package/lib/locale/messages-nn.js +5 -1
  295. package/lib/locale/messages-se.d.ts +4 -0
  296. package/lib/locale/messages-se.js +33 -29
  297. package/lib/locale/messages-sma.d.ts +4 -0
  298. package/lib/locale/messages-sma.js +5 -1
  299. package/lib/utils/createUniversalPortal.d.ts +1 -1
  300. package/lib/utils/createUniversalPortal.js +1 -1
  301. package/package.json +10 -10
  302. package/src/Article/ArticleHeaderWrapper.tsx +53 -66
  303. package/src/Footer/FooterLinks.tsx +43 -40
  304. package/src/Frontpage/FrontpageFilm.tsx +20 -17
  305. package/src/Frontpage/FrontpageMultidisciplinarySubject.tsx +33 -30
  306. package/src/Frontpage/FrontpageToolbox.tsx +21 -18
  307. package/src/LearningPaths/LearningPathLastStepNavigation.tsx +32 -29
  308. package/src/LearningPaths/LearningPathMenuAside.tsx +25 -29
  309. package/src/LearningPaths/LearningPathMobileHeader.tsx +11 -8
  310. package/src/LearningPaths/LearningPathMobileStepInfo.tsx +13 -10
  311. package/src/Masthead/MastheadSearchModal.tsx +36 -35
  312. package/src/Messages/MessageBox.tsx +2 -3
  313. package/src/MyNdla/Resource/Folder.tsx +118 -84
  314. package/src/NDLAFilm/CategorySelect.tsx +77 -97
  315. package/src/Resource/BlockResource.tsx +34 -28
  316. package/src/Resource/ListResource.tsx +76 -74
  317. package/src/Resource/resourceComponents.tsx +15 -20
  318. package/src/SearchTypeResult/ActiveFilterContent.tsx +18 -15
  319. package/src/SearchTypeResult/SearchHeader.tsx +4 -4
  320. package/src/SearchTypeResult/SearchNotionsResult.tsx +2 -3
  321. package/src/SearchTypeResult/SearchTypeHeader.tsx +48 -45
  322. package/src/Subject/SubjectCarousel.tsx +93 -96
  323. package/src/ToolboxPage/ToolboxInfo.tsx +19 -16
  324. package/src/User/UserInfo.tsx +22 -0
  325. package/src/User/__tests__/parseUserObject-test.ts +1 -0
  326. package/src/User/apiTypes.ts +11 -2
  327. package/src/User/parseUserObject.ts +17 -11
  328. package/src/locale/messages-en.ts +4 -0
  329. package/src/locale/messages-nb.ts +4 -0
  330. package/src/locale/messages-nn.ts +4 -0
  331. package/src/locale/messages-se.ts +32 -28
  332. package/src/locale/messages-sma.ts +4 -0
  333. package/src/utils/createUniversalPortal.tsx +1 -6
@@ -6,16 +6,15 @@
6
6
  *
7
7
  */
8
8
 
9
- import React, { Component, ComponentType, ReactNode } from 'react';
9
+ import React, { ComponentType, ReactNode, useEffect, useState } from 'react';
10
10
  import BEMHelper from 'react-bem-helper';
11
- import { withTranslation, WithTranslation } from 'react-i18next';
11
+ import { useTranslation } from 'react-i18next';
12
12
  import Button from '@ndla/button';
13
13
  import { isMobile } from 'react-device-detect';
14
14
  import { fonts, colors } from '@ndla/core';
15
15
 
16
16
  import styled from '@emotion/styled';
17
17
  import { FooterHeaderIcon } from '@ndla/icons/common';
18
- // @ts-ignore
19
18
  import CompetenceGoalsDialog from '../CompetenceGoals/CompetenceGoalsDialog';
20
19
 
21
20
  const classes = new BEMHelper({
@@ -40,12 +39,11 @@ const CompetenceWrapper = styled.div`
40
39
  `;
41
40
 
42
41
  const CompetenceBadge = styled.span`
43
- display: inline-block;
42
+ display: inline-flex;
44
43
  background: ${colors.brand.greyLighter};
45
44
  border-radius: 36px;
46
45
  font-weight: ${fonts.weight.semibold};
47
46
  ${fonts.sizes('12px', '15px')};
48
- display: inline-flex;
49
47
  align-items: center;
50
48
  color: ${colors.text.primary};
51
49
  font-family: ${fonts.sans};
@@ -77,19 +75,11 @@ type Props = {
77
75
  children: ReactNode;
78
76
  };
79
77
 
80
- interface State {
81
- isOpen: boolean;
82
- }
83
-
84
- class ArticleHeaderWrapper extends Component<Props & WithTranslation, State> {
85
- constructor(props: Props & WithTranslation) {
86
- super(props);
87
- this.state = { isOpen: false };
88
- this.closeDialog = this.closeDialog.bind(this);
89
- this.openDialog = this.openDialog.bind(this);
90
- }
78
+ const ArticleHeaderWrapper = ({ children, competenceGoals, competenceGoalTypes }: Props) => {
79
+ const [isOpen, setIsOpen] = useState(false);
80
+ const { t } = useTranslation();
91
81
 
92
- componentDidMount() {
82
+ useEffect(() => {
93
83
  if (isMobile) {
94
84
  const heroContentList: NodeListOf<HTMLElement> = document.querySelectorAll('.c-article__header');
95
85
  if (heroContentList.length === 1) {
@@ -97,58 +87,55 @@ class ArticleHeaderWrapper extends Component<Props & WithTranslation, State> {
97
87
  window.scrollBy(0, heroContentList[0].offsetTop - 120); // Adjust for header
98
88
  }
99
89
  }
100
- }
90
+ }, []);
101
91
 
102
- openDialog() {
103
- this.setState({ isOpen: true });
104
- }
92
+ const openDialog = () => {
93
+ setIsOpen(true);
94
+ };
105
95
 
106
- closeDialog() {
107
- this.setState({ isOpen: false });
108
- }
96
+ const closeDialog = () => {
97
+ setIsOpen(false);
98
+ };
109
99
 
110
- render() {
111
- const { children, competenceGoals, competenceGoalTypes, t } = this.props;
112
- if (!competenceGoals) {
113
- return <div {...classes('header')}>{children}</div>;
114
- }
100
+ if (!competenceGoals) {
101
+ return <div {...classes('header')}>{children}</div>;
102
+ }
115
103
 
116
- const dialog =
117
- typeof competenceGoals === 'function' ? (
118
- competenceGoals({
119
- Dialog: CompetenceGoalsDialog,
120
- dialogProps: {
121
- isOpen: this.state.isOpen,
122
- onClose: this.closeDialog,
123
- },
124
- })
125
- ) : (
126
- <CompetenceGoalsDialog onClose={this.closeDialog} isOpen={this.state.isOpen}>
127
- {competenceGoals}
128
- </CompetenceGoalsDialog>
129
- );
130
- return (
131
- <div {...classes('header')}>
132
- {children}
133
- <CompetenceWrapper>
134
- {competenceGoalTypes &&
135
- competenceGoalTypes.map((type) => (
136
- <CompetenceBadge key={type}>
137
- <FooterHeaderIcon />
138
- <CompetenceBadgeText>{type}</CompetenceBadgeText>
139
- </CompetenceBadge>
140
- ))}
141
- <CompetenceButtonWrapper addSpace={competenceGoalTypes && competenceGoalTypes.length > 0}>
142
- <OpenButton onClick={this.openDialog}>
143
- <FooterHeaderIcon />
144
- <CompetenceBadgeText>{t('competenceGoals.showCompetenceGoals')}</CompetenceBadgeText>
145
- </OpenButton>
146
- </CompetenceButtonWrapper>
147
- </CompetenceWrapper>
148
- {dialog}
149
- </div>
104
+ const dialog =
105
+ typeof competenceGoals === 'function' ? (
106
+ competenceGoals({
107
+ Dialog: CompetenceGoalsDialog,
108
+ dialogProps: {
109
+ isOpen: isOpen,
110
+ onClose: closeDialog,
111
+ },
112
+ })
113
+ ) : (
114
+ <CompetenceGoalsDialog onClose={closeDialog} isOpen={isOpen}>
115
+ {competenceGoals}
116
+ </CompetenceGoalsDialog>
150
117
  );
151
- }
152
- }
118
+ return (
119
+ <div {...classes('header')}>
120
+ {children}
121
+ <CompetenceWrapper>
122
+ {competenceGoalTypes &&
123
+ competenceGoalTypes.map((type) => (
124
+ <CompetenceBadge key={type}>
125
+ <FooterHeaderIcon />
126
+ <CompetenceBadgeText>{type}</CompetenceBadgeText>
127
+ </CompetenceBadge>
128
+ ))}
129
+ <CompetenceButtonWrapper addSpace={competenceGoalTypes && competenceGoalTypes.length > 0}>
130
+ <OpenButton onClick={openDialog}>
131
+ <FooterHeaderIcon />
132
+ <CompetenceBadgeText>{t('competenceGoals.showCompetenceGoals')}</CompetenceBadgeText>
133
+ </OpenButton>
134
+ </CompetenceButtonWrapper>
135
+ </CompetenceWrapper>
136
+ {dialog}
137
+ </div>
138
+ );
139
+ };
153
140
 
154
- export default withTranslation()(ArticleHeaderWrapper);
141
+ export default ArticleHeaderWrapper;
@@ -3,7 +3,7 @@ import styled from '@emotion/styled';
3
3
  import { spacing, fonts, colors, mq, breakpoints, spacingUnit } from '@ndla/core';
4
4
  import SafeLink from '@ndla/safelink';
5
5
  import { Forward, Launch } from '@ndla/icons/common';
6
- import { WithTranslation, withTranslation } from 'react-i18next';
6
+ import { useTranslation } from 'react-i18next';
7
7
 
8
8
  const StyledLinksWrapper = styled.div`
9
9
  display: flex;
@@ -92,43 +92,46 @@ const StyledHeaderLinks = styled.h1`
92
92
  margin: ${spacing.xsmall} 0;
93
93
  `;
94
94
 
95
- const FooterLinks = ({ t, links }: FooterLinksProps & WithTranslation) => (
96
- <>
97
- <StyledLinksWrapper>
98
- <section>
99
- <StyledHeaderLinks>
100
- {t('footer.footerLinksHeader')} <Launch />
101
- </StyledHeaderLinks>
102
- <StyledNav>
103
- {commonLinks.map((link) => (
104
- <div key={link.url}>
105
- <StyledSafeLink
106
- key={t<string>(`footer.ndlaLinks.${link.key}`)}
107
- aria-label={t(`footer.ndlaLinks.${link.key}`)}
108
- to={link.url}
109
- target="_blank"
110
- rel="noopener noreferrer">
111
- {t(`footer.ndlaLinks.${link.key}`)}
112
- </StyledSafeLink>
113
- </div>
114
- ))}
115
- </StyledNav>
116
- </section>
117
- <section>
118
- <StyledNav>
119
- {links.map((link) => (
120
- <StyledSocialMediaLinkWrapper key={link.to}>
121
- <StyledSocialMediaIcon>{link.icon}</StyledSocialMediaIcon>
122
- <StyledSafeLink to={link.to}>
123
- {link.text}
124
- <Forward />
125
- </StyledSafeLink>
126
- </StyledSocialMediaLinkWrapper>
127
- ))}
128
- </StyledNav>
129
- </section>
130
- </StyledLinksWrapper>
131
- </>
132
- );
95
+ const FooterLinks = ({ links }: FooterLinksProps) => {
96
+ const { t } = useTranslation();
97
+ return (
98
+ <>
99
+ <StyledLinksWrapper>
100
+ <section>
101
+ <StyledHeaderLinks>
102
+ {t('footer.footerLinksHeader')} <Launch />
103
+ </StyledHeaderLinks>
104
+ <StyledNav>
105
+ {commonLinks.map((link) => (
106
+ <div key={link.url}>
107
+ <StyledSafeLink
108
+ key={t<string>(`footer.ndlaLinks.${link.key}`)}
109
+ aria-label={t(`footer.ndlaLinks.${link.key}`)}
110
+ to={link.url}
111
+ target="_blank"
112
+ rel="noopener noreferrer">
113
+ {t(`footer.ndlaLinks.${link.key}`)}
114
+ </StyledSafeLink>
115
+ </div>
116
+ ))}
117
+ </StyledNav>
118
+ </section>
119
+ <section>
120
+ <StyledNav>
121
+ {links.map((link) => (
122
+ <StyledSocialMediaLinkWrapper key={link.to}>
123
+ <StyledSocialMediaIcon>{link.icon}</StyledSocialMediaIcon>
124
+ <StyledSafeLink to={link.to}>
125
+ {link.text}
126
+ <Forward />
127
+ </StyledSafeLink>
128
+ </StyledSocialMediaLinkWrapper>
129
+ ))}
130
+ </StyledNav>
131
+ </section>
132
+ </StyledLinksWrapper>
133
+ </>
134
+ );
135
+ };
133
136
 
134
- export default withTranslation()(FooterLinks);
137
+ export default FooterLinks;
@@ -3,7 +3,7 @@ import styled from '@emotion/styled';
3
3
  import { css } from '@emotion/react';
4
4
  import SafeLink from '@ndla/safelink';
5
5
  import { Forward } from '@ndla/icons/common';
6
- import { withTranslation, WithTranslation } from 'react-i18next';
6
+ import { useTranslation } from 'react-i18next';
7
7
  import { spacing, spacingUnit, colors, breakpoints, fonts, mq } from '@ndla/core';
8
8
  import SectionHeading from '../SectionHeading';
9
9
 
@@ -74,20 +74,23 @@ type Props = {
74
74
  imageUrl: string;
75
75
  };
76
76
 
77
- const FrontpageFilm = ({ url, imageUrl, t }: Props & WithTranslation) => (
78
- <StyledSection>
79
- <SectionHeading large>{t('welcomePage.film.header')}</SectionHeading>
80
- <StyledImage imageUrl={imageUrl}>
81
- <StyledText>{t('welcomePage.film.text')}</StyledText>
82
- <StyledText narrow>{t('welcomePage.film.textShort')}</StyledText>
83
- </StyledImage>
84
- <div className="o-text-link__wrapper o-text-link__wrapper--right">
85
- <SafeLink className="o-text-link" to={url}>
86
- {t('welcomePage.film.linkLabel')}
87
- <Forward />
88
- </SafeLink>
89
- </div>
90
- </StyledSection>
91
- );
77
+ const FrontpageFilm = ({ url, imageUrl }: Props) => {
78
+ const { t } = useTranslation();
79
+ return (
80
+ <StyledSection>
81
+ <SectionHeading large>{t('welcomePage.film.header')}</SectionHeading>
82
+ <StyledImage imageUrl={imageUrl}>
83
+ <StyledText>{t('welcomePage.film.text')}</StyledText>
84
+ <StyledText narrow>{t('welcomePage.film.textShort')}</StyledText>
85
+ </StyledImage>
86
+ <div className="o-text-link__wrapper o-text-link__wrapper--right">
87
+ <SafeLink className="o-text-link" to={url}>
88
+ {t('welcomePage.film.linkLabel')}
89
+ <Forward />
90
+ </SafeLink>
91
+ </div>
92
+ </StyledSection>
93
+ );
94
+ };
92
95
 
93
- export default withTranslation()(FrontpageFilm);
96
+ export default FrontpageFilm;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import SafeLink, { SafeLinkButton } from '@ndla/safelink';
3
3
  import styled from '@emotion/styled';
4
4
  import { spacing, breakpoints, mq } from '@ndla/core';
5
- import { withTranslation, WithTranslation } from 'react-i18next';
5
+ import { useTranslation } from 'react-i18next';
6
6
  import SectionHeading from '../SectionHeading';
7
7
  import ComponentCursor from '../ComponentCursor';
8
8
  import { MultidisciplinarySubjectIllustration as Illustration } from './illustrations/FrontpageIllustrations';
@@ -74,33 +74,36 @@ type Props = {
74
74
  topics?: { url: string; title: string; id: string }[];
75
75
  };
76
76
 
77
- const FrontpageMultidisciplinarySubject = ({ url, t, topics }: Props & WithTranslation) => (
78
- <StyledSection>
79
- <ComponentCursor variant="left" text={t('frontpageMultidisciplinarySubject.cursorText')} />
80
- <Wrapper>
81
- <Content>
82
- <SectionHeading large>{t('frontpageMultidisciplinarySubject.heading')}</SectionHeading>
83
- {topics ? (
84
- <Topics>
85
- {topics.map((topic) => {
86
- return (
87
- <Topic key={topic.id}>
88
- <SafeLink to={topic.url}>{topic.title}</SafeLink>
89
- </Topic>
90
- );
91
- })}
92
- </Topics>
93
- ) : null}
94
- <StyledText>{t('frontpageMultidisciplinarySubject.text')}</StyledText>
95
- </Content>
96
- </Wrapper>
97
- <TargetItem className="o-text-link__wrapper o-text-link__wrapper">
98
- <SafeLinkButton to={url} buttonSize="medium" borderShape="rounded">
99
- {t('frontpageMultidisciplinarySubject.linkText')}
100
- </SafeLinkButton>
101
- </TargetItem>
102
- <Illustration />
103
- </StyledSection>
104
- );
77
+ const FrontpageMultidisciplinarySubject = ({ url, topics }: Props) => {
78
+ const { t } = useTranslation();
79
+ return (
80
+ <StyledSection>
81
+ <ComponentCursor variant="left" text={t('frontpageMultidisciplinarySubject.cursorText')} />
82
+ <Wrapper>
83
+ <Content>
84
+ <SectionHeading large>{t('frontpageMultidisciplinarySubject.heading')}</SectionHeading>
85
+ {topics ? (
86
+ <Topics>
87
+ {topics.map((topic) => {
88
+ return (
89
+ <Topic key={topic.id}>
90
+ <SafeLink to={topic.url}>{topic.title}</SafeLink>
91
+ </Topic>
92
+ );
93
+ })}
94
+ </Topics>
95
+ ) : null}
96
+ <StyledText>{t('frontpageMultidisciplinarySubject.text')}</StyledText>
97
+ </Content>
98
+ </Wrapper>
99
+ <TargetItem className="o-text-link__wrapper o-text-link__wrapper">
100
+ <SafeLinkButton to={url} buttonSize="medium" borderShape="rounded">
101
+ {t('frontpageMultidisciplinarySubject.linkText')}
102
+ </SafeLinkButton>
103
+ </TargetItem>
104
+ <Illustration />
105
+ </StyledSection>
106
+ );
107
+ };
105
108
 
106
- export default withTranslation()(FrontpageMultidisciplinarySubject);
109
+ export default FrontpageMultidisciplinarySubject;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import styled from '@emotion/styled';
3
- import { WithTranslation, withTranslation } from 'react-i18next';
3
+ import { useTranslation } from 'react-i18next';
4
4
  import { spacing, breakpoints, mq } from '@ndla/core';
5
5
  import { SafeLinkButton } from '@ndla/safelink';
6
6
  import SectionHeading from '../SectionHeading';
@@ -46,21 +46,24 @@ type Props = {
46
46
  urlTeachers: string;
47
47
  };
48
48
 
49
- const FrontpageToolbox = ({ urlStudents, urlTeachers, t }: Props & WithTranslation) => (
50
- <StyledSection>
51
- <ComponentCursor variant="left" text={t('frontPageToolbox.cursorText')} />
52
- <SectionHeading large>{t('frontPageToolbox.heading')}</SectionHeading>
53
- <ToolboxWrapper>
54
- <StyledText>{t('frontPageToolbox.text')}</StyledText>
55
- </ToolboxWrapper>
56
- <StyledStudentsButton to={urlStudents} buttonSize="medium" borderShape="rounded">
57
- {t('frontPageToolbox.linkTextStudents')}
58
- </StyledStudentsButton>
59
- <SafeLinkButton to={urlTeachers} buttonSize="medium" borderShape="rounded">
60
- {t('frontPageToolbox.linkTextTeachers')}
61
- </SafeLinkButton>
62
- <Illustration />
63
- </StyledSection>
64
- );
49
+ const FrontpageToolbox = ({ urlStudents, urlTeachers }: Props) => {
50
+ const { t } = useTranslation();
51
+ return (
52
+ <StyledSection>
53
+ <ComponentCursor variant="left" text={t('frontPageToolbox.cursorText')} />
54
+ <SectionHeading large>{t('frontPageToolbox.heading')}</SectionHeading>
55
+ <ToolboxWrapper>
56
+ <StyledText>{t('frontPageToolbox.text')}</StyledText>
57
+ </ToolboxWrapper>
58
+ <StyledStudentsButton to={urlStudents} buttonSize="medium" borderShape="rounded">
59
+ {t('frontPageToolbox.linkTextStudents')}
60
+ </StyledStudentsButton>
61
+ <SafeLinkButton to={urlTeachers} buttonSize="medium" borderShape="rounded">
62
+ {t('frontPageToolbox.linkTextTeachers')}
63
+ </SafeLinkButton>
64
+ <Illustration />
65
+ </StyledSection>
66
+ );
67
+ };
65
68
 
66
- export default withTranslation()(FrontpageToolbox);
69
+ export default FrontpageToolbox;
@@ -10,7 +10,7 @@ import React, { ReactNode } from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { css } from '@emotion/react';
12
12
  import SafeLink from '@ndla/safelink';
13
- import { withTranslation, WithTranslation } from 'react-i18next';
13
+ import { useTranslation } from 'react-i18next';
14
14
  import { fonts, spacing, spacingUnit } from '@ndla/core';
15
15
  import { OneColumn, LayoutItem } from '../index';
16
16
 
@@ -51,32 +51,35 @@ interface Props {
51
51
  learningPathName: string;
52
52
  }
53
53
 
54
- const LearningPathLastStepNavigation = ({ subject, topic, learningPathName, children, t }: Props & WithTranslation) => (
55
- <OneColumn css={OneColumnCss}>
56
- <LayoutItem layout="center">
57
- <StyledHeader className="c-article__title">
58
- <span>{t('learningPath.lastStep.heading')}</span>
59
- <StyledSmallText>
60
- {t('learningPath.lastStep.headingSmall', {
61
- learningPathName,
62
- })}
63
- </StyledSmallText>
64
- </StyledHeader>
65
- {subject && (
66
- <StyledLinkWrapper>
67
- {t('learningPath.lastStep.subjectHeading')}
68
- <SafeLink to={subject.url}>{subject.name}</SafeLink>
69
- </StyledLinkWrapper>
70
- )}
71
- {topic && (
72
- <StyledLinkWrapper>
73
- {t('learningPath.lastStep.topicHeading')}
74
- <SafeLink to={topic.url}>{topic.name}</SafeLink>
75
- </StyledLinkWrapper>
76
- )}
77
- {children}
78
- </LayoutItem>
79
- </OneColumn>
80
- );
54
+ const LearningPathLastStepNavigation = ({ subject, topic, learningPathName, children }: Props) => {
55
+ const { t } = useTranslation();
56
+ return (
57
+ <OneColumn css={OneColumnCss}>
58
+ <LayoutItem layout="center">
59
+ <StyledHeader className="c-article__title">
60
+ <span>{t('learningPath.lastStep.heading')}</span>
61
+ <StyledSmallText>
62
+ {t('learningPath.lastStep.headingSmall', {
63
+ learningPathName,
64
+ })}
65
+ </StyledSmallText>
66
+ </StyledHeader>
67
+ {subject && (
68
+ <StyledLinkWrapper>
69
+ {t('learningPath.lastStep.subjectHeading')}
70
+ <SafeLink to={subject.url}>{subject.name}</SafeLink>
71
+ </StyledLinkWrapper>
72
+ )}
73
+ {topic && (
74
+ <StyledLinkWrapper>
75
+ {t('learningPath.lastStep.topicHeading')}
76
+ <SafeLink to={topic.url}>{topic.name}</SafeLink>
77
+ </StyledLinkWrapper>
78
+ )}
79
+ {children}
80
+ </LayoutItem>
81
+ </OneColumn>
82
+ );
83
+ };
81
84
 
82
- export default withTranslation()(LearningPathLastStepNavigation);
85
+ export default LearningPathLastStepNavigation;
@@ -11,7 +11,7 @@ import styled from '@emotion/styled';
11
11
  import { css } from '@emotion/react';
12
12
  import { Time } from '@ndla/icons/common';
13
13
  import { SafeLinkButton } from '@ndla/safelink';
14
- import { WithTranslation, withTranslation } from 'react-i18next';
14
+ import { useTranslation } from 'react-i18next';
15
15
  import { colors, spacing, spacingUnit, fonts, mq, breakpoints, animations } from '@ndla/core';
16
16
  import LearningPathMenuAsideCopyright from './LearningPathMenuAsideCopyright';
17
17
 
@@ -107,32 +107,28 @@ type Props = {
107
107
  };
108
108
  };
109
109
 
110
- const LearningPathMenuAside = ({
111
- lastUpdated,
112
- learningPathURL,
113
- copyright,
114
- isOpen,
115
- invertedStyle,
116
- t,
117
- }: Props & WithTranslation) => (
118
- <StyledAside isOpen={isOpen} invertedStyle={invertedStyle}>
119
- <div css={learningPathDetailsCSS}>
120
- <Time />
121
- <p>
122
- {t('learningPath.lastUpdated')}: {lastUpdated}
123
- </p>
124
- </div>
125
- {copyright.contributors && <LearningPathMenuAsideCopyright copyright={copyright} />}
126
- <p css={infoTextCSS}>{t('learningPath.createLearningPathText')}</p>
127
- <StyledSafeLinkButton
128
- to={learningPathURL}
129
- target="_blank"
130
- rel="noopener noreferrer"
131
- outline
132
- invertedStyle={invertedStyle}>
133
- {t('learningPath.createLearningPathButtonText')}
134
- </StyledSafeLinkButton>
135
- </StyledAside>
136
- );
110
+ const LearningPathMenuAside = ({ lastUpdated, learningPathURL, copyright, isOpen, invertedStyle }: Props) => {
111
+ const { t } = useTranslation();
112
+ return (
113
+ <StyledAside isOpen={isOpen} invertedStyle={invertedStyle}>
114
+ <div css={learningPathDetailsCSS}>
115
+ <Time />
116
+ <p>
117
+ {t('learningPath.lastUpdated')}: {lastUpdated}
118
+ </p>
119
+ </div>
120
+ {copyright.contributors && <LearningPathMenuAsideCopyright copyright={copyright} />}
121
+ <p css={infoTextCSS}>{t('learningPath.createLearningPathText')}</p>
122
+ <StyledSafeLinkButton
123
+ to={learningPathURL}
124
+ target="_blank"
125
+ rel="noopener noreferrer"
126
+ outline
127
+ invertedStyle={invertedStyle}>
128
+ {t('learningPath.createLearningPathButtonText')}
129
+ </StyledSafeLinkButton>
130
+ </StyledAside>
131
+ );
132
+ };
137
133
 
138
- export default withTranslation()(LearningPathMenuAside);
134
+ export default LearningPathMenuAside;
@@ -9,7 +9,7 @@
9
9
  import styled from '@emotion/styled';
10
10
  import { colors, fonts, spacing } from '@ndla/core';
11
11
  import React from 'react';
12
- import { WithTranslation, withTranslation } from 'react-i18next';
12
+ import { useTranslation } from 'react-i18next';
13
13
  import { LearningPathBadge } from '../ContentTypeBadge';
14
14
 
15
15
  const StyledWrapper = styled.div`
@@ -25,11 +25,14 @@ const StyledMiniHeader = styled.span`
25
25
  ${fonts.sizes(16, 1.1)};
26
26
  `;
27
27
 
28
- const LearningPathMobileHeader = ({ t }: WithTranslation) => (
29
- <StyledWrapper>
30
- <LearningPathBadge size="xx-small" background />
31
- <StyledMiniHeader>{t('learningPath.youAreInALearningPath')}</StyledMiniHeader>
32
- </StyledWrapper>
33
- );
28
+ const LearningPathMobileHeader = () => {
29
+ const { t } = useTranslation();
30
+ return (
31
+ <StyledWrapper>
32
+ <LearningPathBadge size="xx-small" background />
33
+ <StyledMiniHeader>{t('learningPath.youAreInALearningPath')}</StyledMiniHeader>
34
+ </StyledWrapper>
35
+ );
36
+ };
34
37
 
35
- export default withTranslation()(LearningPathMobileHeader);
38
+ export default LearningPathMobileHeader;
@@ -9,7 +9,7 @@
9
9
  import React from 'react';
10
10
  import styled from '@emotion/styled';
11
11
  import { mq, breakpoints, typography } from '@ndla/core';
12
- import { WithTranslation, withTranslation } from 'react-i18next';
12
+ import { useTranslation } from 'react-i18next';
13
13
 
14
14
  const StyledInfo = styled.div`
15
15
  ${typography.smallHeading}
@@ -24,13 +24,16 @@ type Props = {
24
24
  current: number;
25
25
  };
26
26
 
27
- const LearningPathMobileStepInfo = ({ total, current, t }: Props & WithTranslation) => (
28
- <StyledInfo>
29
- {t('learningPath.mobileStepInfo', {
30
- totalPages: total,
31
- currentPage: current,
32
- })}
33
- </StyledInfo>
34
- );
27
+ const LearningPathMobileStepInfo = ({ total, current }: Props) => {
28
+ const { t } = useTranslation();
29
+ return (
30
+ <StyledInfo>
31
+ {t('learningPath.mobileStepInfo', {
32
+ totalPages: total,
33
+ currentPage: current,
34
+ })}
35
+ </StyledInfo>
36
+ );
37
+ };
35
38
 
36
- export default withTranslation()(LearningPathMobileStepInfo);
39
+ export default LearningPathMobileStepInfo;