diff --git a/assets/css/sdkCssVars.css b/assets/css/sdkCssVars.css index 778356177..d3d8c1573 100644 --- a/assets/css/sdkCssVars.css +++ b/assets/css/sdkCssVars.css @@ -1,23 +1,6 @@ /* CSS Variables used in SDK components */ :root { - --app-primary-color: #007bff; /* was #673ab7; */ - --app-primary-dark-color: #0048cc; /* was #4527A0; */ - --app-primary-light-color: #33aeff; /* was #B499FC; */ - --app-secondary-color: #FFC400; - --app-neutral-color: grey; - --app-neutral-light-color: lightgrey; - --app-neutral-dark-color: #262626; - --app-error-color: #f44336; - --app-error-light-color: #e57373; - --app-error-dark-color: #d32f2f; - --app-warning-color: #ff9800; - --app-warning-color-light: #ffb74d; - --app-warning-color-dark: #f57c00; - - --app-background-color: whitesmoke; - --app-form-color: white; - /* svg filter colors that match above, go here to generate https://codepen.io/sosuke/pen/Pjoqqp */ /* replaced 3 filters when the primary, primary-dark, and primary-light were updated above --app-primary-color-filter: invert(23%) sepia(23%) saturate(6785%) hue-rotate(250deg) brightness(93%) contrast(88%); @@ -31,11 +14,9 @@ --app-neutral-color-filter: invert(55%) sepia(25%) saturate(0%) hue-rotate(269deg) brightness(87%) contrast(91%); --app-neutral-light-color-filter: invert(69%) sepia(74%) saturate(0%) hue-rotate(205deg) brightness(102%) contrast(103%); --app-white-color-filter: invert(100%) sepia(99%) saturate(0%) hue-rotate(144deg) brightness(109%) contrast(101%); - - + + /* App Navigation */ - --app-nav-bg: #262626; /*!default*/ - --app-nav-color: #d9d9d9; /* invert( var(--app-nav-bg)) !default */ --app-nav-width: 13rem; /*!default*/ /* $app-nav-width: 15.625rem !default; */ --app-nav-width-expanded: 13rem /*!default*/; diff --git a/assets/img/GoldPhone.png b/assets/img/GoldPhone.png new file mode 100644 index 000000000..79d1bc345 Binary files /dev/null and b/assets/img/GoldPhone.png differ diff --git a/assets/img/MediaCoLogo.png b/assets/img/MediaCoLogo.png new file mode 100644 index 000000000..9e12f8dbe Binary files /dev/null and b/assets/img/MediaCoLogo.png differ diff --git a/assets/img/SDKDevicesImage.png b/assets/img/SDKDevicesImage.png new file mode 100644 index 000000000..8dfeddecc Binary files /dev/null and b/assets/img/SDKDevicesImage.png differ diff --git a/assets/img/SilverPhone.png b/assets/img/SilverPhone.png new file mode 100644 index 000000000..566f64726 Binary files /dev/null and b/assets/img/SilverPhone.png differ diff --git a/assets/img/SuccessIcon.png b/assets/img/SuccessIcon.png new file mode 100644 index 000000000..c62417f22 Binary files /dev/null and b/assets/img/SuccessIcon.png differ diff --git a/assets/img/UserProfile.png b/assets/img/UserProfile.png new file mode 100644 index 000000000..fb5023491 Binary files /dev/null and b/assets/img/UserProfile.png differ diff --git a/assets/img/WhitePhone.png b/assets/img/WhitePhone.png new file mode 100644 index 000000000..34a982f8a Binary files /dev/null and b/assets/img/WhitePhone.png differ diff --git a/sdk-config.json b/sdk-config.json index c4026aeb7..d9db986fb 100644 --- a/sdk-config.json +++ b/sdk-config.json @@ -2,7 +2,7 @@ "comment_sdk_config": "This is the configuration file for the React SDK", "sdk_optional_configs_doc_comment": "See the document(link below) for more details on all the available config settings", "sdk_optional_configs_doc": "https://docs.pega.com/bundle/constellation-sdk/page/constellation-sdks/sdks/configuring-sdk-config-json.html", - "theme": "light", + "theme": "dark", "authConfig": { "authService": "pega", @@ -31,7 +31,7 @@ "appPortal": "", "appMashupCaseType_comment": "If specified, uses this case type for mashup. Otherwise, uses the first case type found for the app", - "appMashupCaseType": "", + "appMashupCaseType": "DIXL-MediaCo-Work-PurchasePhone", "excludePortals_comment": "Array of specific portals to avoid attempting to load with SDK", "excludePortals": ["pxExpress", "Developer", "pxPredictionStudio", "pxAdminStudio", "pyCaseWorker", "pyCaseManager7"] diff --git a/src/samples/Embedded/Header/index.tsx b/src/samples/Embedded/Header/index.tsx index 8ae1bda86..e9a388c92 100644 --- a/src/samples/Embedded/Header/index.tsx +++ b/src/samples/Embedded/Header/index.tsx @@ -1,29 +1,173 @@ -import { Typography } from '@mui/material'; +import { useState } from 'react'; import { makeStyles } from '@mui/styles'; const useStyles = makeStyles(theme => ({ - embeddedHeader: { - display: 'flex', - alignItems: 'center', - height: '64px', - padding: '0px 20px', - backgroundColor: theme.palette.primary.main, - color: theme.palette.primary.contrastText + header: { + backgroundColor: theme.headerNav.backgroundColor, + borderBottom: `1px solid ${theme.palette.divider}`, + padding: '1rem 0' }, embedTopIcon: { width: '40px', - filter: 'invert(100%)' + filter: 'var(--svg-color)' + }, + navContainer: { + width: '90%', + maxWidth: '1400px', + margin: '0 auto', + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + gap: '1.5rem' + }, + logo: { + '& img': { + height: '35px', + width: 'auto', + verticalAlign: 'middle' + } + }, + + navMenu: { + flexGrow: 1, + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + + '@media (max-width: 768px)': { + position: 'fixed', + top: 0, + right: '-100%', + width: '80%', + maxWidth: '320px', + height: '100vh', + backgroundColor: 'var(--utility-background-color)', + boxShadow: '-5px 0 15px rgba(0,0,0,0.2)', + flexDirection: 'column', + justifyContent: 'center', + gap: '3rem', + transition: 'right 0.3s ease-in-out', + zIndex: 1000 + } + }, + navMenuActive: { + '@media (max-width: 768px)': { + right: 0 + } + }, + navList: { + display: 'flex', + gap: '1.5rem', + alignItems: 'center', + listStyle: 'none', + padding: 0, + margin: 0, + '& a': { + textDecoration: 'none', + color: theme.headerNav.navLinkColor, + transition: 'color 0.3s ease', + '&:hover': { + color: theme.headerNav.navLinkHoverColor + } + }, + '@media (max-width: 768px)': { + display: 'none' + } + }, + showNavListsOnMobile: { + '$navMenuActive &': { + '@media (max-width: 768px)': { + display: 'flex', + flexDirection: 'column', + gap: '2rem', + width: '100%', + textAlign: 'center', + '& a': { + color: theme.palette.text.primary, + '&:hover': { + color: theme.palette.primary.main + } + } + } + } + }, + profileAvatar: { + height: '32px', + width: '32px', + borderRadius: '50%' + }, + menuToggle: { + display: 'none', + background: 'none', + border: 'none', + cursor: 'pointer', + zIndex: 1001, + padding: 0, + color: theme.headerNav.menuToggleColor, + '@media (max-width: 768px)': { + display: 'block' + } } })); - export default function Header() { const classes = useStyles(); + const [isMenuOpen, setMenuOpen] = useState(false); + + const toggleMenu = () => { + setMenuOpen(!isMenuOpen); + }; + + const navMenuClassName = `${classes.navMenu} ${isMenuOpen ? classes.navMenuActive : ''}`; + const navListClassName = `${classes.navList} ${isMenuOpen ? classes.showNavListsOnMobile : ''}`; return ( -
- {PCore.getEnvironmentInfo().getApplicationLabel()} -      - -
+
+ +
); } diff --git a/src/samples/Embedded/MainScreen/index.tsx b/src/samples/Embedded/MainScreen/index.tsx index a0506586f..150d500ba 100644 --- a/src/samples/Embedded/MainScreen/index.tsx +++ b/src/samples/Embedded/MainScreen/index.tsx @@ -1,7 +1,6 @@ import { useEffect, useMemo, useState } from 'react'; -import { Typography } from '@mui/material'; -import { makeStyles } from '@mui/styles'; import { getSdkConfig } from '@pega/auth/lib/sdk-auth-manager'; +import { makeStyles } from '@mui/styles'; import StoreContext from '@pega/react-sdk-components/lib/bridge/Context/StoreContext'; import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect'; @@ -10,6 +9,102 @@ import ShoppingOptionCard from '../ShoppingOptionCard'; import ResolutionScreen from '../ResolutionScreen'; import { shoppingOptions } from '../utils'; +const useStyles = makeStyles(theme => ({ + appContainer: { + backgroundColor: 'var(--app-background-color)', + fontFamily: "'Poppins', sans-serif", + color: theme.palette.text.primary, + minHeight: 'calc(100vh - 50px)', + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center' + }, + + mainContentArea: { + padding: '4rem 0', + width: '100%' + }, + mainContainer: { + width: '90%', + maxWidth: '1400px', + margin: '0 auto' + }, + hero: { + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + gap: '2rem', + marginBottom: '6rem', + '@media (max-width: 992px)': { + flexDirection: 'column', + textAlign: 'center' + } + }, + heroText: { + flexBasis: '50%', + '& h1': { + fontSize: '3.5rem', + lineHeight: 1.2, + fontWeight: 700, + color: theme.palette.text.primary + } + }, + heroImage: { + flexBasis: '45%', + textAlign: 'right', + '& img': { + maxWidth: '100%', + height: 'auto' + }, + '@media (max-width: 992px)': { + textAlign: 'center' + } + }, + plansSection: { + display: 'flex', + gap: '3rem', + alignItems: 'flex-start', + '@media (max-width: 1200px)': { + flexDirection: 'column', + alignItems: 'center', + textAlign: 'center' + } + }, + plansIntro: { + flexBasis: '25%', + paddingRight: '2rem', + '& h2': { + fontSize: '2.8rem', + lineHeight: 1.3, + fontWeight: 700, + color: theme.palette.text.primary + }, + '@media (max-width: 1200px)': { + paddingRight: 0, + marginBottom: '2rem' + } + }, + highlight: { + color: theme.actionButtons.primary.backgroundColor + }, + plansContainer: { + flexBasis: '75%', + display: 'grid', + gridTemplateColumns: 'repeat(3, 1fr)', + gap: '2rem', + '@media (max-width: 992px)': { + gridTemplateColumns: '1fr', + width: '100%', + maxWidth: '400px' + } + }, + pegaViewContainer: { + width: '100%' + }, + pegaForm: {} +})); + function RootComponent(props) { const PegaConnectObj = createPConnectComponent(); const thePConnObj = ; @@ -28,80 +123,30 @@ function RootComponent(props) { return {thePConnObj}; } -const useStyles = makeStyles(() => ({ - embedMainScreen: { - display: 'flex', - flexDirection: 'column', - width: '100%' - }, - embedBanner: { - textAlign: 'center', - width: '100%', - padding: '20px' - }, - embedShoppingOptions: { - display: 'flex', - justifyContent: 'space-evenly' - }, - pegaPartInfo: { - display: 'flex', - flexDirection: 'row' - }, - pegaPartPega: { - width: '50%', - display: 'flex', - flexDirection: 'column' - }, - pegaPartText: { - paddingLeft: '50px' - }, - pegaPartAccompaniment: { - width: '50%', - display: 'flex', - flexDirection: 'column', - alignItems: 'center' - }, - pegaPartAccompanimentText: { - fontSize: '30px', - lineHeight: '40px', - padding: '20px 20px', - color: 'darkslategray' - }, - pegaPartAccompanimentImage: { - width: '100%', - borderRadius: '10px' - } -})); - -interface MainScreenProps {} - -export default function MainScreen(props: MainScreenProps) { +export default function MainScreen(props) { const classes = useStyles(); - const [showPega, setShowPega] = useState(false); - const [showTriplePlayOptions, setShowTriplePlayOptions] = useState(true); + const [showLandingPage, setShowLandingPage] = useState(true); const [showResolution, setShowResolution] = useState(false); useEffect(() => { // Subscribe to the EVENT_CANCEL event to handle the assignment cancellation PCore.getPubSubUtils().subscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, () => cancelAssignment(), 'cancelAssignment'); - // Subscribe to the END_OF_ASSIGNMENT_PROCESSING event to handle assignment completion PCore.getPubSubUtils().subscribe( PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING, () => assignmentFinished(), 'endOfAssignmentProcessing' ); - return () => { // unsubscribe to the events PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, 'cancelAssignment'); PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING, 'endOfAssignmentProcessing'); }; - }); + }, []); const cancelAssignment = () => { - setShowTriplePlayOptions(true); + setShowLandingPage(true); setShowPega(false); }; @@ -110,37 +155,47 @@ export default function MainScreen(props: MainScreenProps) { setShowPega(false); }; - /** - * Handles the 'Shop Now' event by creating a new case using the mashup API. - * - * @param {Event} event - The event object triggered by the 'Shop Now' action. - */ - const onShopNow = async (optionClicked: string) => { - const sLevel = optionClicked; - - // Update the UI state to show pega container - setShowTriplePlayOptions(false); + const onShopNow = async optionClicked => { + setShowLandingPage(false); setShowPega(true); - - // Get the SDK configuration const sdkConfig = await getSdkConfig(); let mashupCaseType = sdkConfig.serverConfig.appMashupCaseType; - // If mashupCaseType is null or undefined, get the first case type from the environment info if (!mashupCaseType) { - const caseTypes = PCore?.getEnvironmentInfo()?.environmentInfoObject?.pyCaseTypeList; - mashupCaseType = (caseTypes?.[0] as any).pyWorkTypeImplementationClassName; + const caseTypes = PCore.getEnvironmentInfo()?.environmentInfoObject?.pyCaseTypeList; + if (caseTypes && caseTypes.length > 0) { + mashupCaseType = caseTypes[0].pyWorkTypeImplementationClassName; + } + } + let selectedPhoneGUID = ''; + const phoneName = optionClicked ? optionClicked.trim() : ''; + switch (phoneName) { + case 'Oceonix 25 Max': + selectedPhoneGUID = '2455b75e-3381-4a34-b7db-700dba34a670'; + break; + case 'Oceonix 25 Ultra': + selectedPhoneGUID = '535f01f3-a702-4655-bcd0-f1d9c1599a9c'; + break; + case 'Oceonix 25': + default: + // Set 'Oceonix 25' as the default/fallback + selectedPhoneGUID = '0f670ae2-3e61-47d4-b426-edd62558cfb8'; + break; } - // Create options object with default values - const options: any = { + const options: { + pageName: string; + startingFields: { [key: string]: any }; + } = { pageName: 'pyEmbedAssignment', startingFields: {} }; - - // If mashupCaseType is 'DIXL-MediaCo-Work-NewService', add Package field to startingFields - if (mashupCaseType === 'DIXL-MediaCo-Work-NewService') { - options.startingFields.Package = sLevel; + if (mashupCaseType === 'DIXL-MediaCo-Work-PurchasePhone') { + options.startingFields['PhoneModelss'] = { + pyGUID: selectedPhoneGUID + }; + } else { + console.warn(`Unexpected case type: ${mashupCaseType}. PhoneModelss field not set.`); } // Create a new case using the mashup API @@ -151,46 +206,56 @@ export default function MainScreen(props: MainScreenProps) { }); }; - function getShowTriplePlayOptionsMarkup() { - const theBanner = ( -
-
- Combine TV, Internet, and Voice for the best deal -
+ function renderLandingPage() { + return ( +
+
+
+
+

+ Keeping you connected +
+ to what matters. +

+
+
+ Smartphone, Tablet, and Laptop +
+
+
+
+

+ {} + The phones you want at prices you'll love. +

+
+
+ {shoppingOptions.map(option => ( + onShopNow(option.name)} /> + ))} +
+
+
); + } - const theOptions = shoppingOptions.map((option, index) => { - return ; - }); - + function renderPegaView() { return ( - <> - {theBanner} -
{theOptions}
- +
+
+ +
+
+
); } return ( - <> - {showTriplePlayOptions ? getShowTriplePlayOptionsMarkup() : null} - {showResolution ? : null} - {showPega ? ( -
-
- -
-
* - required fields
-
-
-
We need to gather a little information about you.
-
- -
-
-
- ) : null} - +
+ {showLandingPage && renderLandingPage()} + {showResolution && } + {showPega && renderPegaView()} +
); } diff --git a/src/samples/Embedded/ResolutionScreen/index.tsx b/src/samples/Embedded/ResolutionScreen/index.tsx index c3517fa0b..48b7fd51d 100644 --- a/src/samples/Embedded/ResolutionScreen/index.tsx +++ b/src/samples/Embedded/ResolutionScreen/index.tsx @@ -1,68 +1,107 @@ -import makeStyles from '@mui/styles/makeStyles'; +import { makeStyles } from '@mui/styles'; const useStyles = makeStyles(theme => ({ - resolutionPart: { + resolutionPage: { display: 'flex', - flexDirection: 'row' + justifyContent: 'center', + alignItems: 'center', + minHeight: 'calc(100vh - 81px)', + padding: '2rem' }, - resolutionPartAccompanimentLeft: { - width: '50%', - alignItems: 'center' + resolutionCard: { + backgroundColor: 'var(--utility-background-color)', + borderRadius: '16px', + padding: '3rem', + maxWidth: '600px', + textAlign: 'center', + boxShadow: '0 10px 30px rgba(0, 0, 0, 0.3)', + color: theme.palette.text.primary, + position: 'relative', + border: '2px solid transparent', + backgroundClip: 'padding-box', + '&::before': { + content: '""', + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + borderRadius: '16px', + border: '2px solid transparent', + background: `linear-gradient(to bottom, ${theme.actionButtons.secondary.backgroundColor}, ${theme.actionButtons.primary.backgroundColor}) border-box`, + '-webkit-mask': 'linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0)', + '-webkit-mask-composite': 'destination-out', + maskComposite: 'exclude', + pointerEvents: 'none' + } }, - resolutionPartAccompanimentRight: { - width: '50%', - alignItems: 'center', - textAlign: 'center' + successImage: { + height: '4rem', + width: 'auto', + marginBottom: '1.5rem' }, - resolutionPartAccompanimentText: { - fontSize: '28px', - lineHeight: '40px', - padding: '20px 20px', - color: 'darkslategray' + title: { + fontSize: '2rem', + color: theme.palette.text.primary, + marginBottom: '1rem', + fontWeight: 700, + margin: 0 }, - pegaPartAccompanimentImage: { - width: '700px', - margin: '20px', - borderRadius: '10px' + message: { + fontSize: '1rem', + lineHeight: 1.6, + marginBottom: '2rem', + color: theme.palette.text.secondary, + margin: 0 }, - resolutionButton: { - color: 'white', - backgroundColor: theme.palette.warning.main, - fontSize: '25px', - fontWeight: 'bold', - borderRadius: '25px', - border: '0px', - margin: '20px', - padding: '10px 30px' + doneButton: { + display: 'inline-block', + background: `linear-gradient(90deg, ${theme.actionButtons.primary.backgroundColor}, ${theme.palette.primary.dark}, ${theme.actionButtons.primary.backgroundColor})`, + backgroundSize: '200% auto', + color: `${theme.actionButtons.primary.color} !important`, + padding: '0.75rem 1.5rem', + borderRadius: '50px', + textAlign: 'center', + fontWeight: 600, + border: 'none', + cursor: 'pointer', + textDecoration: 'none', + transition: 'background-position 0.4s ease-in-out, transform 0.3s ease', + '&:hover': { + backgroundPosition: 'right center', + transform: 'scale(1.05)', + color: theme.actionButtons.primary.color + } } })); export default function ResolutionScreen() { const classes = useStyles(); + const primaryContainer = PCore.getContainerUtils().getActiveContainerItemName('app/primary') || 'app/primary_1'; + const workareaContainer = PCore.getContainerUtils().getActiveContainerItemName(primaryContainer + '/workarea') || 'app/primary_1/workarea_1'; + + const ModelName = PCore.getStoreValue('.PhoneModelss.ModelName', 'caseInfo.content', workareaContainer); + const Address = PCore.getStoreValue('.BillingAddress.Apartment', 'caseInfo.content', workareaContainer); + const Email = PCore.getStoreValue('.CustomerProfile.EmailAddress', 'caseInfo.content', workareaContainer); + return ( -
-
-
-
- Welcome! -
-
- Thanks for selecting a package with us.
-
- A technician will contact you with in the next couple of days to schedule an installation. -
-
- If you have any questions, you can contact us directly at 1-800-555-1234 or you can chat with us. -
-
-
- +
+
+ Success Checkmark + +

Get excited for your new phone!

+

+ We have received your order of a {ModelName}. It will ship out within 1 business day to {Address}. Your tracking information will be sent to{' '} + {Email}. +

- -

+ Thank you for your business! +

+ + + Done +
); diff --git a/src/samples/Embedded/ShoppingOptionCard/index.tsx b/src/samples/Embedded/ShoppingOptionCard/index.tsx index e0e9c6057..1facbc57b 100644 --- a/src/samples/Embedded/ShoppingOptionCard/index.tsx +++ b/src/samples/Embedded/ShoppingOptionCard/index.tsx @@ -1,161 +1,118 @@ -import makeStyles from '@mui/styles/makeStyles'; +import { makeStyles } from '@mui/styles'; const useStyles = makeStyles(theme => ({ - swatchHeader: { - display: 'flex', - flexDirection: 'row', - backgroundColor: '#333000' - }, - swatchPackage: { + planCard: { + backgroundColor: 'var(--utility-background-color)', + padding: '2rem', + borderRadius: '16px', + textAlign: 'center', + position: 'relative', + overflow: 'hidden', display: 'flex', flexDirection: 'column', - justifyContent: 'space-around', - width: '260px', - height: '70px', - backgroundColor: '#333000', - padding: '5px' - }, - swatchPlay: { - letterSpacing: 'normal', - color: 'white', - fontSize: '25px' - }, - swatchLevel: { - letterSpacing: 'normal', - color: 'white', - fontSize: '28px', - fontWeight: 'bold' - }, - swatchChannels: { + transition: 'transform 0.3s ease, box-shadow 0.3s ease', + '&:hover': { + transform: 'translateY(-10px)', + boxShadow: '0 10px 20px rgba(0, 0, 0, 0.2)' + }, + '&::before': { + content: '""', + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + borderRadius: '16px', + border: '2px solid transparent', + background: `linear-gradient(to bottom, ${theme.actionButtons.secondary.backgroundColor}, ${theme.actionButtons.primary.backgroundColor}) border-box`, + '-webkit-mask': 'linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0)', + '-webkit-mask-composite': 'destination-out', + pointerEvents: 'none' + } + }, + phoneImage: { + marginBottom: '1.5rem', + height: '150px', display: 'flex', - flexDirection: 'column', - justifyContent: 'space-evenly', - letterSpacing: 'normal', alignItems: 'center', - backgroundColor: theme.palette.primary.main, - width: '100px' - }, - swatchCount: { - letterSpacing: 'normal', - color: 'white', - fontSize: '40px', - fontWeight: 'bold' - }, - swatchLabel: { - letterSpacing: 'normal', - color: 'white', - fontSize: '17px' - }, - swatchBody: { - letterSpacing: 'normal', - border: '1px solid lightgray', - backgroundColor: '#fafafa', - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - paddingBottom: '20px' - }, - swatchBanner: { - letterSpacing: 'normal', - fontWeight: 'bold', - fontSize: '15px', - padding: '5px' - }, - swatchPrice: { - display: 'flex', - flexDirection: 'row', - alignItems: 'center' - }, - swatchFromGroup: { - height: '90px' - }, - swatchFrom: { - color: theme.palette.primary.main, - textAlign: 'right' - }, - swatchCurrency: { - letterSpacing: 'normal', - color: theme.palette.primary.main, - fontSize: '30px', - fontWeight: 'bold', - fontFamily: 'Tahoma' - }, - swatchDollars: { - letterSpacing: 'normal', - color: theme.palette.primary.main, - fontSize: '90px', - fontWeight: 'bold', - fontFamily: 'Tahoma' - }, - swatchCents: { - letterSpacing: 'normal', - color: theme.palette.primary.main, - fontSize: '20px', - fontWeight: 'bold', - fontFamily: 'Tahoma' - }, - swatchMonthly: { - display: 'flex', - flexDirection: 'column' - }, - swatchShopButton: { - color: 'white', - backgroundColor: theme.palette.warning.main, - fontSize: '25px', - fontWeight: 'bold', - borderRadius: '25px', - border: '0px', - margin: '20px', - padding: '10px 30px' + justifyContent: 'center', + '& img': { + maxHeight: '100%', + width: 'auto' + } + }, + planName: { + fontSize: '1.5rem', + fontWeight: 600, + marginBottom: '0.5rem', + color: theme.palette.text.primary, + margin: 0 + }, + saveAmount: { + color: '#34d399', + fontWeight: 600, + marginBottom: '1rem', + margin: 0 + }, + monthlyPrice: { + fontSize: '1rem', + color: theme.palette.text.primary, + margin: 0 + }, + tenure: { + fontSize: '0.8rem', + color: theme.palette.text.secondary, + marginBottom: '1rem', + margin: 0 + }, + retailPrice: { + fontSize: '0.8rem', + color: theme.palette.text.secondary, + marginBottom: '1.5rem', + flexGrow: 1, + margin: 0 + }, + buyButton: { + display: 'inline-block', + background: `linear-gradient(90deg, ${theme.actionButtons.primary.backgroundColor}, ${theme.palette.primary.dark}, ${theme.actionButtons.primary.backgroundColor})`, + backgroundSize: '200% auto', + color: `${theme.actionButtons.primary.color} !important`, + padding: '0.75rem 1.5rem', + borderRadius: '50px', + textAlign: 'center', + fontWeight: 600, + border: 'none', + cursor: 'pointer', + textDecoration: 'none', + transition: 'background-position 0.4s ease-in-out, transform 0.3s ease', + '&:hover': { + backgroundPosition: 'right center', + transform: 'scale(1.05)', + color: theme.actionButtons.primary.color + } } })); export default function ShoppingOptionCard(props) { const classes = useStyles(); - - const { play, level, channels, channels_full: channelsFull, banner, price, internetSpeed, calling } = props; + const { name, imageSrc, saveAmount, monthlyPrice, tenure, retailPrice, level, onClick } = props; return ( -
-
-
-
{play}
-
{level}
-
-
-
{channels}
-
Channels
-
+
+
+ {name}
-
-
{banner}
-
    -
  • {channelsFull} channels plus FREE HD
  • -
  • Thousands of On Demand choices
  • -
  • Watch on the {PCore.getEnvironmentInfo().getApplicationLabel()} App
  • -
  • Up to {internetSpeed} Internet Speeds
  • -
  • Unlimited nationwide calling {calling}
  • -
-
-
-
From
-
$
-
+

{name}

-
{price.substring(0, price.indexOf('.'))}
-
-
{price.substring(price.indexOf('.') + 1)}
-
for 12 months
-
when bundled
-
-
-
- -
-
+

{saveAmount}

+

{monthlyPrice}

+

{tenure}

+

{retailPrice}

+ +
); } diff --git a/src/samples/Embedded/index.tsx b/src/samples/Embedded/index.tsx index a73f8eebc..bae2218e1 100644 --- a/src/samples/Embedded/index.tsx +++ b/src/samples/Embedded/index.tsx @@ -10,6 +10,7 @@ import MainScreen from './MainScreen'; import localSdkComponentMap from '../../../sdk-local-component-map'; import { initializeAuthentication } from './utils'; import { theme } from '../../theme'; +import './styles.css'; declare const myLoadMashup: any; diff --git a/src/samples/Embedded/styles.css b/src/samples/Embedded/styles.css new file mode 100755 index 000000000..030d563d6 --- /dev/null +++ b/src/samples/Embedded/styles.css @@ -0,0 +1,26 @@ +/* global styles*/ +#pega-part-of-page .psdk-flow-container-top { + max-width: 1400px; + width: 50%; + margin-left: auto; + margin-right: auto; + margin-bottom: 5%; + padding: 16px; +} + +#pega-part-of-page .psdk-horizontal-stepper-header-container { + display: none; + margin-bottom: 2rem; +} + +#pega-part-of-page .MuiCard-root { + padding: 16px; +} + +#pega-part-of-page .MuiCardContent-root:first-child { + padding-top: 0px !important; +} + +#pega-part-of-page .MuiCardContent-root:last-child { + padding-bottom: 0px !important; +} diff --git a/src/samples/Embedded/utils.ts b/src/samples/Embedded/utils.ts index 89181c7fb..0a7bb0c7b 100644 --- a/src/samples/Embedded/utils.ts +++ b/src/samples/Embedded/utils.ts @@ -2,34 +2,31 @@ import { sdkSetAuthHeader, sdkSetCustomTokenParamsCB } from '@pega/auth/lib/sdk- export const shoppingOptions = [ { - play: 'Triple Play', - level: 'Basic', - channels: '100+', - channels_full: '100+ (Basic +)', - banner: 'Value package', - price: '99.00', - internetSpeed: '100 Mbps', - calling: '' + name: 'Oceonix 25', + imageSrc: './assets/img/WhitePhone.png', + saveAmount: 'Save $150', + monthlyPrice: 'Starting at $18.05/mo', + tenure: 'for 36 months', + retailPrice: 'Retail price: $800.00', + level: 'Basic' }, { - play: 'Triple Play', - level: 'Silver', - channels: '125+', - channels_full: '125+ (Deluxe)', - banner: 'Most popular', - price: '120.00', - internetSpeed: '300 Mbps', - calling: '' + name: 'Oceonix 25 Max', + imageSrc: './assets/img/SilverPhone.png', + saveAmount: 'Save $200', + monthlyPrice: 'Starting at $22.22/mo', + tenure: 'for 36 months', + retailPrice: 'Retail price: $1,000.00', + level: 'Silver' }, { - play: 'Triple Play', - level: 'Gold', - channels: '175+', - channels_full: '175+ (Premium)', - banner: 'All the channels you want', - price: '150.00', - internetSpeed: '1 Gbps', - calling: ' & International' + name: 'Oceonix 25 Ultra', + imageSrc: './assets/img/GoldPhone.png', + saveAmount: 'Save $250', + monthlyPrice: 'Starting at $26.38/mo', + tenure: 'for 36 months', + retailPrice: 'Retail price: $1,200.00', + level: 'Gold' } ];