diff --git a/example/nextjs/pages/index.tsx b/example/nextjs/pages/index.tsx index 2a1a51a..ece9d8d 100644 --- a/example/nextjs/pages/index.tsx +++ b/example/nextjs/pages/index.tsx @@ -1,8 +1,8 @@ import { useState, useEffect, MouseEvent } from 'react'; import type { NextPage } from 'next'; import Head from 'next/head'; -import { PromoDashboard } from '@tincre/promo-dashboard'; -//import { PromoDashboard } from '../../../dist'; +//import { PromoDashboard } from '@tincre/promo-dashboard'; +import { PromoDashboard } from '../../../dist'; import { PromoChat } from '@tincre/promo-chat'; //import { campaignStubData } from '../cms.data'; import { campaignStubData } from '../test.data'; @@ -10,8 +10,11 @@ import { useTour } from '@reactour/tour'; const Home: NextPage = () => { const [isRepeatButtonClicked, setIsRepeatButtonClicked] = useState(false); - const [promoData, setPromoData] = useState({}); + const [promoData, setPromoData] = useState< + undefined | typeof campaignStubData + >(undefined); const [isLoading, setIsLoading] = useState(true); + const { setIsOpen } = useTour(); const handleRepeatButtonClick = ( event: MouseEvent, @@ -24,9 +27,6 @@ const Home: NextPage = () => { setPromoData({ ...data }); console.debug(`handleRepeatButtonClick::data ${JSON.stringify(data)}`); }; - useEffect(() => { - console.debug(`useEffect::promoData::${JSON.stringify(promoData)}`); - }, [promoData]); useEffect(() => { console.debug(`useEffect::isRepeatButtonClicked::${isRepeatButtonClicked}`); @@ -91,11 +91,27 @@ const Home: NextPage = () => { isLoading

+

+ +

{ + event.preventDefault(); + alert(`${campaignType} clicked!`); + }} + isLoading={false} PromoChat={PromoChat} />