@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
@@ -11,7 +11,6 @@ import { sitesActions } from "@ax/containers/Sites";
11
11
  import { pageStatus } from "@ax/containers/PageEditor/interfaces";
12
12
  import { RouteLeavingGuard } from "@ax/guards";
13
13
  import { useIsDirty, useModal } from "@ax/hooks";
14
- import { setIsSavedData } from "@ax/forms";
15
14
  import Editor from "./Editor";
16
15
 
17
16
  import * as S from "./style";
@@ -39,12 +38,13 @@ const GlobalEditor = (props: IProps) => {
39
38
  setCurrentSiteInfo,
40
39
  savedSiteInfo,
41
40
  userEditing,
41
+ isNewTranslation,
42
42
  } = props;
43
43
 
44
44
  const { isOpen, toggleModal } = useModal();
45
45
  const { isOpen: isUnpublishOpen, toggleModal: toggleUnpublishModal } = useModal();
46
46
  const [isPreviewMode, setIsPreviewMode] = useState(false);
47
- const { isDirty } = useIsDirty(editorContent.editorContent);
47
+ const { isDirty, setIsDirty, resetDirty } = useIsDirty(editorContent.editorContent, isNewTranslation);
48
48
 
49
49
  const isPublished = props.pageStatus === pageStatus.PUBLISHED || props.pageStatus === pageStatus.UPLOAD_PENDING;
50
50
  const isDraft = props.pageStatus === pageStatus.MODIFIED;
@@ -61,6 +61,9 @@ const GlobalEditor = (props: IProps) => {
61
61
  const handleGetPage = async () => await getPage(pageID, true);
62
62
  setTab(defaultTab);
63
63
  handleGetPage();
64
+ if (!pageID) {
65
+ setIsDirty(true);
66
+ }
64
67
 
65
68
  const interval = setInterval(() => {
66
69
  pageID && sendPagePing(pageID);
@@ -97,24 +100,32 @@ const GlobalEditor = (props: IProps) => {
97
100
 
98
101
  const publishPage = async () => {
99
102
  const { updatePageStatus, savePage, pageID } = props;
100
- setIsSavedData(true);
101
103
 
102
104
  const publishPage = {
103
105
  status: pageStatus.UPLOAD_PENDING,
104
106
  };
105
107
 
106
- pageID ? await updatePageStatus([pageID], pageStatus.UPLOAD_PENDING) : await savePage(false, publishPage);
108
+ pageID
109
+ ? await updatePageStatus([pageID], pageStatus.UPLOAD_PENDING)
110
+ : await savePage(false, publishPage).then((isSaved: boolean) => {
111
+ if (isSaved) {
112
+ resetDirty();
113
+ }
114
+ });
107
115
  };
108
116
 
109
117
  const publishChanges = async () => {
110
118
  const { savePage } = props;
111
- setIsSavedData(true);
112
119
 
113
120
  const publishPage = {
114
121
  status: pageStatus.UPLOAD_PENDING,
115
122
  };
116
123
 
117
- await savePage(false, publishPage);
124
+ await savePage(false, publishPage).then((isSaved: boolean) => {
125
+ if (isSaved) {
126
+ resetDirty();
127
+ }
128
+ });
118
129
  };
119
130
 
120
131
  const unpublishPage = async () => {
@@ -136,17 +147,23 @@ const GlobalEditor = (props: IProps) => {
136
147
 
137
148
  const handlePublishDraft = async () => {
138
149
  const { savePage } = props;
139
- setIsSavedData(true);
140
- await savePage(false, null, true);
150
+
151
+ await savePage(false, null, true).then((isSaved: boolean) => {
152
+ if (isSaved) {
153
+ resetDirty();
154
+ }
155
+ });
141
156
  };
142
157
 
143
158
  const handleDiscardDraft = async () => {
144
159
  const { discardDraft } = props;
160
+ resetDirty();
145
161
  await discardDraft();
146
162
  };
147
163
 
148
164
  const handleDiscarChanges = async () => {
149
165
  const { getPage, pageID } = props;
166
+ resetDirty();
150
167
  await getPage(pageID, true);
151
168
  };
152
169
 
@@ -230,7 +247,6 @@ const GlobalEditor = (props: IProps) => {
230
247
 
231
248
  const handleSavePage = async () => {
232
249
  const { savePage } = props;
233
- setIsSavedData(true);
234
250
 
235
251
  const publishPage = {
236
252
  status: pageStatus.UPLOAD_PENDING,
@@ -238,7 +254,11 @@ const GlobalEditor = (props: IProps) => {
238
254
 
239
255
  const createDraft = isPublished && !hasDraft;
240
256
  const status = props.pageStatus === pageStatus.PUBLISHED && !createDraft ? publishPage : undefined;
241
- await savePage(createDraft, status);
257
+ await savePage(createDraft, status).then((isSaved: boolean) => {
258
+ if (isSaved) {
259
+ resetDirty();
260
+ }
261
+ });
242
262
  };
243
263
 
244
264
  const goToPages = (path: string) => setRoute(path);
@@ -259,15 +279,15 @@ const GlobalEditor = (props: IProps) => {
259
279
  switch (props.pageStatus) {
260
280
  case pageStatus.PUBLISHED:
261
281
  case pageStatus.UPLOAD_PENDING:
262
- return isPublished && hasDraft ? "Save & publish" : "Save draft";
282
+ return !isDirty ? "Saved" : isPublished && hasDraft ? "Save & publish" : "Save draft";
263
283
  default:
264
- return "Save";
284
+ return !isDirty ? "Saved" : "Save";
265
285
  }
266
286
  };
267
287
 
268
288
  const rightButtonProps = {
269
289
  label: isSaving ? "Saving" : getSaveLabel(),
270
- disabled: isSaving || isPreviewMode,
290
+ disabled: isSaving || isPreviewMode || !isDirty,
271
291
  action: handleSavePage,
272
292
  };
273
293
 
@@ -280,6 +300,7 @@ const GlobalEditor = (props: IProps) => {
280
300
 
281
301
  const toggleDraftPage = async () => {
282
302
  const { getPage } = props;
303
+ resetDirty();
283
304
  const pageID = isDraft ? editorContent.editorContent.draftFromPage : editorContent.editorContent.haveDraftPage;
284
305
  await getPage(pageID);
285
306
  };
@@ -445,6 +466,7 @@ const mapStateToProps = (state: IRootState): IPageEditorStateProps => ({
445
466
  savedSiteInfo: state.sites.savedSiteInfo,
446
467
  userEditing: state.pageEditor.userEditing,
447
468
  currentUserID: state.users.currentUser.id,
469
+ isNewTranslation: state.pageEditor.isNewTranslation,
448
470
  });
449
471
 
450
472
  interface IPageEditorStateProps {
@@ -463,6 +485,7 @@ interface IPageEditorStateProps {
463
485
  savedSiteInfo: any;
464
486
  userEditing: IUserEditing | null;
465
487
  currentUserID: number | null;
488
+ isNewTranslation: boolean;
466
489
  }
467
490
 
468
491
  const mapDispatchToProps = {
@@ -485,7 +508,7 @@ const mapDispatchToProps = {
485
508
 
486
509
  interface IPageEditorDispatchProps {
487
510
  getPage(pageID?: number, global?: boolean): Promise<void>;
488
- savePage(createDraft: boolean, publishPage?: any, publishDraft?: boolean): Promise<void>;
511
+ savePage(createDraft: boolean, publishPage?: any, publishDraft?: boolean): Promise<boolean>;
489
512
  deletePage(params?: ISavePageParams): Promise<boolean>;
490
513
  validatePage(): Promise<boolean>;
491
514
  updatePageStatus(id: number[], status: string): Promise<boolean>;
@@ -26,27 +26,42 @@ const DefaultsEditor = (props: IProps) => {
26
26
  currentDefaultsContent,
27
27
  navLanguages,
28
28
  isNewTranslation,
29
- createNewTranslation,
29
+ createTranslation,
30
30
  selectedDefault,
31
31
  setHeader,
32
32
  setFooter,
33
33
  setHistoryPush,
34
+ header,
35
+ footer,
34
36
  } = props;
35
37
 
36
38
  const { isOpen, toggleModal } = useModal();
39
+ const { isDirty, setIsDirty, resetDirty } = useIsDirty(editorContent, isNewTranslation);
40
+
41
+ const currentDefaultNav = currentDefaultsContent.find((item: any) => item.setAsDefault);
42
+ const isNew = !header && !footer;
43
+ const isSetAsDefault = editorContent && editorContent.setAsDefault;
37
44
 
38
45
  useEffect(() => {
39
46
  getValues();
47
+ if (isNew) {
48
+ setIsDirty(true);
49
+ }
40
50
  // eslint-disable-next-line react-hooks/exhaustive-deps
41
51
  }, []);
42
52
 
43
- const { isDirty } = useIsDirty(editorContent);
44
- const currentDefaultNav = currentDefaultsContent.find((item: any) => item.setAsDefault);
45
- const isNew = editorContent && !editorContent.id;
46
- const isSetAsDefault = editorContent && editorContent.setAsDefault;
47
-
48
53
  const save = () => {
49
- isNew || isNewTranslation ? createNavigation() : updateNavigation(editorContent.id, editorContent, true);
54
+ isNew || isNewTranslation
55
+ ? createNavigation().then((isSaved: boolean) => {
56
+ if (isSaved) {
57
+ resetDirty();
58
+ }
59
+ })
60
+ : updateNavigation(editorContent.id, editorContent, true).then((isSaved: boolean) => {
61
+ if (isSaved) {
62
+ resetDirty();
63
+ }
64
+ });
50
65
  };
51
66
 
52
67
  const saveAsDefault = () => {
@@ -61,8 +76,8 @@ const DefaultsEditor = (props: IProps) => {
61
76
  };
62
77
 
63
78
  const rightButtonProps = {
64
- label: isSaving ? "Saving" : "Save",
65
- disabled: isSaving,
79
+ label: !isDirty ? "Saved" : isSaving ? "Saving" : "Save",
80
+ disabled: isSaving || !isDirty,
66
81
  action: () => saveButtonAction(),
67
82
  };
68
83
 
@@ -72,6 +87,11 @@ const DefaultsEditor = (props: IProps) => {
72
87
  getValues();
73
88
  };
74
89
 
90
+ const createNewTranslation = (isNewTranslation: boolean) => {
91
+ setIsDirty(true);
92
+ createTranslation(isNewTranslation);
93
+ };
94
+
75
95
  const languageActions = {
76
96
  setLanguage,
77
97
  createNewTranslation,
@@ -161,7 +181,7 @@ const mapDispatchToProps = {
161
181
  setSchema: navigationActions.setSchema,
162
182
  createNavigation: navigationActions.createNavigation,
163
183
  updateNavigation: navigationActions.updateNavigation,
164
- createNewTranslation: navigationActions.createNewTranslation,
184
+ createTranslation: navigationActions.createNewTranslation,
165
185
  setHeader: navigationActions.setHeader,
166
186
  setFooter: navigationActions.setFooter,
167
187
  };
@@ -170,9 +190,9 @@ interface IDispatchProps {
170
190
  setHistoryPush(path: string, isEditor?: boolean): void;
171
191
  setLanguage?(lang: { locale: string; id: number | null }): void;
172
192
  getValues(): void;
173
- createNavigation(): void;
174
- updateNavigation(navID: number, data: any, fromEditor?: boolean): void;
175
- createNewTranslation(isNewTranslation: boolean): void;
193
+ createNavigation(): Promise<boolean>;
194
+ updateNavigation(navID: number, data: any, fromEditor?: boolean): Promise<boolean>;
195
+ createTranslation(isNewTranslation: boolean): void;
176
196
  setHeader(id: number | null): void;
177
197
  setFooter(id: number | null): void;
178
198
  }
@@ -32,7 +32,7 @@ const Translations = (props: IProps) => {
32
32
  const { currentLanguages, locale, languages, handleLanguage } = props;
33
33
 
34
34
  return (
35
- <FloatingMenu Button={() => FlagsButton(currentLanguages)} isWide={true}>
35
+ <FloatingMenu Button={() => FlagsButton(currentLanguages)}>
36
36
  <LangMenu
37
37
  currentLanguages={currentLanguages}
38
38
  locale={locale}
@@ -3,6 +3,8 @@ import { NavLink } from "react-router-dom";
3
3
 
4
4
  import { SubNav, MenuItem } from "@ax/components";
5
5
 
6
+ import * as S from './style';
7
+
6
8
  const DefaultNav = (props: IProps): JSX.Element => {
7
9
  const { current, defaultTypes, onClick } = props;
8
10
 
@@ -10,12 +12,15 @@ const DefaultNav = (props: IProps): JSX.Element => {
10
12
  <SubNav>
11
13
  {defaultTypes &&
12
14
  defaultTypes.map((type: string, key: number) => {
13
- const isSelected = current && type === current ? "selected" : "";
15
+ const isSelected = !!current && type === current;
16
+ const selectedClass = isSelected ? "selected" : "";
14
17
  const handleClick = () => onClick(type);
15
18
  return (
16
19
  <MenuItem key={key} onClick={handleClick}>
17
- <NavLink to="#" className={isSelected}>
18
- {type}
20
+ <NavLink to="#" className={selectedClass}>
21
+ <S.Link active={isSelected}>
22
+ {type}
23
+ </S.Link>
19
24
  </NavLink>
20
25
  </MenuItem>
21
26
  );
@@ -35,3 +35,7 @@ export const SubItem = styled.li`
35
35
  `;
36
36
 
37
37
  export const Item = styled.article``;
38
+
39
+ export const Link = styled.div<{ active: boolean }>`
40
+ color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
41
+ `;
@@ -32,6 +32,7 @@ const DefaultsList = (props: IProps): JSX.Element => {
32
32
  restoreNavigation,
33
33
  deleteNavigation,
34
34
  getMenus,
35
+ resetDefaultsValues,
35
36
  } = props;
36
37
 
37
38
  const [page, setPage] = useState(1);
@@ -86,6 +87,7 @@ const DefaultsList = (props: IProps): JSX.Element => {
86
87
  const memoizedGetMenus = useCallback(() => getMenus(), [getMenus]);
87
88
 
88
89
  useEffect(() => {
90
+ resetDefaultsValues();
89
91
  memoizedGetMenus();
90
92
  // eslint-disable-next-line react-hooks/exhaustive-deps
91
93
  }, []);
@@ -228,6 +230,7 @@ interface IDispatchProps {
228
230
  restoreNavigation(navID: number | number[], type: string): void;
229
231
  deleteNavigation(navID: number[], type: string): Promise<boolean>;
230
232
  getMenus(): void;
233
+ resetDefaultsValues(): void;
231
234
  }
232
235
 
233
236
  interface IDefaultsProps {
@@ -251,6 +254,7 @@ const mapDispatchToProps = {
251
254
  restoreNavigation: navigationActions.restoreNavigation,
252
255
  deleteNavigation: navigationActions.deleteNavigation,
253
256
  getMenus: menuActions.getMenus,
257
+ resetDefaultsValues: navigationActions.resetDefaultsValues,
254
258
  };
255
259
 
256
260
  export default connect(mapStateToProps, mapDispatchToProps)(DefaultsList);
@@ -7,6 +7,8 @@ import { IRootState } from "@ax/types";
7
7
  import { useModal } from "@ax/hooks";
8
8
  import { menuActions } from "@ax/containers/Navigation";
9
9
 
10
+ import * as S from "./style";
11
+
10
12
  const Nav = (props: INav): JSX.Element => {
11
13
  const { getCurrentMenu, currentType, isDirty, currentMenus } = props;
12
14
  const [category, setCategory] = useState(currentType);
@@ -29,12 +31,15 @@ const Nav = (props: INav): JSX.Element => {
29
31
  isDirty ? toggleModal() : getCurrentMenu(category.name);
30
32
  };
31
33
 
32
- const isSelected = category.name === currentType ? "selected" : "";
34
+ const isSelected = category.name === currentType;
35
+ const selectedClass = isSelected ? "selected" : "";
33
36
 
34
37
  return (
35
38
  <MenuItem onClick={_handleClick} key={category.name}>
36
- <NavLink to="#" className={isSelected}>
37
- {category.title}
39
+ <NavLink to="#" className={selectedClass}>
40
+ <S.Link active={isSelected}>
41
+ {category.title}
42
+ </S.Link>
38
43
  </NavLink>
39
44
  </MenuItem>
40
45
  );
@@ -10,3 +10,7 @@ export const ModalContent = styled.div`
10
10
  margin-bottom: 0;
11
11
  }
12
12
  `;
13
+
14
+ export const Link = styled.div<{ active: boolean }>`
15
+ color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
16
+ `;
@@ -39,7 +39,9 @@ const List = (props: IMenuList): JSX.Element => {
39
39
  return (
40
40
  <S.ListWrapper>
41
41
  <Nav isDirty={isDirty} />
42
- <Table isDirty={isDirty} />
42
+ <S.TableWrapper>
43
+ <Table isDirty={isDirty} />
44
+ </S.TableWrapper>
43
45
  </S.ListWrapper>
44
46
  );
45
47
  };
@@ -1,6 +1,14 @@
1
1
  import styled from "styled-components";
2
2
 
3
- export const ListWrapper = styled.div`
3
+ const ListWrapper = styled.div`
4
4
  display: flex;
5
5
  height: 100%;
6
6
  `;
7
+
8
+ const TableWrapper = styled.div`
9
+ width: 100%;
10
+ height: 100%;
11
+ overflow: auto;
12
+ `;
13
+
14
+ export { ListWrapper, TableWrapper };
@@ -10,7 +10,6 @@ import { navigationActions } from "@ax/containers/Navigation";
10
10
  import { pageStatus } from "@ax/containers/PageEditor/interfaces";
11
11
  import { RouteLeavingGuard } from "@ax/guards";
12
12
  import { useIsDirty, useModal } from "@ax/hooks";
13
- import { setIsSavedData } from "@ax/forms";
14
13
  import { isModuleDisabled } from "@ax/helpers";
15
14
  import { dataPacksActions } from "@ax/containers/Settings/DataPacks";
16
15
  import Editor from "./Editor";
@@ -42,10 +41,11 @@ const PageEditor = (props: IProps) => {
42
41
  validated,
43
42
  pageEditor: { editorContent, schema },
44
43
  userEditing,
44
+ isNewTranslation,
45
45
  } = props;
46
46
 
47
47
  const [isPreviewMode, setIsPreviewMode] = useState(false);
48
- const { isDirty } = useIsDirty(editorContent.editorContent);
48
+ const { isDirty, setIsDirty, resetDirty } = useIsDirty(editorContent.editorContent, isNewTranslation);
49
49
  const { isOpen, toggleModal } = useModal();
50
50
  const { isOpen: isUnpublishOpen, toggleModal: toggleUnpublishModal } = useModal();
51
51
 
@@ -63,6 +63,10 @@ const PageEditor = (props: IProps) => {
63
63
  setTab(defaultTab);
64
64
  handleGetPage();
65
65
 
66
+ if (!pageID) {
67
+ setIsDirty(true);
68
+ }
69
+
66
70
  const interval = setInterval(() => {
67
71
  pageID && sendPagePing(pageID);
68
72
  }, 30000);
@@ -103,24 +107,32 @@ const PageEditor = (props: IProps) => {
103
107
 
104
108
  const publishPage = async () => {
105
109
  const { updatePageStatus, savePage, pageID } = props;
106
- setIsSavedData(true);
107
110
 
108
111
  const publishPage = {
109
112
  status: pageStatus.UPLOAD_PENDING,
110
113
  };
111
114
 
112
- pageID ? await updatePageStatus([pageID], pageStatus.UPLOAD_PENDING) : await savePage(false, publishPage);
115
+ pageID
116
+ ? await updatePageStatus([pageID], pageStatus.UPLOAD_PENDING)
117
+ : await savePage(false, publishPage).then((isSaved: boolean) => {
118
+ if (isSaved) {
119
+ resetDirty();
120
+ }
121
+ });
113
122
  };
114
123
 
115
124
  const publishChanges = async () => {
116
125
  const { savePage } = props;
117
- setIsSavedData(true);
118
126
 
119
127
  const publishPage = {
120
128
  status: pageStatus.UPLOAD_PENDING,
121
129
  };
122
130
 
123
- await savePage(false, publishPage);
131
+ await savePage(false, publishPage).then((isSaved: boolean) => {
132
+ if (isSaved) {
133
+ resetDirty();
134
+ }
135
+ });
124
136
  };
125
137
 
126
138
  const unpublishPage = async () => {
@@ -142,17 +154,23 @@ const PageEditor = (props: IProps) => {
142
154
 
143
155
  const handlePublishDraft = async () => {
144
156
  const { savePage } = props;
145
- setIsSavedData(true);
146
- await savePage(false, null, true);
157
+ await savePage(false, null, true).then((isSaved: boolean) => {
158
+ if (isSaved) {
159
+ resetDirty();
160
+ }
161
+ });
147
162
  };
148
163
 
149
164
  const handleDiscardDraft = async () => {
150
165
  const { discardDraft } = props;
166
+ resetDirty();
151
167
  await discardDraft();
152
168
  };
153
169
 
154
170
  const handleDiscarChanges = async () => {
155
171
  const { getPage, pageID } = props;
172
+ resetDirty();
173
+
156
174
  await getPage(pageID);
157
175
  };
158
176
 
@@ -238,7 +256,6 @@ const PageEditor = (props: IProps) => {
238
256
 
239
257
  const handleSavePage = async () => {
240
258
  const { savePage } = props;
241
- setIsSavedData(true);
242
259
 
243
260
  const publishPage = {
244
261
  status: pageStatus.UPLOAD_PENDING,
@@ -247,7 +264,11 @@ const PageEditor = (props: IProps) => {
247
264
  const createDraft = isPublished && !hasDraft && !isGlobal;
248
265
  const status = props.pageStatus === pageStatus.PUBLISHED && !createDraft ? publishPage : undefined;
249
266
 
250
- await savePage(createDraft, status);
267
+ await savePage(createDraft, status).then((isSaved: boolean) => {
268
+ if (isSaved) {
269
+ resetDirty();
270
+ }
271
+ });
251
272
  };
252
273
 
253
274
  const goToPages = (path: string) => setRoute(path);
@@ -286,15 +307,15 @@ const PageEditor = (props: IProps) => {
286
307
  switch (props.pageStatus) {
287
308
  case pageStatus.PUBLISHED:
288
309
  case pageStatus.UPLOAD_PENDING:
289
- return isGlobal || (isPublished && hasDraft) ? "Save & publish" : "Save draft";
310
+ return !isDirty ? "Saved" : isGlobal || (isPublished && hasDraft) ? "Save & publish" : "Save draft";
290
311
  default:
291
- return "Save";
312
+ return !isDirty ? "Saved" : "Save";
292
313
  }
293
314
  };
294
315
 
295
316
  const rightButtonProps = {
296
317
  label: isSaving ? "Saving" : getSaveLabel(),
297
- disabled: isSaving || (!isTemplateActivated && !isGlobal) || isPreviewMode,
318
+ disabled: isSaving || (!isTemplateActivated && !isGlobal) || isPreviewMode || !isDirty,
298
319
  action: handleSavePage,
299
320
  };
300
321
 
@@ -307,6 +328,7 @@ const PageEditor = (props: IProps) => {
307
328
 
308
329
  const toggleDraftPage = async () => {
309
330
  const { getPage } = props;
331
+ resetDirty();
310
332
  const pageID = isDraft ? editorContent.editorContent.draftFromPage : editorContent.editorContent.haveDraftPage;
311
333
  await getPage(pageID);
312
334
  };
@@ -482,6 +504,7 @@ const mapStateToProps = (state: IRootState): IPageEditorStateProps => ({
482
504
  validated: state.pageEditor.validated,
483
505
  userEditing: state.pageEditor.userEditing,
484
506
  currentUserID: state.users.currentUser.id,
507
+ isNewTranslation: state.pageEditor.isNewTranslation,
485
508
  });
486
509
 
487
510
  interface IPageEditorStateProps {
@@ -501,6 +524,7 @@ interface IPageEditorStateProps {
501
524
  validated: boolean;
502
525
  userEditing: IUserEditing | null;
503
526
  currentUserID: number | null;
527
+ isNewTranslation: boolean;
504
528
  }
505
529
 
506
530
  const mapDispatchToProps = {
@@ -524,7 +548,7 @@ const mapDispatchToProps = {
524
548
 
525
549
  interface IPageEditorDispatchProps {
526
550
  getPage(pageID?: number): Promise<void>;
527
- savePage(createDraft: boolean, publishPage?: any, publishDraft?: boolean): Promise<void>;
551
+ savePage(createDraft: boolean, publishPage?: any, publishDraft?: boolean): Promise<boolean>;
528
552
  deletePage(params?: ISavePageParams): Promise<boolean>;
529
553
  validatePage(): Promise<boolean>;
530
554
  updatePageStatus(id: number[], status: string): Promise<boolean>;
@@ -21,7 +21,7 @@ const Filter = (props: IProps) => {
21
21
  const handleClickAll = () => setFilter(null);
22
22
 
23
23
  return (
24
- <FloatingMenu isWide={true} Button={Select} position="left">
24
+ <FloatingMenu Button={Select} position="left">
25
25
  <ListTitle>Filter by category</ListTitle>
26
26
  <ListItem key="all" onClick={handleClickAll}>
27
27
  All
@@ -27,7 +27,7 @@ const SortFilter = (props: IProps) => {
27
27
  );
28
28
 
29
29
  return (
30
- <FloatingMenu isWide={true} Button={Select} position="left">
30
+ <FloatingMenu Button={Select} position="left">
31
31
  <ListTitle>Name Sorting</ListTitle>
32
32
  <ListItem onClick={orderByNameAscending}>Ascendent</ListItem>
33
33
  <ListItem onClick={orderByNameDescending}>Descendent</ListItem>
@@ -22,7 +22,7 @@ const Nav = (props: IProps): JSX.Element => {
22
22
  isDirty ? toggleModal() : selectPack(null);
23
23
  };
24
24
 
25
- const isSelected = selected ? "" : "selected";
25
+ const selectedClass = selected ? "" : "selected";
26
26
 
27
27
  const infoMenuProps: { icon: string; message: string; actionText: string; iconSize: "s" } = {
28
28
  icon: "alert",
@@ -43,8 +43,10 @@ const Nav = (props: IProps): JSX.Element => {
43
43
  <S.Item>
44
44
  <S.Heading>Your packages</S.Heading>
45
45
  <MenuItem onClick={resetFilter}>
46
- <NavLink to="#" className={isSelected}>
47
- Activated packages
46
+ <NavLink to="#" className={selectedClass}>
47
+ <S.Link active={!selected}>
48
+ Activated packages
49
+ </S.Link>
48
50
  </NavLink>
49
51
  </MenuItem>
50
52
  </S.Item>
@@ -55,16 +57,19 @@ const Nav = (props: IProps): JSX.Element => {
55
57
  activated.map((dataPack: any, key: number) => {
56
58
  const { id, title, templates, config } = dataPack;
57
59
  const isFromPage = templates && templates.length > 0;
58
- const isSelected = id === (selected && selected.id) ? "selected" : "";
60
+ const isSelected = id === (selected && selected.id);
61
+ const selectedClass = isSelected ? "selected" : "";
59
62
  const _handleClick = () => {
60
63
  setSelectedID(id);
61
64
  isDirty ? toggleModal() : selectPack(id);
62
65
  };
63
66
  return (
64
67
  <MenuItem key={key} onClick={_handleClick}>
65
- <NavLink to="#" className={isSelected}>
68
+ <NavLink to="#" className={selectedClass}>
66
69
  <S.LinkWrapper>
67
- {title}
70
+ <S.Link active={isSelected}>
71
+ {title}
72
+ </S.Link>
68
73
  {isFromPage && !config && <InformativeMenu {...infoMenuProps} />}
69
74
  </S.LinkWrapper>
70
75
  </NavLink>
@@ -45,9 +45,14 @@ const LinkWrapper = styled.div`
45
45
  justify-content: center;
46
46
  `;
47
47
 
48
+ const Link = styled.div<{ active: boolean }>`
49
+ color: ${p => p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis};
50
+ `;
51
+
48
52
  export {
49
53
  Heading,
50
54
  SubItem,
51
55
  Item,
52
- LinkWrapper
56
+ LinkWrapper,
57
+ Link
53
58
  }