diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 36205ce1ff45d..12c2900a8634f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2872,6 +2872,9 @@ importers: '@wordpress/i18n': specifier: 4.54.0 version: 4.54.0 + classnames: + specifier: 2.3.2 + version: 2.3.2 react: specifier: 18.2.0 version: 18.2.0 diff --git a/projects/plugins/automattic-for-agencies-client/changelog/add-share-details-info-to-connection-card b/projects/plugins/automattic-for-agencies-client/changelog/add-share-details-info-to-connection-card new file mode 100644 index 0000000000000..cec884a5968b5 --- /dev/null +++ b/projects/plugins/automattic-for-agencies-client/changelog/add-share-details-info-to-connection-card @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +Added details about sharing information with Automattic to the connection card. diff --git a/projects/plugins/automattic-for-agencies-client/package.json b/projects/plugins/automattic-for-agencies-client/package.json index 870f87525fd8b..8426d2dbf9de8 100644 --- a/projects/plugins/automattic-for-agencies-client/package.json +++ b/projects/plugins/automattic-for-agencies-client/package.json @@ -33,6 +33,7 @@ "@wordpress/date": "4.54.0", "@wordpress/element": "5.31.0", "@wordpress/i18n": "4.54.0", + "classnames": "2.3.2", "react": "18.2.0", "react-dom": "18.2.0" }, diff --git a/projects/plugins/automattic-for-agencies-client/src/js/components/branded-card/styles.module.scss b/projects/plugins/automattic-for-agencies-client/src/js/components/branded-card/styles.module.scss index 0b27c9bc170cb..db3d429b2a5a5 100644 --- a/projects/plugins/automattic-for-agencies-client/src/js/components/branded-card/styles.module.scss +++ b/projects/plugins/automattic-for-agencies-client/src/js/components/branded-card/styles.module.scss @@ -3,10 +3,10 @@ border-radius: 14px; display: flex; padding: 8px; - - @media (max-width: 959px) { - flex-direction: column; - } + + @media ( max-width: 959px ) { + flex-direction: column; + } } .card__column { @@ -19,42 +19,44 @@ justify-content: space-between; padding: 48px 56px; - @media (max-width: 959px) { - flex-direction: row; - justify-content: flex-start; - padding: 48px; - gap: 16px; - } + @media ( max-width: 959px ) { + flex-direction: row; + justify-content: flex-start; + padding: 48px; + gap: 16px; + } - @media (max-width: 659px) { - padding: 24px; - } + @media ( max-width: 659px ) { + padding: 24px; + } } .card__column--brand svg { - @media (max-width: 959px) { - height: 48px; - width: auto; - } - - @media (max-width: 659px) { - height: 32px; - width: auto; - } + @media ( max-width: 959px ) { + height: 48px; + width: auto; + } + + @media ( max-width: 659px ) { + height: 32px; + width: auto; + } } .card__column--content { - background-color: #FFFFFF; + background-color: #ffffff; border-radius: 8px; - padding: 80px 48px; - display: flex; flex-basis: 562px; - - @media (max-width: 959px) { - padding: 48px; - } - - @media (max-width: 659px) { - padding: 24px; - } + height: 612px; + overflow: auto; + + @media ( max-width: 959px ) { + padding: 48px; + height: auto; + overflow: unset; + } + + @media ( max-width: 659px ) { + padding: 24px; + } } diff --git a/projects/plugins/automattic-for-agencies-client/src/js/components/close-icon/index.jsx b/projects/plugins/automattic-for-agencies-client/src/js/components/close-icon/index.jsx new file mode 100644 index 0000000000000..72b3b2b7b1897 --- /dev/null +++ b/projects/plugins/automattic-for-agencies-client/src/js/components/close-icon/index.jsx @@ -0,0 +1,30 @@ +import { Path, SVG } from '@wordpress/components'; +import React from 'react'; + +/** + * Close icon component + * + * @param {object} props - Component props + * @param {string} props.color - Color code for the icon + * @returns {React.ReactElement} Component template + */ +export default function CloseIcon( { color = '#D63638' } ) { + return ( + + + + ); +} diff --git a/projects/plugins/automattic-for-agencies-client/src/js/components/connection-card/index.jsx b/projects/plugins/automattic-for-agencies-client/src/js/components/connection-card/index.jsx index 04eac45f593f9..2e3a0bc590ba5 100644 --- a/projects/plugins/automattic-for-agencies-client/src/js/components/connection-card/index.jsx +++ b/projects/plugins/automattic-for-agencies-client/src/js/components/connection-card/index.jsx @@ -1,61 +1,335 @@ +import { getRedirectUrl } from '@automattic/jetpack-components'; +import { ConnectButton } from '@automattic/jetpack-connection'; +import { createInterpolateElement } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; -import React from 'react'; +import classNames from 'classnames'; +import React, { useCallback, useState } from 'react'; import BrandedCard from '../branded-card'; import CheckIcon from '../check-icon'; -import ConnectionButton from '../connection-button'; +import CloseIcon from '../close-icon'; +import LeftArrow from '../left-arrow'; import styles from './styles.module.scss'; /** - * Connection Card component. + * Site Connection Content + * The main copy for the connection card. * - * @returns {React.Component} The `ConnectionCard` component. + * @param {object} props - Component props + * @param {Function} props.onShowSharingDetailsClick - Callback to show the sharing details. + * + * @returns {React.Component} The `ConnectionContent` component. */ -export default function ConnectionCard() { +function ConnectionContent( { onShowSharingDetailsClick } ) { const { apiNonce, apiRoot, registrationNonce } = window.automatticForAgenciesClientInitialState; return ( - -
-

+ <> +

+ { __( + 'Add this site to Automattic for Agencies by connecting now', + 'automattic-for-agencies-client' + ) } +

+