@learningpool/ui 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/datadisplay/WelcomeBanner/WelcomeBannerStyles.js +4 -1
- package/components/navigation/VerticalNavigation/VerticalNavigation.js +5 -5
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.js +0 -4
- package/components/stream/AppHub/AppHub.js +14 -11
- package/components/stream/AppHub/AppHubBannerAdvert.js +13 -2
- package/components/stream/AppHub/AppHubCustom.d.ts +1 -0
- package/components/stream/AppHub/AppHubCustom.js +20 -12
- package/components/stream/AppHub/AppHubCustomStyles.d.ts +1 -13
- package/components/stream/AppHub/AppHubProduct.d.ts +1 -0
- package/components/stream/AppHub/AppHubProduct.js +7 -13
- package/components/stream/AppHub/AppHubProductStyles.d.ts +2 -26
- package/components/stream/AppHub/AppHubProductStyles.js +1 -0
- package/components/stream/AppHub/AppHubStyles.js +2 -1
- package/components/stream/AppSwitcher/AppSwitcher.d.ts +2 -32
- package/components/stream/AppSwitcher/AppSwitcher.js +117 -261
- package/components/stream/AppSwitcher/AppSwitcherStyles.d.ts +46 -74
- package/components/stream/AppSwitcher/AppSwitcherStyles.js +46 -322
- package/components/stream/AppSwitcher/constants.d.ts +5 -0
- package/components/stream/AppSwitcher/constants.js +8 -3
- package/lang/en-us.d.ts +1 -0
- package/lang/en-us.js +2 -1
- package/package.json +1 -1
- package/types/components/navigation/VerticalNavigation.d.ts +0 -5
- package/types/components/stream/AppHub.d.ts +8 -0
- package/types/components/stream/AppSwitcher.d.ts +58 -8
- package/utils/helpers.d.ts +2 -1
- package/utils/helpers.js +11 -5
- package/components/stream/AppSwitcher/AppSwitcherItem.d.ts +0 -17
- package/components/stream/AppSwitcher/AppSwitcherItem.js +0 -40
- package/components/stream/AppSwitcher/AppSwitcherStylesStandalone.d.ts +0 -16
- package/components/stream/AppSwitcher/AppSwitcherStylesStandalone.js +0 -256
- package/components/stream/AppSwitcher/PromotionalCampaignItem.d.ts +0 -9
- package/components/stream/AppSwitcher/PromotionalCampaignItem.js +0 -29
package/lang/en-us.d.ts
CHANGED
package/lang/en-us.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const defaultMessages = {
|
|
2
2
|
// App Switcher
|
|
3
3
|
'app-switcher': 'App Switcher',
|
|
4
|
-
'your-apps': 'Your
|
|
4
|
+
'your-apps': 'Your Learning Pool Applications',
|
|
5
5
|
'custom-apps': 'Explore Custom Apps',
|
|
6
6
|
'add-item': 'Add item',
|
|
7
7
|
'lp-apps': 'Explore Learning Pool Apps',
|
|
@@ -15,6 +15,7 @@ export const defaultMessages = {
|
|
|
15
15
|
'stream-hub-welcome': 'Welcome to Stream Home',
|
|
16
16
|
'banner-image-alt-text': 'Banner Image advert',
|
|
17
17
|
'manage-links': 'Manage Links',
|
|
18
|
+
'data-not-found': 'Data Not Found',
|
|
18
19
|
// Navigation
|
|
19
20
|
'site-navigation': 'Site navigation',
|
|
20
21
|
'open-navigation': 'Open navigation',
|
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IApplication, IPromotionalCampaign } from '../stream/AppSwitcher';
|
|
3
2
|
import { IAvatarMenuItemProps } from './VerticalNavigationAvatar';
|
|
4
3
|
export interface IVerticalNavigationItemProps {
|
|
5
4
|
label: string;
|
|
@@ -26,12 +25,10 @@ export interface IVerticalNavigationProps {
|
|
|
26
25
|
items?: IVerticalNavigationItemProps[];
|
|
27
26
|
secondaryItems?: IVerticalNavigationItemProps[];
|
|
28
27
|
hasStreamHome?: boolean;
|
|
29
|
-
hideStreamHomeButton?: boolean;
|
|
30
28
|
StreamHomeUrl?: string;
|
|
31
29
|
streamHomeAccessToken?: string;
|
|
32
30
|
streamHomeBaseUrl?: string;
|
|
33
31
|
streamHomeApiKey?: string;
|
|
34
|
-
streamHomeApplications?: IApplication[];
|
|
35
32
|
avatarName?: string;
|
|
36
33
|
isDrawerOpen?: boolean;
|
|
37
34
|
isPersistent?: boolean;
|
|
@@ -40,8 +37,6 @@ export interface IVerticalNavigationProps {
|
|
|
40
37
|
localization?: any;
|
|
41
38
|
dataAttributes?: any;
|
|
42
39
|
showSupportLinks?: boolean;
|
|
43
|
-
hidePromotionalCampaign?: boolean;
|
|
44
|
-
promotionalCampaigns?: IPromotionalCampaign[];
|
|
45
40
|
hasAvatar?: boolean;
|
|
46
41
|
avatarPanelLogoutString?: string;
|
|
47
42
|
avatarPanelOnClickSwitchDirection?: any;
|
|
@@ -7,6 +7,7 @@ export interface IApplicationHubProps {
|
|
|
7
7
|
userOrganization?: string;
|
|
8
8
|
hasPromotionalCampaigns?: boolean;
|
|
9
9
|
isAppSwitcher: boolean;
|
|
10
|
+
hubApiUrl: string;
|
|
10
11
|
hubApiKey: string;
|
|
11
12
|
hubToken: string;
|
|
12
13
|
}
|
|
@@ -15,8 +16,15 @@ export interface IApplicationHubRowProps {
|
|
|
15
16
|
title: string;
|
|
16
17
|
type?: any;
|
|
17
18
|
allowEditLinks?: boolean;
|
|
19
|
+
allowTitle?: boolean;
|
|
18
20
|
customName?: string;
|
|
19
21
|
welcomeMessage?: string;
|
|
20
22
|
userName?: string;
|
|
21
23
|
userOrganization?: string;
|
|
24
|
+
hubTrackingProps: {
|
|
25
|
+
hubApiUrl: string;
|
|
26
|
+
apiKey: string;
|
|
27
|
+
token: string;
|
|
28
|
+
isAppSwitcher: boolean;
|
|
29
|
+
};
|
|
22
30
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
applicationId: number;
|
|
1
|
+
interface IChildApplication {
|
|
3
2
|
applicationName: string;
|
|
4
|
-
|
|
5
|
-
internalName: string;
|
|
6
|
-
customName?: string;
|
|
3
|
+
name: string;
|
|
7
4
|
url: string;
|
|
8
|
-
|
|
5
|
+
onClick?: (event: Event) => void;
|
|
9
6
|
}
|
|
10
|
-
|
|
11
|
-
id:
|
|
7
|
+
interface ICustomLinks {
|
|
8
|
+
id: string;
|
|
9
|
+
imageUrl: any;
|
|
10
|
+
name: string;
|
|
11
|
+
sortOrder: number;
|
|
12
|
+
type: string;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
interface IPromotionalCampaigns {
|
|
16
|
+
id: string;
|
|
12
17
|
name: string;
|
|
13
18
|
appSwitcherImageUrl: string;
|
|
14
19
|
hubImageUrl: string;
|
|
@@ -16,3 +21,48 @@ export interface IPromotionalCampaign {
|
|
|
16
21
|
basePromoUrl: string;
|
|
17
22
|
isActive: boolean;
|
|
18
23
|
}
|
|
24
|
+
export interface IApplication {
|
|
25
|
+
applicationId: number;
|
|
26
|
+
applicationName: string;
|
|
27
|
+
url: string;
|
|
28
|
+
shortName?: string;
|
|
29
|
+
internalName?: string;
|
|
30
|
+
customName?: string;
|
|
31
|
+
children?: IChildApplication[];
|
|
32
|
+
subtitle?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IHubDashboard {
|
|
35
|
+
customerAccountName: string;
|
|
36
|
+
applications: IApplication[];
|
|
37
|
+
customLinks: ICustomLinks[];
|
|
38
|
+
otherProducts: IApplication[];
|
|
39
|
+
usefulLinks: ICustomLinks[];
|
|
40
|
+
promotionalCampaigns: IPromotionalCampaigns[];
|
|
41
|
+
userDetails?: {
|
|
42
|
+
customerAccountId?: string;
|
|
43
|
+
userId?: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface IDashboardData {
|
|
47
|
+
items: object[];
|
|
48
|
+
type: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
allowEditLinks?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface IAppSwitcherProps {
|
|
53
|
+
userId?: string;
|
|
54
|
+
layout?: string;
|
|
55
|
+
token?: string;
|
|
56
|
+
apiKey?: string;
|
|
57
|
+
baseUrl?: string;
|
|
58
|
+
localization?: any;
|
|
59
|
+
isAppSwitcherOpen?: boolean;
|
|
60
|
+
isStandalone?: boolean;
|
|
61
|
+
handleToggleAppSwitcher?: any;
|
|
62
|
+
isDrawerOpen?: boolean;
|
|
63
|
+
dataAttributes?: any;
|
|
64
|
+
StreamHomeUrl?: string;
|
|
65
|
+
hideStreamHomeButton?: boolean;
|
|
66
|
+
avatarName?: string;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
package/utils/helpers.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare const useFadeIn: (delayOrder: number, reverse?: boolean) => Objec
|
|
|
35
35
|
*/
|
|
36
36
|
export declare const useFadeAndMoveIn: (delayOrder: number, reverse?: boolean) => Object;
|
|
37
37
|
interface IHubTrackingProps {
|
|
38
|
+
hubApiUrl: string;
|
|
38
39
|
apiKey: string;
|
|
39
40
|
token: string;
|
|
40
41
|
isAppSwitcher: boolean;
|
|
@@ -49,5 +50,5 @@ interface IHubTrackingProps {
|
|
|
49
50
|
* @param {String} param.referenceId - Clicked Id of the object.
|
|
50
51
|
* @param {String} param.url - Url of the object on click.
|
|
51
52
|
*/
|
|
52
|
-
export declare const handleHubTracking: ({ apiKey, token, isAppSwitcher, eventTypeId, referenceId, url }: IHubTrackingProps) => Promise<void>;
|
|
53
|
+
export declare const handleHubTracking: ({ hubApiUrl, apiKey, token, isAppSwitcher, eventTypeId, referenceId, url }: IHubTrackingProps) => Promise<void>;
|
|
53
54
|
export {};
|
package/utils/helpers.js
CHANGED
|
@@ -115,15 +115,21 @@ export const useFadeAndMoveIn = (delayOrder, reverse = false) => {
|
|
|
115
115
|
* @param {String} param.referenceId - Clicked Id of the object.
|
|
116
116
|
* @param {String} param.url - Url of the object on click.
|
|
117
117
|
*/
|
|
118
|
-
export const handleHubTracking = async ({ apiKey, token, isAppSwitcher, eventTypeId, referenceId, url }) => {
|
|
119
|
-
const {
|
|
118
|
+
export const handleHubTracking = async ({ hubApiUrl, apiKey, token, isAppSwitcher, eventTypeId, referenceId, url }) => {
|
|
119
|
+
const { hostname } = window.location;
|
|
120
120
|
if (hostname === 'localhost') {
|
|
121
|
-
console.log('Send tracking to Hub', { isAppSwitcher, eventTypeId, referenceId, url });
|
|
121
|
+
console.log('Send tracking to Hub', { isHub: !isAppSwitcher, eventTypeId, referenceId, url });
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
else if (['home.learningpool.com', 'home-staging.learningpool.com'].includes(hostname)) {
|
|
125
|
+
// Not send tracking to hub
|
|
126
|
+
return;
|
|
122
127
|
}
|
|
123
128
|
if (!eventTypeId || !referenceId) {
|
|
124
129
|
return;
|
|
125
130
|
}
|
|
126
|
-
|
|
131
|
+
const hubAPI = new URL(hubApiUrl);
|
|
132
|
+
fetch(`${hubAPI.toString()}interaction`, {
|
|
127
133
|
method: 'POST',
|
|
128
134
|
headers: new Headers({
|
|
129
135
|
Authorization: `Bearer ${token}`,
|
|
@@ -133,7 +139,7 @@ export const handleHubTracking = async ({ apiKey, token, isAppSwitcher, eventTyp
|
|
|
133
139
|
referenceId,
|
|
134
140
|
eventTypeId,
|
|
135
141
|
url,
|
|
136
|
-
isHub: isAppSwitcher
|
|
142
|
+
isHub: !isAppSwitcher
|
|
137
143
|
})
|
|
138
144
|
});
|
|
139
145
|
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
export declare const LogoVariants: {
|
|
3
|
-
Default: string;
|
|
4
|
-
Solid: string;
|
|
5
|
-
Outlined: string;
|
|
6
|
-
White: string;
|
|
7
|
-
};
|
|
8
|
-
interface IAppSwitcherItemProps {
|
|
9
|
-
internalName: string;
|
|
10
|
-
shortName: string;
|
|
11
|
-
customName?: string;
|
|
12
|
-
handleGoToAppClick: Function;
|
|
13
|
-
applicationId?: number;
|
|
14
|
-
url?: string;
|
|
15
|
-
}
|
|
16
|
-
declare const AppSwitcherItem: (props: IAppSwitcherItemProps) => ReactElement;
|
|
17
|
-
export default AppSwitcherItem;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { Constants } from './constants';
|
|
3
|
-
import { AppLink, AppName, StyledLogoSVG } from './AppSwitcherStyles';
|
|
4
|
-
// Bug in the naming of the icons on the CDN
|
|
5
|
-
export const LogoVariants = {
|
|
6
|
-
Default: 'icon',
|
|
7
|
-
Solid: 'icon-solid',
|
|
8
|
-
Outlined: 'icon-outlined',
|
|
9
|
-
White: 'icon-white'
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Renders an application logo.
|
|
13
|
-
* @param internalName {string | null | undefined } - Internal name of the application.
|
|
14
|
-
* @returns {ReactElement | null } SVG containing the application logo retrieved from the CDN.
|
|
15
|
-
*/
|
|
16
|
-
const renderApplicationLogo = (internalName, logoVariant) => {
|
|
17
|
-
if (!internalName) {
|
|
18
|
-
return _jsx(_Fragment, {});
|
|
19
|
-
}
|
|
20
|
-
const urlToIcon = `${Constants.AssetsUrl}${internalName}/logo/latest/${logoVariant ?? LogoVariants.Default}.svg`;
|
|
21
|
-
return (_jsx(StyledLogoSVG, { children: _jsx("image", { xlinkHref: urlToIcon, width: "60", height: "60" }) }));
|
|
22
|
-
};
|
|
23
|
-
const AppSwitcherItem = (props) => {
|
|
24
|
-
const { applicationId, internalName, shortName, customName, url, handleGoToAppClick } = props;
|
|
25
|
-
const solidLogo = renderApplicationLogo(internalName, LogoVariants.Solid);
|
|
26
|
-
return (_jsxs(AppLink, { href: url ?? '#', target: "_blank", onClick: event => applicationId ? handleGoToAppClick(event, applicationId) : null, children: [applicationId && (
|
|
27
|
-
// Create a stack effect to indicate multiple
|
|
28
|
-
_jsxs(_Fragment, { children: [_jsx("span", { style: {
|
|
29
|
-
position: 'absolute',
|
|
30
|
-
top: '4px',
|
|
31
|
-
transform: 'scale(0.8)',
|
|
32
|
-
zIndex: 0
|
|
33
|
-
}, children: solidLogo }), _jsx("span", { style: {
|
|
34
|
-
position: 'absolute',
|
|
35
|
-
top: '10px',
|
|
36
|
-
transform: 'scale(0.9)',
|
|
37
|
-
zIndex: 0
|
|
38
|
-
}, children: solidLogo })] })), solidLogo, _jsx(AppName, { children: customName ?? shortName })] }));
|
|
39
|
-
};
|
|
40
|
-
export default AppSwitcherItem;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const AppSwitcherPanel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const List: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
3
|
-
export declare const MenuContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export declare const SearchContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export declare const AppListHeader: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
6
|
-
export declare const AppListItem: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
-
export declare const AppLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
8
|
-
export declare const BackButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
9
|
-
export declare const SearchBox: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
10
|
-
export declare const AppName: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
11
|
-
export declare const AppOrganisationCount: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
12
|
-
export declare const SelectedOrganisation: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
-
export declare const StyledSVG: import("styled-components").StyledComponent<"svg", any, {}, never>;
|
|
14
|
-
export declare const StyledLogoSVG: import("styled-components").StyledComponent<"svg", any, {}, never>;
|
|
15
|
-
export declare const OrganisationList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
-
export declare const OrganisationLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
export const AppSwitcherPanel = styled.div `
|
|
3
|
-
background-color: #fff;
|
|
4
|
-
border-radius: 4px;
|
|
5
|
-
box-shadow: rgb(0 0 0 / 20%) 0px 5px 5px -3px, rgb(0 0 0 / 14%) 0px 8px 10px 1px, rgb(0 0 0 / 12%) 0px 3px 14px 2px;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
height: 450px;
|
|
8
|
-
padding: 1rem 1.5rem;
|
|
9
|
-
position: absolute;
|
|
10
|
-
width: 360px;
|
|
11
|
-
`;
|
|
12
|
-
export const List = styled.ul `
|
|
13
|
-
`;
|
|
14
|
-
export const MenuContent = styled.div `
|
|
15
|
-
align-items: flex-start;
|
|
16
|
-
flex-direction: row;
|
|
17
|
-
flex-wrap: wrap;
|
|
18
|
-
justify-content: flex-start;
|
|
19
|
-
margin-top: 1rem;
|
|
20
|
-
`;
|
|
21
|
-
export const SearchContent = styled.div `
|
|
22
|
-
align-items: flex-start;
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
justify-content: flex-start;
|
|
26
|
-
padding: 1rem 1rem 2rem;
|
|
27
|
-
`;
|
|
28
|
-
export const AppListHeader = styled.p `
|
|
29
|
-
align-items: center;
|
|
30
|
-
color: #757575;
|
|
31
|
-
display: flex;
|
|
32
|
-
font-weight: normal;
|
|
33
|
-
justify-content: flex-start;
|
|
34
|
-
padding: 0.5rem 1.25rem 0;
|
|
35
|
-
text-transform: uppercase;
|
|
36
|
-
|
|
37
|
-
& svg {
|
|
38
|
-
height: 24px;
|
|
39
|
-
margin-right: 0.5rem;
|
|
40
|
-
width: 24px;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
export const AppListItem = styled.div `
|
|
44
|
-
align-items: center;
|
|
45
|
-
align-self: stretch;
|
|
46
|
-
box-sizing: border-box;
|
|
47
|
-
flex-direction: column;
|
|
48
|
-
flex: 0 0 ${100 / 3}%;
|
|
49
|
-
overflow: visible;
|
|
50
|
-
padding: 0.25rem;
|
|
51
|
-
position: relative;
|
|
52
|
-
|
|
53
|
-
&:hover {
|
|
54
|
-
background-color: transparent;
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
export const AppLink = styled.a `
|
|
58
|
-
align-items: center;
|
|
59
|
-
border-radius: 4px;
|
|
60
|
-
box-shadow: none;
|
|
61
|
-
box-sizing: border-box;
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
font-size: 0.85rem;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
overflow: hidden;
|
|
67
|
-
padding: 1rem 0 0.5rem;
|
|
68
|
-
position: relative;
|
|
69
|
-
text-align: center;
|
|
70
|
-
text-decoration: none;
|
|
71
|
-
transition: all 200ms ease;
|
|
72
|
-
width: 100%;
|
|
73
|
-
|
|
74
|
-
& .MuiTouchRipple-rippleVisible {
|
|
75
|
-
color: #004071;
|
|
76
|
-
opacity: 0.25;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&:hover,
|
|
80
|
-
&:focus {
|
|
81
|
-
background-color: #ecf4fb;
|
|
82
|
-
text-decoration: none;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&:active {
|
|
86
|
-
background-color: #f1f1f1;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
& svg {
|
|
90
|
-
height: 60px;
|
|
91
|
-
width: 60px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&:hover + span,
|
|
95
|
-
&:focus + span {
|
|
96
|
-
opacity: 1;
|
|
97
|
-
}
|
|
98
|
-
`;
|
|
99
|
-
export const BackButton = styled.button `
|
|
100
|
-
align-items: center;
|
|
101
|
-
background: transparent;
|
|
102
|
-
border: 0;
|
|
103
|
-
color: #aaa;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
display: flex;
|
|
106
|
-
padding: 0.25rem 0;
|
|
107
|
-
text-align: left;
|
|
108
|
-
width: 100%;
|
|
109
|
-
|
|
110
|
-
&:focus,
|
|
111
|
-
&:hover {
|
|
112
|
-
background-color: #eee;
|
|
113
|
-
}
|
|
114
|
-
`;
|
|
115
|
-
export const SearchBox = styled.input `
|
|
116
|
-
background: #f4f4f4;
|
|
117
|
-
border: thin solid #888;
|
|
118
|
-
box-sizing: border-box;
|
|
119
|
-
color: #777;
|
|
120
|
-
padding: 0.5rem;
|
|
121
|
-
width: 100%;
|
|
122
|
-
|
|
123
|
-
&:hover .MuiOutlinedInput-notchedOutline {
|
|
124
|
-
border-color: #888;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
& .MuiOutlinedInput-root {
|
|
128
|
-
border-radius: 0;
|
|
129
|
-
color: #777;
|
|
130
|
-
padding: 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
& .MuiOutlinedInput-input {
|
|
134
|
-
padding: 0.5rem;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
& ::placeholder {
|
|
138
|
-
opacity: 0.75;
|
|
139
|
-
}
|
|
140
|
-
`;
|
|
141
|
-
export const AppName = styled.p `
|
|
142
|
-
color: #00497D;
|
|
143
|
-
font-weight: normal;
|
|
144
|
-
margin: 0.5rem 0 0;
|
|
145
|
-
white-space: nowrap;
|
|
146
|
-
`;
|
|
147
|
-
export const AppOrganisationCount = styled.span `
|
|
148
|
-
background: #00497D;
|
|
149
|
-
border-color: #616161;
|
|
150
|
-
border-radius: 4px;
|
|
151
|
-
border: none;
|
|
152
|
-
color: white;
|
|
153
|
-
font-size: 1rem;
|
|
154
|
-
font-weight: bold;
|
|
155
|
-
height: 50px;
|
|
156
|
-
left: 50%;
|
|
157
|
-
line-height: 50px;
|
|
158
|
-
margin-top: 0;
|
|
159
|
-
opacity: 0;
|
|
160
|
-
pointer-events: none;
|
|
161
|
-
position: absolute;
|
|
162
|
-
top: 43%;
|
|
163
|
-
transform: translate(-50%, -50%);
|
|
164
|
-
width: 50px;
|
|
165
|
-
z-index: 1;
|
|
166
|
-
`;
|
|
167
|
-
export const SelectedOrganisation = styled.div `
|
|
168
|
-
align-items: center;
|
|
169
|
-
color: #757575;
|
|
170
|
-
display: flex;
|
|
171
|
-
flex-direction: row;
|
|
172
|
-
justify-content: flex-start;
|
|
173
|
-
padding: 1.5rem 0;
|
|
174
|
-
text-transform: uppercase;
|
|
175
|
-
width: 100%;
|
|
176
|
-
|
|
177
|
-
& svg,
|
|
178
|
-
& svg image {
|
|
179
|
-
height: 24px;
|
|
180
|
-
width: 24px;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
& h6 {
|
|
184
|
-
font-size: 1.2rem;
|
|
185
|
-
font-weight: 600;
|
|
186
|
-
margin: 0 0 0 1rem;
|
|
187
|
-
}
|
|
188
|
-
`;
|
|
189
|
-
export const StyledSVG = styled.svg `
|
|
190
|
-
box-sizing: content-box;
|
|
191
|
-
display: inline-block;
|
|
192
|
-
fill: currentcolor;
|
|
193
|
-
flex-shrink: 0;
|
|
194
|
-
font-size: 1.5rem;
|
|
195
|
-
height: 1em;
|
|
196
|
-
margin: 4px;
|
|
197
|
-
padding: 0;
|
|
198
|
-
user-select: none;
|
|
199
|
-
width: 1em;
|
|
200
|
-
`;
|
|
201
|
-
export const StyledLogoSVG = styled.svg `
|
|
202
|
-
background-color: #E6EAF0;
|
|
203
|
-
border: thin solid #E6EAF0;
|
|
204
|
-
position: relative;
|
|
205
|
-
z-index: 1;
|
|
206
|
-
`;
|
|
207
|
-
export const OrganisationList = styled.div `
|
|
208
|
-
height: 300px;
|
|
209
|
-
overflow: auto;
|
|
210
|
-
padding-top: 0.5rem;
|
|
211
|
-
width: 100%;
|
|
212
|
-
`;
|
|
213
|
-
export const OrganisationLink = styled.a `
|
|
214
|
-
align-items: center;
|
|
215
|
-
border-radius: 4px;
|
|
216
|
-
box-shadow: none;
|
|
217
|
-
color: #777;
|
|
218
|
-
display: flex;
|
|
219
|
-
font-size: 1rem;
|
|
220
|
-
justify-content: space-between;
|
|
221
|
-
margin: 0 0.125rem;
|
|
222
|
-
padding: 0.5rem;
|
|
223
|
-
text-decoration: none;
|
|
224
|
-
transition: all 200ms ease;
|
|
225
|
-
|
|
226
|
-
& .MuiTouchRipple-rippleVisible {
|
|
227
|
-
color: #004071;
|
|
228
|
-
opacity: 0.25;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
&:focus,
|
|
232
|
-
&:hover {
|
|
233
|
-
background-color: #f5f5f5;
|
|
234
|
-
|
|
235
|
-
& svg {
|
|
236
|
-
visibility: visible;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
&:active {
|
|
241
|
-
background-color: #f1f1f1;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
& .MuiLink-root {
|
|
245
|
-
align-items: center;
|
|
246
|
-
color: #777;
|
|
247
|
-
display: flex;
|
|
248
|
-
justify-content: space-between;
|
|
249
|
-
text-decoration: none;
|
|
250
|
-
width: 100%;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
& svg {
|
|
254
|
-
visibility: hidden;
|
|
255
|
-
}
|
|
256
|
-
`;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
interface IPromotionalCampaignItemProps {
|
|
3
|
-
imageUrl: string;
|
|
4
|
-
altText: string;
|
|
5
|
-
linkUrl: string;
|
|
6
|
-
onImageError?: () => void;
|
|
7
|
-
}
|
|
8
|
-
declare const PromotionalCampaignItem: ({ imageUrl, altText, linkUrl, onImageError }: IPromotionalCampaignItemProps) => ReactElement | null;
|
|
9
|
-
export default PromotionalCampaignItem;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { CardMedia } from '@mui/material';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { PromotionalCampaignCardStyled, PromotionalCampaignCardActionArea } from './AppSwitcherStyles';
|
|
5
|
-
const PromotionalCampaignItem = ({ imageUrl, altText, linkUrl, onImageError }) => {
|
|
6
|
-
const [imageLoaded, setImageLoaded] = useState(true);
|
|
7
|
-
const handleImageError = () => {
|
|
8
|
-
setImageLoaded(false);
|
|
9
|
-
if (onImageError) {
|
|
10
|
-
onImageError();
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
if (!imageLoaded)
|
|
14
|
-
return null;
|
|
15
|
-
return (_jsx(PromotionalCampaignCardStyled, { children: _jsx(PromotionalCampaignCardActionArea, { onClick: () => window.open(linkUrl, '_blank'), children: _jsx(CardMedia, { component: "div", sx: {
|
|
16
|
-
width: '100%',
|
|
17
|
-
height: '100%',
|
|
18
|
-
position: 'relative'
|
|
19
|
-
}, children: _jsx("img", { src: imageUrl, alt: altText, onError: handleImageError, style: {
|
|
20
|
-
width: '100%',
|
|
21
|
-
height: '100%',
|
|
22
|
-
objectFit: 'cover',
|
|
23
|
-
objectPosition: 'center',
|
|
24
|
-
position: 'absolute',
|
|
25
|
-
top: 0,
|
|
26
|
-
left: 0
|
|
27
|
-
} }) }) }) }));
|
|
28
|
-
};
|
|
29
|
-
export default PromotionalCampaignItem;
|