@griddo/ax 1.56.9 → 1.57.2

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 (253) hide show
  1. package/config/griddo-config.js +1 -0
  2. package/package.json +2 -2
  3. package/src/components/ActionMenu/index.tsx +1 -1
  4. package/src/components/Fields/ComponentArray/MixableComponentArray/index.tsx +7 -1
  5. package/src/components/Fields/ComponentArray/MixableComponentArray/style.tsx +29 -24
  6. package/src/components/Fields/ComponentArray/SameComponentArray/index.tsx +7 -1
  7. package/src/components/Fields/ComponentArray/SameComponentArray/style.tsx +29 -24
  8. package/src/components/Fields/DateField/index.tsx +3 -2
  9. package/src/components/Fields/ReferenceField/AutoPanel/AutoItem/index.tsx +1 -1
  10. package/src/components/Fields/ReferenceField/AutoPanel/index.tsx +1 -1
  11. package/src/components/Fields/ReferenceField/ItemList/Item/index.tsx +1 -1
  12. package/src/components/Fields/UrlField/index.tsx +12 -1
  13. package/src/components/Fields/Wysiwyg/config.tsx +80 -56
  14. package/src/components/Fields/Wysiwyg/index.tsx +23 -6
  15. package/src/components/FloatingMenu/index.tsx +9 -6
  16. package/src/components/FloatingMenu/style.tsx +8 -6
  17. package/src/components/Gallery/GalleryFilters/Orientation/index.tsx +1 -1
  18. package/src/components/Gallery/GalleryFilters/SortBy/index.tsx +1 -1
  19. package/src/components/InformativeMenu/index.tsx +3 -2
  20. package/src/components/InformativeMenu/style.tsx +0 -1
  21. package/src/components/MainWrapper/AppBar/index.tsx +8 -7
  22. package/src/components/MainWrapper/AppBar/style.tsx +7 -0
  23. package/src/components/MenuItem/style.tsx +1 -0
  24. package/src/components/Modal/style.tsx +14 -13
  25. package/src/components/Nav/index.tsx +8 -3
  26. package/src/components/Nav/style.tsx +5 -0
  27. package/src/components/SearchField/index.tsx +43 -14
  28. package/src/components/SearchField/style.tsx +23 -10
  29. package/src/components/SideModal/index.tsx +24 -8
  30. package/src/components/SideModal/style.tsx +13 -2
  31. package/src/components/SubNav/style.tsx +3 -2
  32. package/src/containers/Navigation/Defaults/actions.tsx +26 -24
  33. package/src/containers/Navigation/Defaults/reducer.tsx +2 -2
  34. package/src/containers/PageEditor/actions.tsx +9 -8
  35. package/src/containers/Settings/Social/actions.tsx +9 -31
  36. package/src/containers/Settings/Social/constants.tsx +2 -3
  37. package/src/containers/Settings/Social/interfaces.tsx +2 -7
  38. package/src/containers/Settings/Social/reducer.tsx +3 -14
  39. package/src/containers/Sites/actions.tsx +3 -63
  40. package/src/containers/Sites/constants.tsx +0 -1
  41. package/src/containers/Sites/interfaces.tsx +0 -6
  42. package/src/containers/Sites/reducer.tsx +1 -29
  43. package/src/forms/editor.tsx +2 -0
  44. package/src/forms/validators.tsx +2 -0
  45. package/src/helpers/dates.tsx +23 -24
  46. package/src/helpers/index.tsx +2 -0
  47. package/src/helpers/objects.tsx +17 -2
  48. package/src/helpers/schemas.tsx +7 -4
  49. package/src/hooks/forms.tsx +23 -24
  50. package/src/modules/App/Routing/NavMenu/NavItem/index.tsx +10 -5
  51. package/src/modules/App/Routing/NavMenu/NavItem/style.tsx +13 -9
  52. package/src/modules/App/Routing/NavMenu/index.tsx +39 -37
  53. package/src/modules/App/Routing/NavMenu/style.tsx +9 -3
  54. package/src/modules/Categories/CategoriesList/CategoryItem/index.tsx +1 -1
  55. package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/index.tsx +6 -3
  56. package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/style.tsx +5 -1
  57. package/src/modules/Content/ContentFilters/index.tsx +6 -3
  58. package/src/modules/Content/ContentFilters/style.tsx +6 -1
  59. package/src/modules/Content/HeaderMenus/Live/index.tsx +1 -1
  60. package/src/modules/Content/HeaderMenus/Name/index.tsx +10 -4
  61. package/src/modules/Content/HeaderMenus/Status/index.tsx +7 -3
  62. package/src/modules/Content/HeaderMenus/Translations/index.tsx +1 -1
  63. package/src/modules/Content/HeaderMenus/Types/index.tsx +1 -1
  64. package/src/modules/Content/OptionTable/index.tsx +6 -3
  65. package/src/modules/Content/OptionTable/style.tsx +4 -0
  66. package/src/modules/Content/PageItem/index.tsx +3 -3
  67. package/src/modules/Content/index.tsx +5 -3
  68. package/src/modules/GlobalEditor/index.tsx +37 -14
  69. package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +33 -13
  70. package/src/modules/Navigation/Defaults/Item/atoms.tsx +1 -1
  71. package/src/modules/Navigation/Defaults/Nav/index.tsx +8 -3
  72. package/src/modules/Navigation/Defaults/Nav/style.tsx +4 -0
  73. package/src/modules/Navigation/Defaults/index.tsx +4 -0
  74. package/src/modules/Navigation/Menus/List/Nav/index.tsx +8 -3
  75. package/src/modules/Navigation/Menus/List/Nav/style.tsx +4 -0
  76. package/src/modules/Navigation/Menus/List/index.tsx +3 -1
  77. package/src/modules/Navigation/Menus/List/style.tsx +9 -1
  78. package/src/modules/PageEditor/index.tsx +38 -14
  79. package/src/modules/Settings/ContentTypes/DataPacks/AddModal/Filter/index.tsx +1 -1
  80. package/src/modules/Settings/ContentTypes/DataPacks/AddModal/SortFilter/index.tsx +1 -1
  81. package/src/modules/Settings/ContentTypes/DataPacks/Nav/index.tsx +11 -6
  82. package/src/modules/Settings/ContentTypes/DataPacks/Nav/style.tsx +6 -1
  83. package/src/modules/Settings/Globals/index.tsx +19 -31
  84. package/src/modules/Settings/Languages/LanguagePanel/Form/index.tsx +1 -1
  85. package/src/modules/Settings/Languages/Table/Item/index.tsx +1 -1
  86. package/src/modules/Settings/Social/index.tsx +35 -91
  87. package/src/modules/Sites/SitesList/SiteModal/index.tsx +12 -27
  88. package/src/modules/Sites/SitesList/index.tsx +15 -15
  89. package/src/modules/StructuredData/StructuredDataList/ContentFilters/index.tsx +3 -1
  90. package/src/modules/StructuredData/StructuredDataList/ContentFilters/style.tsx +6 -1
  91. package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +3 -3
  92. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Live/index.tsx +1 -1
  93. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Name/index.tsx +10 -4
  94. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Site/index.tsx +1 -1
  95. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Status/index.tsx +7 -3
  96. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Translations/index.tsx +1 -1
  97. package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Types/index.tsx +1 -1
  98. package/src/modules/StructuredData/StructuredDataList/OptionTable/index.tsx +6 -3
  99. package/src/modules/StructuredData/StructuredDataList/OptionTable/style.tsx +4 -0
  100. package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +1 -1
  101. package/src/modules/Users/UserList/HeaderMenus/Name/index.tsx +13 -5
  102. package/src/schemas/index.tsx +7 -0
  103. package/src/schemas/pages/GlobalPage.tsx +166 -0
  104. package/src/schemas/pages/Page.tsx +181 -0
  105. package/src/schemas/pages/index.tsx +4 -0
  106. package/src/types/index.tsx +8 -14
  107. package/tsconfig.paths.json +2 -1
  108. package/public/img/schemas/Accordion/thumbnails/thumbnail@1x.png +0 -0
  109. package/public/img/schemas/Accordion/thumbnails/thumbnail@2x.png +0 -0
  110. package/public/img/schemas/AddressCollection/thumbnails/thumbnail@1x.png +0 -0
  111. package/public/img/schemas/AddressCollection/thumbnails/thumbnail@2x.png +0 -0
  112. package/public/img/schemas/BasicBoxedCard/thumbnails/thumbnail@1x.png +0 -0
  113. package/public/img/schemas/BasicBoxedCard/thumbnails/thumbnail@2x.png +0 -0
  114. package/public/img/schemas/BasicCard/thumbnails/thumbnail@1x.png +0 -0
  115. package/public/img/schemas/BasicCard/thumbnails/thumbnail@2x.png +0 -0
  116. package/public/img/schemas/BasicContent/layouts/layout001@1x.png +0 -0
  117. package/public/img/schemas/BasicContent/layouts/layout001@2x.png +0 -0
  118. package/public/img/schemas/BasicContent/layouts/layout002@1x.png +0 -0
  119. package/public/img/schemas/BasicContent/layouts/layout002@2x.png +0 -0
  120. package/public/img/schemas/BasicContent/layouts/layout003@1x.png +0 -0
  121. package/public/img/schemas/BasicContent/layouts/layout003@2x.png +0 -0
  122. package/public/img/schemas/BasicContent/layouts/layout004@1x.png +0 -0
  123. package/public/img/schemas/BasicContent/layouts/layout004@2x.png +0 -0
  124. package/public/img/schemas/BasicContent/layouts/layout005@1x.png +0 -0
  125. package/public/img/schemas/BasicContent/layouts/layout005@2x.png +0 -0
  126. package/public/img/schemas/BasicContent/layouts/layout006@1x.png +0 -0
  127. package/public/img/schemas/BasicContent/layouts/layout006@2x.png +0 -0
  128. package/public/img/schemas/BasicContent/layouts/layout007@1x.png +0 -0
  129. package/public/img/schemas/BasicContent/layouts/layout007@2x.png +0 -0
  130. package/public/img/schemas/BasicContent/thumbnails/thumbnail@1x.png +0 -0
  131. package/public/img/schemas/BasicContent/thumbnails/thumbnail@2x.png +0 -0
  132. package/public/img/schemas/BasicIconCard/thumbnails/thumbnail@1x.png +0 -0
  133. package/public/img/schemas/BasicIconCard/thumbnails/thumbnail@2x.png +0 -0
  134. package/public/img/schemas/CardCollection/layouts/layout001@1x.png +0 -0
  135. package/public/img/schemas/CardCollection/layouts/layout001@2x.png +0 -0
  136. package/public/img/schemas/CardCollection/layouts/layout002@1x.png +0 -0
  137. package/public/img/schemas/CardCollection/layouts/layout002@2x.png +0 -0
  138. package/public/img/schemas/CardCollection/layouts/layout003@1x.png +0 -0
  139. package/public/img/schemas/CardCollection/layouts/layout003@2x.png +0 -0
  140. package/public/img/schemas/CardCollection/layouts/layout004@1x.png +0 -0
  141. package/public/img/schemas/CardCollection/layouts/layout004@2x.png +0 -0
  142. package/public/img/schemas/CardCollection/layouts/layout005@1x.png +0 -0
  143. package/public/img/schemas/CardCollection/layouts/layout005@2x.png +0 -0
  144. package/public/img/schemas/CardCollection/thumbnails/thumbnail@1x.png +0 -0
  145. package/public/img/schemas/CardCollection/thumbnails/thumbnail@2x.png +0 -0
  146. package/public/img/schemas/DownloadCollection/thumbnails/thumbnail@1x.png +0 -0
  147. package/public/img/schemas/DownloadCollection/thumbnails/thumbnail@2x.png +0 -0
  148. package/public/img/schemas/EventCard/layouts/layout001@1x.png +0 -0
  149. package/public/img/schemas/EventCard/layouts/layout001@2x.png +0 -0
  150. package/public/img/schemas/EventCard/layouts/layout002@1x.png +0 -0
  151. package/public/img/schemas/EventCard/layouts/layout002@2x.png +0 -0
  152. package/public/img/schemas/EventCard/thumbnails/thumbnail@1x.png +0 -0
  153. package/public/img/schemas/EventCard/thumbnails/thumbnail@2x.png +0 -0
  154. package/public/img/schemas/EventsDistributor/thumbnails/thumbnail@1x.png +0 -0
  155. package/public/img/schemas/EventsDistributor/thumbnails/thumbnail@2x.png +0 -0
  156. package/public/img/schemas/FeaturedAudiovisual/layouts/layout001@1x.png +0 -0
  157. package/public/img/schemas/FeaturedAudiovisual/layouts/layout001@2x.png +0 -0
  158. package/public/img/schemas/FeaturedAudiovisual/layouts/layout002@1x.png +0 -0
  159. package/public/img/schemas/FeaturedAudiovisual/layouts/layout002@2x.png +0 -0
  160. package/public/img/schemas/FeaturedAudiovisual/layouts/layout003@1x.png +0 -0
  161. package/public/img/schemas/FeaturedAudiovisual/layouts/layout003@2x.png +0 -0
  162. package/public/img/schemas/FeaturedAudiovisual/layouts/layout004@1x.png +0 -0
  163. package/public/img/schemas/FeaturedAudiovisual/layouts/layout004@2x.png +0 -0
  164. package/public/img/schemas/FeaturedAudiovisual/layouts/layout005@1x.png +0 -0
  165. package/public/img/schemas/FeaturedAudiovisual/layouts/layout005@2x.png +0 -0
  166. package/public/img/schemas/FeaturedAudiovisual/layouts/layout006@1x.png +0 -0
  167. package/public/img/schemas/FeaturedAudiovisual/layouts/layout006@2x.png +0 -0
  168. package/public/img/schemas/FeaturedAudiovisual/layouts/layout007@1x.png +0 -0
  169. package/public/img/schemas/FeaturedAudiovisual/layouts/layout007@2x.png +0 -0
  170. package/public/img/schemas/FeaturedAudiovisual/layouts/layout008@1x.png +0 -0
  171. package/public/img/schemas/FeaturedAudiovisual/layouts/layout008@2x.png +0 -0
  172. package/public/img/schemas/FeaturedAudiovisual/layouts/layout009@1x.png +0 -0
  173. package/public/img/schemas/FeaturedAudiovisual/layouts/layout009@2x.png +0 -0
  174. package/public/img/schemas/FeaturedAudiovisual/layouts/layout010@1x.png +0 -0
  175. package/public/img/schemas/FeaturedAudiovisual/layouts/layout010@2x.png +0 -0
  176. package/public/img/schemas/FeaturedAudiovisual/layouts/layout011@1x.png +0 -0
  177. package/public/img/schemas/FeaturedAudiovisual/layouts/layout011@2x.png +0 -0
  178. package/public/img/schemas/FeaturedAudiovisual/layouts/layout012@1x.png +0 -0
  179. package/public/img/schemas/FeaturedAudiovisual/layouts/layout012@2x.png +0 -0
  180. package/public/img/schemas/FeaturedAudiovisual/thumbnails/thumbnail@1x.png +0 -0
  181. package/public/img/schemas/FeaturedAudiovisual/thumbnails/thumbnail@2x.png +0 -0
  182. package/public/img/schemas/FeaturedBlock/layouts/layout001@1x.png +0 -0
  183. package/public/img/schemas/FeaturedBlock/layouts/layout001@2x.png +0 -0
  184. package/public/img/schemas/FeaturedBlock/layouts/layout002@1x.png +0 -0
  185. package/public/img/schemas/FeaturedBlock/layouts/layout002@2x.png +0 -0
  186. package/public/img/schemas/FeaturedProgram/thumbnails/thumbnail@1x.png +0 -0
  187. package/public/img/schemas/FeaturedProgram/thumbnails/thumbnail@2x.png +0 -0
  188. package/public/img/schemas/FeaturedText/thumbnails/thumbnail@1x.png +0 -0
  189. package/public/img/schemas/FeaturedText/thumbnails/thumbnail@2x.png +0 -0
  190. package/public/img/schemas/FeedbackForm/thumbnails/thumbnail@1x.png +0 -0
  191. package/public/img/schemas/FeedbackForm/thumbnails/thumbnail@2x.png +0 -0
  192. package/public/img/schemas/HeroCarousel/thumbnails/thumbnail@1x.png +0 -0
  193. package/public/img/schemas/HeroCarousel/thumbnails/thumbnail@2x.png +0 -0
  194. package/public/img/schemas/HeroImage/thumbnails/thumbnail@1x.png +0 -0
  195. package/public/img/schemas/HeroImage/thumbnails/thumbnail@2x.png +0 -0
  196. package/public/img/schemas/IconCard/thumbnails/thumbnail@1x.png +0 -0
  197. package/public/img/schemas/IconCard/thumbnails/thumbnail@2x.png +0 -0
  198. package/public/img/schemas/IconCenteredCard/thumbnails/thumbnail@1x.png +0 -0
  199. package/public/img/schemas/IconCenteredCard/thumbnails/thumbnail@2x.png +0 -0
  200. package/public/img/schemas/Image/thumbnails/thumbnail@1x.png +0 -0
  201. package/public/img/schemas/Image/thumbnails/thumbnail@2x.png +0 -0
  202. package/public/img/schemas/ImageCard/thumbnails/thumbnail@1x.png +0 -0
  203. package/public/img/schemas/ImageCard/thumbnails/thumbnail@2x.png +0 -0
  204. package/public/img/schemas/Intro/thumbnails/thumbnail@1x.png +0 -0
  205. package/public/img/schemas/Intro/thumbnails/thumbnail@2x.png +0 -0
  206. package/public/img/schemas/LogoCard/thumbnails/thumbnail@1x.png +0 -0
  207. package/public/img/schemas/LogoCard/thumbnails/thumbnail@2x.png +0 -0
  208. package/public/img/schemas/NewsDistributor/thumbnails/thumbnail@1x.png +0 -0
  209. package/public/img/schemas/NewsDistributor/thumbnails/thumbnail@2x.png +0 -0
  210. package/public/img/schemas/PersonDistributor/thumbnails/thumbnail@1x.png +0 -0
  211. package/public/img/schemas/PersonDistributor/thumbnails/thumbnail@2x.png +0 -0
  212. package/public/img/schemas/PublicationDistributor/thumbnails/thumbnail@1x.png +0 -0
  213. package/public/img/schemas/PublicationDistributor/thumbnails/thumbnail@2x.png +0 -0
  214. package/public/img/schemas/SchoolFooter/thumbnails/thumbnail@1x.png +0 -0
  215. package/public/img/schemas/SchoolFooter/thumbnails/thumbnail@2x.png +0 -0
  216. package/public/img/schemas/Slider/thumbnails/thumbnail@1x.png +0 -0
  217. package/public/img/schemas/Slider/thumbnails/thumbnail@2x.png +0 -0
  218. package/public/img/schemas/Testimonial/layouts/layout001@1x.png +0 -0
  219. package/public/img/schemas/Testimonial/layouts/layout001@2x.png +0 -0
  220. package/public/img/schemas/Testimonial/layouts/layout002@1x.png +0 -0
  221. package/public/img/schemas/Testimonial/layouts/layout002@2x.png +0 -0
  222. package/public/img/schemas/Testimonial/thumbnails/thumbnail@1x.png +0 -0
  223. package/public/img/schemas/Testimonial/thumbnails/thumbnail@2x.png +0 -0
  224. package/public/img/schemas/TextBluePanel/layouts/layout001@1x.png +0 -0
  225. package/public/img/schemas/TextBluePanel/layouts/layout001@2x.png +0 -0
  226. package/public/img/schemas/TextBluePanel/layouts/layout002@1x.png +0 -0
  227. package/public/img/schemas/TextBluePanel/layouts/layout002@2x.png +0 -0
  228. package/public/img/schemas/TextBluePanel/thumbnails/thumbnail@1x.png +0 -0
  229. package/public/img/schemas/TextBluePanel/thumbnails/thumbnail@2x.png +0 -0
  230. package/public/img/schemas/Video/thumbnails/thumbnail@1x.png +0 -0
  231. package/public/img/schemas/Video/thumbnails/thumbnail@2x.png +0 -0
  232. package/public/img/schemas/imgHeros.png +0 -0
  233. package/public/img/schemas/imgStandard.jpg +0 -0
  234. package/public/img/schemas/templates/BasicTemplate/thumbnails/thumbnail@1x.png +0 -0
  235. package/public/img/schemas/templates/BasicTemplate/thumbnails/thumbnail@2x.png +0 -0
  236. package/public/img/schemas/templates/Error404/thumbnails/thumbnail@1x.png +0 -0
  237. package/public/img/schemas/templates/Error404/thumbnails/thumbnail@2x.png +0 -0
  238. package/public/img/schemas/templates/NewsList/thumbnails/thumbnail@1x.png +0 -0
  239. package/public/img/schemas/templates/NewsList/thumbnails/thumbnail@2x.png +0 -0
  240. package/public/img/schemas/themes/LinkStyle.png +0 -0
  241. package/public/img/schemas/themes/LinkStyle@2x.png +0 -0
  242. package/public/img/schemas/themes/PrimaryStyle.png +0 -0
  243. package/public/img/schemas/themes/PrimaryStyle@2x.png +0 -0
  244. package/public/img/schemas/themes/STYLE01.png +0 -0
  245. package/public/img/schemas/themes/STYLE02.png +0 -0
  246. package/public/img/schemas/themes/STYLE03.png +0 -0
  247. package/public/img/schemas/themes/STYLE04.png +0 -0
  248. package/public/img/schemas/themes/STYLE05.png +0 -0
  249. package/public/img/schemas/themes/STYLE06.png +0 -0
  250. package/public/img/schemas/themes/SecondaryStyle.png +0 -0
  251. package/public/img/schemas/themes/SecondaryStyle@2x.png +0 -0
  252. package/src/components/MainWrapper/AppBar/SearchField/index.tsx +0 -54
  253. package/src/components/MainWrapper/AppBar/SearchField/style.tsx +0 -55
@@ -1,49 +1,41 @@
1
- import { IImage, INavItem, IRootState, ISettingsForm } from "@ax/types";
2
- import { themes } from "components";
3
- import React, { useEffect } from "react";
1
+ import React, { useState } from "react";
4
2
  import { connect } from "react-redux";
3
+ import { themes } from "components";
5
4
 
5
+ import { IImage, INavItem, IRootState, ISettingsForm } from "@ax/types";
6
6
  import { RouteLeavingGuard } from "@ax/guards";
7
7
  import { useIsDirty } from "@ax/hooks";
8
-
9
8
  import { appActions } from "@ax/containers/App";
10
9
  import { FieldsBehavior, FieldGroup, MainWrapper, ErrorToast, Nav } from "@ax/components";
11
10
  import { sitesActions } from "@ax/containers/Sites";
12
- import { setIsSavedData } from "@ax/forms";
13
11
 
14
12
  import { timezones } from "./constants";
15
-
16
13
  import * as S from "./style";
17
14
 
18
15
  const Globals = (props: IProps): JSX.Element => {
19
- const { isSaving, updateFormValue, currentSiteInfo, form, saveSettings, setHistoryPush, navItems, currentNavItem } =
16
+ const { isSaving, currentSiteInfo, saveSettings, setHistoryPush, navItems, currentNavItem } =
20
17
  props;
21
- const { name, timezone, theme, favicon, smallAvatar, bigAvatar, thumbnail } = form;
22
18
 
23
19
  const title = "General settings";
24
20
 
25
- const { isDirty } = useIsDirty(form);
21
+ const [form, setForm] = useState(currentSiteInfo);
22
+ const { name, timezone, theme, favicon, smallAvatar, bigAvatar, thumbnail } = form;
26
23
 
27
- const setValue = (name: string, value: string) => updateFormValue({ [name]: value });
24
+ const { isDirty, setIsDirty } = useIsDirty(form);
28
25
 
29
- const setNameValue = (value: string) => updateFormValue({ name: value });
30
- const setTimezoneValue = (value: string) => updateFormValue({ timezone: value });
31
- const setThemeValue = (value: string) => updateFormValue({ theme: value });
32
- const setFaviconValue = (value: IImage) => updateFormValue({ favicon: value.url ? value.url : null });
33
- const setSmallAvatarValue = (value: IImage) => updateFormValue({ smallAvatar: value.url ? value.url : null });
34
- const setBigAvatarValue = (value: IImage) => updateFormValue({ bigAvatar: value.url ? value.url : null });
35
- const setThumbnailValue = (value: IImage) => updateFormValue({ thumbnail: value.url ? value.url : null });
26
+ const setValue = (newValue: Record<string, string | null>) => setForm((state: ISettingsForm) => ({ ...state, ...newValue }));
36
27
 
37
- useEffect(() => {
38
- if (currentSiteInfo) {
39
- Object.keys(form).forEach((key) => setValue(key, currentSiteInfo[key]));
40
- }
41
- // eslint-disable-next-line react-hooks/exhaustive-deps
42
- }, []);
28
+ const setNameValue = (value: string) => setValue({ name: value });
29
+ const setTimezoneValue = (value: string) => setValue({ timezone: value });
30
+ const setThemeValue = (value: string) => setValue({ theme: value });
31
+ const setFaviconValue = (value: IImage) => setValue({ favicon: value.url ? value.url : null });
32
+ const setSmallAvatarValue = (value: IImage) => setValue({ smallAvatar: value.url ? value.url : null });
33
+ const setBigAvatarValue = (value: IImage) => setValue({ bigAvatar: value.url ? value.url : null });
34
+ const setThumbnailValue = (value: IImage) => setValue({ thumbnail: value.url ? value.url : null });
43
35
 
44
- const saveForm = () => {
45
- setIsSavedData(true);
46
- saveSettings();
36
+ const saveForm = async () => {
37
+ const isSaved = await saveSettings(form);
38
+ if (isSaved) setIsDirty(false);
47
39
  };
48
40
 
49
41
  const rightButtonProps = {
@@ -142,24 +134,20 @@ const Globals = (props: IProps): JSX.Element => {
142
134
  interface IProps {
143
135
  isSaving: boolean;
144
136
  currentSiteInfo: any;
145
- form: ISettingsForm;
146
137
  navItems: INavItem[];
147
138
  currentNavItem: INavItem;
148
- updateFormValue(value: any): void;
149
- saveSettings(): void;
139
+ saveSettings(form: ISettingsForm): Promise<boolean>;
150
140
  setHistoryPush(path: string, isEditor?: boolean): void;
151
141
  }
152
142
 
153
143
  const mapDispatchToProps = {
154
144
  setHistoryPush: appActions.setHistoryPush,
155
- updateFormValue: sitesActions.updateFormValue,
156
145
  saveSettings: sitesActions.saveSettings,
157
146
  };
158
147
 
159
148
  const mapStateToProps = (state: IRootState) => ({
160
149
  isSaving: state.app.isSaving,
161
150
  currentSiteInfo: state.sites.currentSiteInfo,
162
- form: state.sites.form,
163
151
  });
164
152
 
165
153
  export default connect(mapStateToProps, mapDispatchToProps)(Globals);
@@ -33,7 +33,7 @@ const Form = (props: IProps): JSX.Element => {
33
33
  );
34
34
 
35
35
  const pathText =
36
- "This domain is for the site on this language. Please, fill with the complete subdomain, included the locale prefix. Example: /the-site-url";
36
+ "This path is for the site on this language. Please, fill with the complete subdomain, included the locale prefix. Example: /es/name-of-school";
37
37
 
38
38
  return (
39
39
  <>
@@ -77,7 +77,7 @@ const Item = (props: IItemProps): JSX.Element => {
77
77
  </S.FlagWrapper>
78
78
  {item.language}
79
79
  <S.Default>{item.isDefault ? "Default" : ""}</S.Default>
80
- <FloatingMenu Button={MoreInfoButton} isWide={false}>
80
+ <FloatingMenu Button={MoreInfoButton}>
81
81
  {ActionMenu(actionMenuOptions)}
82
82
  </FloatingMenu>
83
83
  </S.Component>
@@ -1,5 +1,5 @@
1
1
  import { INavItem, IRootState, ISocialState } from "@ax/types";
2
- import React, { useCallback, useEffect } from "react";
2
+ import React, { useEffect, useState } from "react";
3
3
  import { connect } from "react-redux";
4
4
 
5
5
  import { RouteLeavingGuard } from "@ax/guards";
@@ -8,47 +8,46 @@ import { useIsDirty } from "@ax/hooks";
8
8
  import { appActions } from "@ax/containers/App";
9
9
  import { FieldsBehavior, MainWrapper, ErrorToast, Nav } from "@ax/components";
10
10
  import { socialActions } from "@ax/containers/Settings/Social";
11
- import { setIsSavedData } from "@ax/forms";
12
11
 
13
12
  import * as S from "./style";
14
13
 
15
14
  const Social = (props: IProps): JSX.Element => {
16
- const { isSaving, navItems, currentNavItem, updateFormValue, socialInfo, saveSocial, getSocial, setHistoryPush } =
15
+ const { isSaving, navItems, currentNavItem, socialInfo, saveSocial, getSocial, setHistoryPush } =
17
16
  props;
18
- const { instagram, linkedIn, facebook, twitter, youTube, flicker, tiktok, snapchat, newsletter } = socialInfo;
19
17
 
20
18
  const title = "Social";
21
19
 
22
- const { isDirty } = useIsDirty(socialInfo);
20
+ const socialFields: { name: string, title: string }[] = [
21
+ { name: "instagram", title: "Instagram URL" },
22
+ { name: "linkedIn", title: "LinkedIn URL" },
23
+ { name: "facebook", title: "Facebook URL" },
24
+ { name: "twitter", title: "Twitter URL" },
25
+ { name: "youtube", title: "YouTube URL" },
26
+ { name: "flicker", title: "Flicker URL" },
27
+ { name: "tiktok", title: "Tiktok URL" },
28
+ { name: "snapchat", title: "Snapchat URL" },
29
+ { name: "newsletter", title: "Newsletter URL" },
30
+ ];
23
31
 
24
- const setValue = (name: string, value: string) => updateFormValue({ [name]: value });
32
+ const [socialForm, setSocialForm] = useState<Record<string, string>>({});
33
+ const changeSocialForm = (field: string, value: string) => setSocialForm((state) => ({ ...state, [field]: value }));
25
34
 
26
- const setInstagramValue = (instagram: string) => updateFormValue({ instagram });
27
- const setLinkedInValue = (linkedIn: string) => updateFormValue({ linkedIn });
28
- const setFacebookValue = (facebook: string) => updateFormValue({ facebook });
29
- const setTwitterValue = (twitter: string) => updateFormValue({ twitter });
30
- const setYouTubeValue = (youTube: string) => updateFormValue({ youTube });
31
- const setFlickerValue = (flicker: string) => updateFormValue({ flicker });
32
- const setTikTokValue = (tiktok: string) => updateFormValue({ tiktok });
33
- const setSnapchatValue = (snapchat: string) => updateFormValue({ snapchat });
34
- const setNewsletterValue = (newsletter: string) => updateFormValue({ newsletter });
35
+ const { isDirty, resetDirty, setIsDirty } = useIsDirty(socialForm);
35
36
 
36
37
  useEffect(() => {
37
- if (socialInfo) {
38
- Object.keys(socialInfo).forEach((key) => setValue(key, socialInfo[key]));
39
- }
38
+ getSocial();
40
39
  // eslint-disable-next-line react-hooks/exhaustive-deps
41
40
  }, []);
42
41
 
43
- const memoizedGetSocial = useCallback(() => getSocial(), [getSocial]);
44
-
45
42
  useEffect(() => {
46
- memoizedGetSocial();
47
- }, [memoizedGetSocial]);
43
+ setSocialForm({ ...socialInfo });
44
+ resetDirty();
45
+ // eslint-disable-next-line react-hooks/exhaustive-deps
46
+ }, [socialInfo]);
48
47
 
49
- const saveForm = () => {
50
- setIsSavedData(true);
51
- saveSocial();
48
+ const saveForm = async () => {
49
+ const isSaved = await saveSocial(socialForm);
50
+ if (isSaved) setIsDirty(false);
52
51
  };
53
52
 
54
53
  const rightButtonProps = {
@@ -77,69 +76,16 @@ const Social = (props: IProps): JSX.Element => {
77
76
  <S.ContentWrapper>
78
77
  <ErrorToast />
79
78
  <S.FormWrapper>
80
- <FieldsBehavior
81
- title="Instagram URL"
82
- name="instagram"
83
- fieldType="TextField"
84
- value={instagram || ""}
85
- onChange={setInstagramValue}
86
- />
87
- <FieldsBehavior
88
- title="LinkedIn URL"
89
- name="linkedIn"
90
- fieldType="TextField"
91
- value={linkedIn || ""}
92
- onChange={setLinkedInValue}
93
- />
94
- <FieldsBehavior
95
- title="Facebook URL"
96
- name="facebook"
97
- fieldType="TextField"
98
- value={facebook || ""}
99
- onChange={setFacebookValue}
100
- />
101
- <FieldsBehavior
102
- title="Twitter URL"
103
- name="twitter"
104
- fieldType="TextField"
105
- value={twitter || ""}
106
- onChange={setTwitterValue}
107
- />
108
- <FieldsBehavior
109
- title="YouTube URL"
110
- name="youTube"
111
- fieldType="TextField"
112
- value={youTube || ""}
113
- onChange={setYouTubeValue}
114
- />
115
- <FieldsBehavior
116
- title="Flicker URL"
117
- name="flicker"
118
- fieldType="TextField"
119
- value={flicker || ""}
120
- onChange={setFlickerValue}
121
- />
122
- <FieldsBehavior
123
- title="TikTok URL"
124
- name="tiktok"
125
- fieldType="TextField"
126
- value={tiktok || ""}
127
- onChange={setTikTokValue}
128
- />
129
- <FieldsBehavior
130
- title="Snapchat URL"
131
- name="snapchat"
132
- fieldType="TextField"
133
- value={snapchat || ""}
134
- onChange={setSnapchatValue}
135
- />
136
- <FieldsBehavior
137
- title="Newsletter URL"
138
- name="newsletter"
139
- fieldType="TextField"
140
- value={newsletter || ""}
141
- onChange={setNewsletterValue}
142
- />
79
+ {socialFields.map((field, idx) => (
80
+ <FieldsBehavior
81
+ key={idx}
82
+ title={field.title}
83
+ name={field.name}
84
+ fieldType="TextField"
85
+ value={socialForm[field.name] || ""}
86
+ onChange={(value: string) => changeSocialForm(field.name, value)}
87
+ />
88
+ ))}
143
89
  </S.FormWrapper>
144
90
  </S.ContentWrapper>
145
91
  </S.Wrapper>
@@ -153,15 +99,13 @@ interface IProps {
153
99
  socialInfo: ISocialState;
154
100
  navItems: INavItem[];
155
101
  currentNavItem: INavItem;
156
- updateFormValue(value: any): void;
157
- saveSocial(): void;
102
+ saveSocial: (form: Record<string, string>) => Promise<boolean>;
158
103
  getSocial(): void;
159
104
  setHistoryPush(path: string, isEditor?: boolean): void;
160
105
  }
161
106
 
162
107
  const mapDispatchToProps = {
163
108
  setHistoryPush: appActions.setHistoryPush,
164
- updateFormValue: socialActions.updateFormValue,
165
109
  saveSocial: socialActions.saveSocial,
166
110
  getSocial: socialActions.getSocial,
167
111
  };
@@ -3,31 +3,24 @@ import { connect } from "react-redux";
3
3
 
4
4
  import { IRootState, ILanguage, ISettingsForm } from "@ax/types";
5
5
  import { slugify } from "@ax/helpers";
6
-
7
6
  import { ErrorToast, FieldsBehavior } from "@ax/components";
8
- import { sitesActions } from "@ax/containers/Sites";
9
7
 
10
8
  import * as S from "./style";
11
9
 
12
10
  const SiteModal = (props: ISiteModalProps): JSX.Element => {
13
- const { languages, updateFormValue, form } = props;
11
+ const { languages, form, setForm } = props;
14
12
  const { name, defaultLanguage, path, domain } = form;
15
- const globalDefaultLang = languages.find((lang: any) => lang.isDefault);
16
-
17
- const setNameValue = (value: string) => {
18
- updateFormValue({ name: value });
19
- updateFormValue({ path: slugify(value) });
20
- };
13
+ const globalDefaultLang = languages?.find((lang: ILanguage) => lang.isDefault);
21
14
 
22
- const setLangValue = (value: number) => updateFormValue({ defaultLanguage: value });
15
+ const updateForm = (newValue: Record<string, string | number>) => setForm((state: ISettingsForm) => ({ ...state, ...newValue }));
23
16
 
24
- const setPathValue = (value: string) => updateFormValue({ path: value });
25
-
26
- const setDomainValue = (value: number) => updateFormValue({ domain: value });
17
+ const setNameValue = (value: string) => updateForm({ name: value, path: slugify(value) });
18
+ const setLangValue = (value: number) => updateForm({ defaultLanguage: value });
19
+ const setPathValue = (value: string) => updateForm({ path: value });
20
+ const setDomainValue = (value: number) => updateForm({ domain: value });
27
21
 
28
22
  useEffect(() => {
29
23
  globalDefaultLang && setLangValue(globalDefaultLang.id);
30
-
31
24
  // eslint-disable-next-line react-hooks/exhaustive-deps
32
25
  }, []);
33
26
 
@@ -86,22 +79,14 @@ const SiteModal = (props: ISiteModalProps): JSX.Element => {
86
79
 
87
80
  const mapStateToProps = (state: IRootState) => ({
88
81
  languages: state.app.globalLangs,
89
- form: state.sites.form,
90
82
  });
91
83
 
92
84
  interface IStateProps {
93
- languages: ILanguage[];
94
- form: ISettingsForm;
85
+ languages?: ILanguage[];
86
+ form: { name: string, defaultLanguage: number | null, path: string, domain: string | null };
87
+ setForm: React.Dispatch<React.SetStateAction<any>>;
95
88
  }
96
89
 
97
- interface IDispatchProps {
98
- updateFormValue: (value: any) => void;
99
- }
100
-
101
- const mapDispatchToProps = {
102
- updateFormValue: sitesActions.updateFormValue,
103
- };
104
-
105
- type ISiteModalProps = IDispatchProps & IStateProps;
90
+ type ISiteModalProps = IStateProps;
106
91
 
107
- export default connect(mapStateToProps, mapDispatchToProps)(SiteModal);
92
+ export default connect(mapStateToProps, null)(SiteModal);
@@ -1,9 +1,9 @@
1
- import React from "react";
1
+ import React, { useState } from "react";
2
2
  import { connect } from "react-redux";
3
3
 
4
4
  import { appActions } from "@ax/containers/App";
5
5
  import { sitesActions } from "@ax/containers/Sites";
6
- import { IRootState, ISettingsForm, ISite } from "@ax/types";
6
+ import { ISettingsForm, ISite } from "@ax/types";
7
7
  import { useModal } from "@ax/hooks";
8
8
  import { MainWrapper, Modal, ErrorToast } from "@ax/components";
9
9
 
@@ -13,12 +13,19 @@ import SiteItem from "./SiteItem";
13
13
  import * as S from "./style";
14
14
 
15
15
  const SitesList = (props: IProps): JSX.Element => {
16
- const { sites, resetForm, saveSettings, setHistoryPush, form } = props;
16
+ const { sites, saveSettings, setHistoryPush } = props;
17
+
18
+ const initialState = {
19
+ name: "",
20
+ defaultLanguage: null,
21
+ path: "",
22
+ domain: null,
23
+ };
24
+ const [form, setForm] = useState(initialState);
17
25
 
18
26
  const { isOpen, toggleModal } = useModal();
19
27
 
20
28
  const openModal = () => {
21
- resetForm();
22
29
  toggleModal();
23
30
  };
24
31
 
@@ -28,7 +35,7 @@ const SitesList = (props: IProps): JSX.Element => {
28
35
  };
29
36
 
30
37
  const saveSiteSettings = async () => {
31
- const result = await saveSettings();
38
+ const result = await saveSettings(form);
32
39
  if (result) {
33
40
  const contentPath = "/sites/settings/globals";
34
41
  setHistoryPush(contentPath, false);
@@ -59,7 +66,7 @@ const SitesList = (props: IProps): JSX.Element => {
59
66
  mainAction={mainAction}
60
67
  secondaryAction={secondaryAction}
61
68
  >
62
- <SiteModal />
69
+ <SiteModal form={form} setForm={setForm} />
63
70
  </Modal>
64
71
  </MainWrapper>
65
72
  );
@@ -67,25 +74,18 @@ const SitesList = (props: IProps): JSX.Element => {
67
74
 
68
75
  interface ISitesProps {
69
76
  sites: ISite[];
70
- form: ISettingsForm;
71
77
  }
72
78
 
73
79
  interface IDispatchProps {
74
80
  setHistoryPush(path: string, isEditor?: boolean): void;
75
- saveSettings(): Promise<boolean>;
76
- resetForm(): void;
81
+ saveSettings(form: ISettingsForm): Promise<boolean>;
77
82
  }
78
83
 
79
- const mapStateToProps = (state: IRootState) => ({
80
- form: state.sites.form,
81
- });
82
-
83
84
  const mapDispatchToProps = {
84
85
  setHistoryPush: appActions.setHistoryPush,
85
86
  saveSettings: sitesActions.saveSettings,
86
- resetForm: sitesActions.resetForm,
87
87
  };
88
88
 
89
89
  type IProps = ISitesProps & IDispatchProps;
90
90
 
91
- export default connect(mapStateToProps, mapDispatchToProps)(SitesList);
91
+ export default connect(null, mapDispatchToProps)(SitesList);
@@ -45,7 +45,9 @@ const ContentFilters = (props: IProps): JSX.Element => {
45
45
  return (
46
46
  <MenuItem key={filterKey} onClick={handleClick} extendedAction={isSelected ? extendedAction : null}>
47
47
  <NavLink to="#" className={selectedClass}>
48
- {name}
48
+ <S.Link active={isSelected}>
49
+ {name}
50
+ </S.Link>
49
51
  </NavLink>
50
52
  </MenuItem>
51
53
  );
@@ -2,6 +2,7 @@ import styled from "styled-components";
2
2
 
3
3
  export const Heading = styled.li`
4
4
  ${p => p.theme.textStyle.headingXXS};
5
+ color: ${p => p.theme.color.textLowEmphasis};
5
6
  margin-bottom: ${p => p.theme.spacing.xs};
6
7
  cursor: default;
7
8
 
@@ -33,6 +34,10 @@ export const SubItem = styled.li`
33
34
  }
34
35
  `;
35
36
 
36
- export const Item = styled.article`
37
+ export const Item = styled.div`
37
38
  margin-bottom: ${p => p.theme.spacing.m};
38
39
  `;
40
+
41
+ export const Link = styled.div<{ active: boolean }>`
42
+ color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
43
+ `;
@@ -92,7 +92,7 @@ const GlobalPageItem = (props: IGlobalPageItemProps): JSX.Element => {
92
92
  const SeoTitleMenu = () => {
93
93
  if (metaTitle) {
94
94
  return (
95
- <FloatingMenu isWide={true} Button={SeoItems.Title}>
95
+ <FloatingMenu Button={SeoItems.Title}>
96
96
  <S.FloatingSeo>{metaTitle}</S.FloatingSeo>
97
97
  </FloatingMenu>
98
98
  );
@@ -103,7 +103,7 @@ const GlobalPageItem = (props: IGlobalPageItemProps): JSX.Element => {
103
103
  const SeoDescriptionMenu = () => {
104
104
  if (metaDescription) {
105
105
  return (
106
- <FloatingMenu isWide={true} Button={SeoItems.Description}>
106
+ <FloatingMenu Button={SeoItems.Description}>
107
107
  <S.FloatingSeo>{metaDescription}</S.FloatingSeo>
108
108
  </FloatingMenu>
109
109
  );
@@ -287,7 +287,7 @@ const GlobalPageItem = (props: IGlobalPageItemProps): JSX.Element => {
287
287
  );
288
288
 
289
289
  const translations = isTranslatable ? (
290
- <FloatingMenu Button={FlagsButton} isWide={true}>
290
+ <FloatingMenu Button={FlagsButton}>
291
291
  {languageMenu()}
292
292
  </FloatingMenu>
293
293
  ) : (
@@ -80,7 +80,7 @@ const Live = (props: ILiveProps): JSX.Element => {
80
80
  );
81
81
 
82
82
  return (
83
- <FloatingMenu isWide={true} Button={Header} position="left" closeOnSelect={false}>
83
+ <FloatingMenu Button={Header} position="left" closeOnSelect={false}>
84
84
  <ListTitle>Filter by status</ListTitle>
85
85
  <S.ChecksWrapper>
86
86
  <CheckGroup options={options} value={selectedValue} onChange={setQuery} selectAllOption={selectAllOption} />
@@ -28,12 +28,18 @@ const NameHeader = ({ sortItems, sortedState }: INameHeaderProps) => {
28
28
  );
29
29
 
30
30
  return (
31
- <FloatingMenu isWide={true} Button={Header} position="left">
31
+ <FloatingMenu Button={Header} position="left">
32
32
  <ListTitle>Name Sorting</ListTitle>
33
- <ListItem onClick={sortAscendingName}>Ascendent</ListItem>
34
- <ListItem onClick={sortDescendingName}>Descendent</ListItem>
33
+ <ListItem isSelected={sortedByTitle && isAscending} onClick={sortAscendingName}>
34
+ Ascendent
35
+ </ListItem>
36
+ <ListItem isSelected={sortedByTitle && !isAscending} onClick={sortDescendingName}>
37
+ Descendent
38
+ </ListItem>
35
39
  <ListTitle>URL Sorting</ListTitle>
36
- <ListItem onClick={sortAscendingURL}>Ascendent</ListItem>
40
+ <ListItem isSelected={sortedByURL} onClick={sortAscendingURL}>
41
+ Ascendent
42
+ </ListItem>
37
43
  </FloatingMenu>
38
44
  );
39
45
  };
@@ -74,7 +74,7 @@ const Site = (props: ISiteProps): JSX.Element => {
74
74
  );
75
75
 
76
76
  return (
77
- <FloatingMenu isWide={true} Button={Header} position="left" closeOnSelect={false} isCheckGroup={true}>
77
+ <FloatingMenu Button={Header} position="left" closeOnSelect={false} isCheckGroup={true}>
78
78
  <ListTitle>Filter by Site</ListTitle>
79
79
  <S.ChecksWrapper>
80
80
  <CheckGroup options={options} value={selectedValue} onChange={setQuery} selectAllOption={selectAllOption} />
@@ -27,10 +27,14 @@ const Status = ({ sortItems, sortedState }: IStatusProps) => {
27
27
  );
28
28
 
29
29
  return (
30
- <FloatingMenu isWide={true} Button={Header} position="left">
30
+ <FloatingMenu Button={Header} position="left">
31
31
  <ListTitle>Sort by modified date</ListTitle>
32
- <ListItem onClick={sortMostRecentModifiedDate}>Most recent</ListItem>
33
- <ListItem onClick={sortOldestModifiedDate}>Oldest</ListItem>
32
+ <ListItem isSelected={sortedByDate && !isAscending} onClick={sortMostRecentModifiedDate}>
33
+ Most recent
34
+ </ListItem>
35
+ <ListItem isSelected={sortedByDate && isAscending} onClick={sortOldestModifiedDate}>
36
+ Oldest
37
+ </ListItem>
34
38
  </FloatingMenu>
35
39
  );
36
40
  };
@@ -49,7 +49,7 @@ const Translations = (props: ITranslationsProps): JSX.Element => {
49
49
  );
50
50
 
51
51
  return (
52
- <FloatingMenu isWide={true} Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
52
+ <FloatingMenu Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
53
53
  <ListTitle>Filter by translations</ListTitle>
54
54
  <S.ChecksWrapper>
55
55
  <CheckGroup options={filters} value={selectedValue} onChange={setQuery} selectAllOption={selectAllOption} />
@@ -36,7 +36,7 @@ const Types = ({ filterItems }: ITypesProps): JSX.Element => {
36
36
  );
37
37
 
38
38
  return (
39
- <FloatingMenu isWide={true} Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
39
+ <FloatingMenu Button={Header} position="left" closeOnSelect={true} isCheckGroup={true}>
40
40
  <ListTitle>Filter by type</ListTitle>
41
41
  <S.ChecksWrapper>
42
42
  <CheckGroup
@@ -72,11 +72,14 @@ const OptionTable = (props: IOptionTableProps): JSX.Element => {
72
72
  <S.Column>
73
73
  {filters.map((item: IStructuredDataFilter, i: number) => {
74
74
  const displayFilteredOptions = () => state.selectedType !== item.value && displayOptions(item);
75
- const isSelected = item.value === state.selectedType ? "selected" : "";
75
+ const isSelected = item.value === state.selectedType;
76
+ const selectedClass = isSelected ? "selected" : "";
76
77
  return (
77
78
  <MenuItem key={`${item.value}${i}`}>
78
- <S.NavLink onClick={displayFilteredOptions} className={isSelected}>
79
- {item.label}
79
+ <S.NavLink onClick={displayFilteredOptions} className={selectedClass}>
80
+ <S.Link active={isSelected}>
81
+ {item.label}
82
+ </S.Link>
80
83
  </S.NavLink>
81
84
  </MenuItem>
82
85
  );
@@ -48,3 +48,7 @@ export const Thumbnail = styled.div<{ backgroundUrl: string | boolean }>`
48
48
  min-width: calc(${(p) => p.theme.spacing.l} * 3);
49
49
  height: 100%;
50
50
  `;
51
+
52
+ export const Link = styled.div<{ active: boolean }>`
53
+ color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
54
+ `;
@@ -141,7 +141,7 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
141
141
 
142
142
  const translations =
143
143
  currentStructuredData && currentStructuredData.translate ? (
144
- <FloatingMenu Button={FlagsButton} isWide={true}>
144
+ <FloatingMenu Button={FlagsButton}>
145
145
  {languageMenu()}
146
146
  </FloatingMenu>
147
147
  ) : (
@@ -28,13 +28,21 @@ const NameHeader = ({ sortItems, sortedState }: INameHeaderProps) => {
28
28
  );
29
29
 
30
30
  return (
31
- <FloatingMenu isWide={true} Button={Header} position="left">
31
+ <FloatingMenu Button={Header} position="left">
32
32
  <ListTitle>Name Sorting</ListTitle>
33
- <ListItem onClick={sortAscendingName}>Ascendent</ListItem>
34
- <ListItem onClick={sortDescendingName}>Descendent</ListItem>
33
+ <ListItem isSelected={sortedByName && isAscending} onClick={sortAscendingName}>
34
+ Ascendent
35
+ </ListItem>
36
+ <ListItem isSelected={sortedByName && !isAscending} onClick={sortDescendingName}>
37
+ Descendent
38
+ </ListItem>
35
39
  <ListTitle>Date Created Sorting</ListTitle>
36
- <ListItem onClick={sortAscendingDateCreated}>Ascendent</ListItem>
37
- <ListItem onClick={sortDescendingDateCreated}>Descendent</ListItem>
40
+ <ListItem isSelected={sortedByDateCreated && isAscending} onClick={sortAscendingDateCreated}>
41
+ Ascendent
42
+ </ListItem>
43
+ <ListItem isSelected={sortedByDateCreated && !isAscending} onClick={sortDescendingDateCreated}>
44
+ Descendent
45
+ </ListItem>
38
46
  </FloatingMenu>
39
47
  );
40
48
  };
@@ -0,0 +1,7 @@
1
+ import pageSchemas from "./pages";
2
+
3
+ const fixedSchemas = {
4
+ ...pageSchemas,
5
+ };
6
+
7
+ export { fixedSchemas, pageSchemas };