diff --git a/special-pages/pages/new-tab/app/components/Icons.js b/special-pages/pages/new-tab/app/components/Icons.js index dd0198ecd9..65e46bcf00 100644 --- a/special-pages/pages/new-tab/app/components/Icons.js +++ b/special-pages/pages/new-tab/app/components/Icons.js @@ -82,3 +82,23 @@ export function Cross() { ); } + +export function CheckColor() { + return ( + + + + + + ); +} diff --git a/special-pages/pages/new-tab/app/next-steps/components/NextSteps.module.css b/special-pages/pages/new-tab/app/next-steps/components/NextSteps.module.css index 21ca36c218..e6052d2d85 100644 --- a/special-pages/pages/new-tab/app/next-steps/components/NextSteps.module.css +++ b/special-pages/pages/new-tab/app/next-steps/components/NextSteps.module.css @@ -89,6 +89,23 @@ } } +.confirmation { + display: flex; + align-items: center; + transition: all .2s; + padding-bottom: var(--sp-1); + svg { + height: 1rem; + width: 1rem; + margin-right: var(--sp-2); + } + + p { + font-weight: 700; + font-size: calc(11 * var(--px-in-rem)); + } +} + .dismissBtn { position: absolute; top: 0.5rem; diff --git a/special-pages/pages/new-tab/app/next-steps/components/NextStepsCard.js b/special-pages/pages/new-tab/app/next-steps/components/NextStepsCard.js index 9e8103e48d..c9a748e7cd 100644 --- a/special-pages/pages/new-tab/app/next-steps/components/NextStepsCard.js +++ b/special-pages/pages/new-tab/app/next-steps/components/NextStepsCard.js @@ -3,6 +3,8 @@ import styles from './NextSteps.module.css'; import { DismissButton } from '../../components/DismissButton'; import { variants } from '../nextsteps.data'; import { useTypedTranslationWith } from '../../types'; +import { CheckColor } from '../../components/Icons'; +import { useState } from 'preact/hooks'; /** * @param {object} props @@ -14,14 +16,30 @@ import { useTypedTranslationWith } from '../../types'; export function NextStepsCard({ type, dismiss, action }) { const { t } = useTypedTranslationWith(/** @type {import("../strings.json")} */ ({})); const message = variants[type]?.(t); + const [showMacConfirmation, setShowMacConfirmation] = useState(false); + + const handleClick = () => { + if (message.id !== 'addAppToDockMac') { + return action(message.id); + } + action(message.id); + setShowMacConfirmation(true); + }; return (

{message.title}

{message.summary}

- + {message.id === 'addAppToDockMac' && !!showMacConfirmation ? ( +
+ +

Added to Dock!

+
+ ) : ( + + )} dismiss(message.id)} />