@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.
- package/config/griddo-config.js +1 -0
- package/package.json +2 -2
- package/src/components/ActionMenu/index.tsx +1 -1
- package/src/components/Fields/ComponentArray/MixableComponentArray/index.tsx +7 -1
- package/src/components/Fields/ComponentArray/MixableComponentArray/style.tsx +29 -24
- package/src/components/Fields/ComponentArray/SameComponentArray/index.tsx +7 -1
- package/src/components/Fields/ComponentArray/SameComponentArray/style.tsx +29 -24
- package/src/components/Fields/DateField/index.tsx +3 -2
- package/src/components/Fields/ReferenceField/AutoPanel/AutoItem/index.tsx +1 -1
- package/src/components/Fields/ReferenceField/AutoPanel/index.tsx +1 -1
- package/src/components/Fields/ReferenceField/ItemList/Item/index.tsx +1 -1
- package/src/components/Fields/UrlField/index.tsx +12 -1
- package/src/components/Fields/Wysiwyg/config.tsx +80 -56
- package/src/components/Fields/Wysiwyg/index.tsx +23 -6
- package/src/components/FloatingMenu/index.tsx +9 -6
- package/src/components/FloatingMenu/style.tsx +8 -6
- package/src/components/Gallery/GalleryFilters/Orientation/index.tsx +1 -1
- package/src/components/Gallery/GalleryFilters/SortBy/index.tsx +1 -1
- package/src/components/InformativeMenu/index.tsx +3 -2
- package/src/components/InformativeMenu/style.tsx +0 -1
- package/src/components/MainWrapper/AppBar/index.tsx +8 -7
- package/src/components/MainWrapper/AppBar/style.tsx +7 -0
- package/src/components/MenuItem/style.tsx +1 -0
- package/src/components/Modal/style.tsx +14 -13
- package/src/components/Nav/index.tsx +8 -3
- package/src/components/Nav/style.tsx +5 -0
- package/src/components/SearchField/index.tsx +43 -14
- package/src/components/SearchField/style.tsx +23 -10
- package/src/components/SideModal/index.tsx +24 -8
- package/src/components/SideModal/style.tsx +13 -2
- package/src/components/SubNav/style.tsx +3 -2
- package/src/containers/Navigation/Defaults/actions.tsx +26 -24
- package/src/containers/Navigation/Defaults/reducer.tsx +2 -2
- package/src/containers/PageEditor/actions.tsx +9 -8
- package/src/containers/Settings/Social/actions.tsx +9 -31
- package/src/containers/Settings/Social/constants.tsx +2 -3
- package/src/containers/Settings/Social/interfaces.tsx +2 -7
- package/src/containers/Settings/Social/reducer.tsx +3 -14
- package/src/containers/Sites/actions.tsx +3 -63
- package/src/containers/Sites/constants.tsx +0 -1
- package/src/containers/Sites/interfaces.tsx +0 -6
- package/src/containers/Sites/reducer.tsx +1 -29
- package/src/forms/editor.tsx +2 -0
- package/src/forms/validators.tsx +2 -0
- package/src/helpers/dates.tsx +23 -24
- package/src/helpers/index.tsx +2 -0
- package/src/helpers/objects.tsx +17 -2
- package/src/helpers/schemas.tsx +7 -4
- package/src/hooks/forms.tsx +23 -24
- package/src/modules/App/Routing/NavMenu/NavItem/index.tsx +10 -5
- package/src/modules/App/Routing/NavMenu/NavItem/style.tsx +13 -9
- package/src/modules/App/Routing/NavMenu/index.tsx +39 -37
- package/src/modules/App/Routing/NavMenu/style.tsx +9 -3
- package/src/modules/Categories/CategoriesList/CategoryItem/index.tsx +1 -1
- package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/index.tsx +6 -3
- package/src/modules/Categories/CategoriesList/CategoryNav/NavItem/style.tsx +5 -1
- package/src/modules/Content/ContentFilters/index.tsx +6 -3
- package/src/modules/Content/ContentFilters/style.tsx +6 -1
- package/src/modules/Content/HeaderMenus/Live/index.tsx +1 -1
- package/src/modules/Content/HeaderMenus/Name/index.tsx +10 -4
- package/src/modules/Content/HeaderMenus/Status/index.tsx +7 -3
- package/src/modules/Content/HeaderMenus/Translations/index.tsx +1 -1
- package/src/modules/Content/HeaderMenus/Types/index.tsx +1 -1
- package/src/modules/Content/OptionTable/index.tsx +6 -3
- package/src/modules/Content/OptionTable/style.tsx +4 -0
- package/src/modules/Content/PageItem/index.tsx +3 -3
- package/src/modules/Content/index.tsx +5 -3
- package/src/modules/GlobalEditor/index.tsx +37 -14
- package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +33 -13
- package/src/modules/Navigation/Defaults/Item/atoms.tsx +1 -1
- package/src/modules/Navigation/Defaults/Nav/index.tsx +8 -3
- package/src/modules/Navigation/Defaults/Nav/style.tsx +4 -0
- package/src/modules/Navigation/Defaults/index.tsx +4 -0
- package/src/modules/Navigation/Menus/List/Nav/index.tsx +8 -3
- package/src/modules/Navigation/Menus/List/Nav/style.tsx +4 -0
- package/src/modules/Navigation/Menus/List/index.tsx +3 -1
- package/src/modules/Navigation/Menus/List/style.tsx +9 -1
- package/src/modules/PageEditor/index.tsx +38 -14
- package/src/modules/Settings/ContentTypes/DataPacks/AddModal/Filter/index.tsx +1 -1
- package/src/modules/Settings/ContentTypes/DataPacks/AddModal/SortFilter/index.tsx +1 -1
- package/src/modules/Settings/ContentTypes/DataPacks/Nav/index.tsx +11 -6
- package/src/modules/Settings/ContentTypes/DataPacks/Nav/style.tsx +6 -1
- package/src/modules/Settings/Globals/index.tsx +19 -31
- package/src/modules/Settings/Languages/LanguagePanel/Form/index.tsx +1 -1
- package/src/modules/Settings/Languages/Table/Item/index.tsx +1 -1
- package/src/modules/Settings/Social/index.tsx +35 -91
- package/src/modules/Sites/SitesList/SiteModal/index.tsx +12 -27
- package/src/modules/Sites/SitesList/index.tsx +15 -15
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/index.tsx +3 -1
- package/src/modules/StructuredData/StructuredDataList/ContentFilters/style.tsx +6 -1
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +3 -3
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Live/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Name/index.tsx +10 -4
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Site/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Status/index.tsx +7 -3
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Translations/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/HeaderMenus/Types/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/OptionTable/index.tsx +6 -3
- package/src/modules/StructuredData/StructuredDataList/OptionTable/style.tsx +4 -0
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +1 -1
- package/src/modules/Users/UserList/HeaderMenus/Name/index.tsx +13 -5
- package/src/schemas/index.tsx +7 -0
- package/src/schemas/pages/GlobalPage.tsx +166 -0
- package/src/schemas/pages/Page.tsx +181 -0
- package/src/schemas/pages/index.tsx +4 -0
- package/src/types/index.tsx +8 -14
- package/tsconfig.paths.json +2 -1
- package/public/img/schemas/Accordion/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Accordion/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/AddressCollection/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/AddressCollection/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/BasicBoxedCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/BasicBoxedCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/BasicCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/BasicCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout003@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout003@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout004@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout004@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout005@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout005@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout006@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout006@2x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout007@1x.png +0 -0
- package/public/img/schemas/BasicContent/layouts/layout007@2x.png +0 -0
- package/public/img/schemas/BasicContent/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/BasicContent/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/BasicIconCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/BasicIconCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout003@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout003@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout004@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout004@2x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout005@1x.png +0 -0
- package/public/img/schemas/CardCollection/layouts/layout005@2x.png +0 -0
- package/public/img/schemas/CardCollection/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/CardCollection/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/DownloadCollection/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/DownloadCollection/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/EventCard/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/EventCard/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/EventCard/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/EventCard/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/EventCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/EventCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/EventsDistributor/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/EventsDistributor/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout003@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout003@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout004@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout004@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout005@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout005@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout006@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout006@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout007@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout007@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout008@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout008@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout009@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout009@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout010@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout010@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout011@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout011@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout012@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/layouts/layout012@2x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/FeaturedAudiovisual/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/FeaturedBlock/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/FeaturedBlock/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/FeaturedBlock/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/FeaturedBlock/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/FeaturedProgram/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/FeaturedProgram/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/FeaturedText/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/FeaturedText/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/FeedbackForm/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/FeedbackForm/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/HeroCarousel/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/HeroCarousel/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/HeroImage/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/HeroImage/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/IconCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/IconCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/IconCenteredCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/IconCenteredCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Image/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Image/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/ImageCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/ImageCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Intro/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Intro/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/LogoCard/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/LogoCard/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/NewsDistributor/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/NewsDistributor/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/PersonDistributor/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/PersonDistributor/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/PublicationDistributor/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/PublicationDistributor/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/SchoolFooter/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/SchoolFooter/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Slider/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Slider/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Testimonial/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/Testimonial/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/Testimonial/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/Testimonial/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/Testimonial/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Testimonial/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/TextBluePanel/layouts/layout001@1x.png +0 -0
- package/public/img/schemas/TextBluePanel/layouts/layout001@2x.png +0 -0
- package/public/img/schemas/TextBluePanel/layouts/layout002@1x.png +0 -0
- package/public/img/schemas/TextBluePanel/layouts/layout002@2x.png +0 -0
- package/public/img/schemas/TextBluePanel/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/TextBluePanel/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/Video/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/Video/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/imgHeros.png +0 -0
- package/public/img/schemas/imgStandard.jpg +0 -0
- package/public/img/schemas/templates/BasicTemplate/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/templates/BasicTemplate/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/templates/Error404/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/templates/Error404/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/templates/NewsList/thumbnails/thumbnail@1x.png +0 -0
- package/public/img/schemas/templates/NewsList/thumbnails/thumbnail@2x.png +0 -0
- package/public/img/schemas/themes/LinkStyle.png +0 -0
- package/public/img/schemas/themes/LinkStyle@2x.png +0 -0
- package/public/img/schemas/themes/PrimaryStyle.png +0 -0
- package/public/img/schemas/themes/PrimaryStyle@2x.png +0 -0
- package/public/img/schemas/themes/STYLE01.png +0 -0
- package/public/img/schemas/themes/STYLE02.png +0 -0
- package/public/img/schemas/themes/STYLE03.png +0 -0
- package/public/img/schemas/themes/STYLE04.png +0 -0
- package/public/img/schemas/themes/STYLE05.png +0 -0
- package/public/img/schemas/themes/STYLE06.png +0 -0
- package/public/img/schemas/themes/SecondaryStyle.png +0 -0
- package/public/img/schemas/themes/SecondaryStyle@2x.png +0 -0
- package/src/components/MainWrapper/AppBar/SearchField/index.tsx +0 -54
- package/src/components/MainWrapper/AppBar/SearchField/style.tsx +0 -55
|
@@ -1,49 +1,41 @@
|
|
|
1
|
-
import
|
|
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,
|
|
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
|
|
21
|
+
const [form, setForm] = useState(currentSiteInfo);
|
|
22
|
+
const { name, timezone, theme, favicon, smallAvatar, bigAvatar, thumbnail } = form;
|
|
26
23
|
|
|
27
|
-
const
|
|
24
|
+
const { isDirty, setIsDirty } = useIsDirty(form);
|
|
28
25
|
|
|
29
|
-
const
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
46
|
-
|
|
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
|
-
|
|
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
|
|
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}
|
|
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, {
|
|
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,
|
|
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 {
|
|
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
|
|
32
|
+
const [socialForm, setSocialForm] = useState<Record<string, string>>({});
|
|
33
|
+
const changeSocialForm = (field: string, value: string) => setSocialForm((state) => ({ ...state, [field]: value }));
|
|
25
34
|
|
|
26
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
47
|
-
|
|
43
|
+
setSocialForm({ ...socialInfo });
|
|
44
|
+
resetDirty();
|
|
45
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
}, [socialInfo]);
|
|
48
47
|
|
|
49
|
-
const saveForm = () => {
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
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,
|
|
11
|
+
const { languages, form, setForm } = props;
|
|
14
12
|
const { name, defaultLanguage, path, domain } = form;
|
|
15
|
-
const globalDefaultLang = languages
|
|
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
|
|
15
|
+
const updateForm = (newValue: Record<string, string | number>) => setForm((state: ISettingsForm) => ({ ...state, ...newValue }));
|
|
23
16
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
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
|
|
94
|
-
form:
|
|
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
|
-
|
|
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,
|
|
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 {
|
|
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,
|
|
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(
|
|
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
|
-
{
|
|
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.
|
|
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
|
|
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
|
|
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}
|
|
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
|
|
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
|
|
31
|
+
<FloatingMenu Button={Header} position="left">
|
|
32
32
|
<ListTitle>Name Sorting</ListTitle>
|
|
33
|
-
<ListItem onClick={sortAscendingName}>
|
|
34
|
-
|
|
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}>
|
|
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
|
|
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
|
|
30
|
+
<FloatingMenu Button={Header} position="left">
|
|
31
31
|
<ListTitle>Sort by modified date</ListTitle>
|
|
32
|
-
<ListItem onClick={sortMostRecentModifiedDate}>
|
|
33
|
-
|
|
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
|
|
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
|
|
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
|
|
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={
|
|
79
|
-
{
|
|
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}
|
|
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
|
|
31
|
+
<FloatingMenu Button={Header} position="left">
|
|
32
32
|
<ListTitle>Name Sorting</ListTitle>
|
|
33
|
-
<ListItem onClick={sortAscendingName}>
|
|
34
|
-
|
|
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}>
|
|
37
|
-
|
|
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
|
};
|