|
| 1 | +import React, { useState, useEffect } from 'react'; |
| 2 | +import List from '../../components/List/List'; |
| 3 | +import ContentArea from '../../components/TourComponents/ContentArea/ContentArea'; |
| 4 | +import ContentHeader from '../../components/TourComponents/ContentHeader/ContentHeader'; |
| 5 | +import ConfirmationPopup from '../../components/TourComponents/ConfirmationPopup/ConfirmationPopup'; |
| 6 | +import Button from '../../components/Button/Button'; |
| 7 | +import './ProductTourStyles.css'; |
| 8 | +import TourDescriptionText from '../../components/TourComponents/TourDescriptionText/TourDescriptionText'; |
| 9 | +import InfoTooltip from '../../components/TourComponents/InfoTooltip/InfoTooltip'; |
| 10 | + |
| 11 | +const TourPage = ({ items }) => { |
| 12 | + const [selectedItem, setSelectedItem] = useState(null); |
| 13 | + const [isPopupOpen, setPopupOpen] = useState(false); |
| 14 | + const [showDemoItems, setShowDemoItems] = useState(false); |
| 15 | + |
| 16 | + useEffect(() => { |
| 17 | + setShowDemoItems(items.length === 0); |
| 18 | + }, [items]); |
| 19 | + |
| 20 | + const handleSelect = (idItem) => { |
| 21 | + setSelectedItem(idItem); |
| 22 | + }; |
| 23 | + |
| 24 | + const handleDelete = () => { |
| 25 | + setPopupOpen(false); |
| 26 | + }; |
| 27 | + |
| 28 | + const handleOpenPopup = () => { |
| 29 | + setPopupOpen(true); |
| 30 | + }; |
| 31 | + |
| 32 | + const handleClosePopup = () => { |
| 33 | + setPopupOpen(false); |
| 34 | + }; |
| 35 | + |
| 36 | + const handleCreateItem = () => { |
| 37 | + }; |
| 38 | + |
| 39 | + const demoItems = [ |
| 40 | + { |
| 41 | + title: 'Main dashboard - first login tour', |
| 42 | + timestamp: '10:00 AM', |
| 43 | + idItem: '12548', |
| 44 | + text: 'This pops up the first time the user logins to the dashboard.', |
| 45 | + onDelete: () => { }, |
| 46 | + onEdit: () => { } |
| 47 | + }, |
| 48 | + ]; |
| 49 | + |
| 50 | + return ( |
| 51 | + <div className="product-page-container"> |
| 52 | + <div className="product-page-header"> |
| 53 | + <ContentHeader title={showDemoItems ? "Demo Tours" : "All Tours"} /> |
| 54 | + <Button text="Create a new tour" variant="contained" className="button-primary create-tour-button" /> |
| 55 | + </div> |
| 56 | + <div className="product-page"> |
| 57 | + <ContentArea className="content-area"> |
| 58 | + <List items={showDemoItems ? demoItems : items} onSelectItem={handleSelect} /> |
| 59 | + <List items={showDemoItems ? demoItems : items} onSelectItem={handleSelect} /> |
| 60 | + <List items={showDemoItems ? demoItems : items} onSelectItem={handleSelect} /> |
| 61 | + </ContentArea> |
| 62 | + <div className="tour-info-container"> |
| 63 | + <div className="tour-info-box"> |
| 64 | + <h4>What is a product tour?</h4> |
| 65 | + <p> |
| 66 | + A product onboarding tour is a guided walkthrough or tutorial that introduces users to a new product or service. |
| 67 | + It typically occurs when a user first signs up or logs into the product. |
| 68 | + The purpose of the onboarding tour is to familiarize users with the key features, functionalities, and benefits of the product in order to enhance their understanding. |
| 69 | + During the onboarding tour, users are typically shown around the interface, given demonstrations of how to perform key tasks, and provided with explanations of important features. |
| 70 | + </p> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + {/* <TourDescriptionText description="A product onboarding tour is a guided walkthrough or tutorial..." /> |
| 75 | + <InfoTooltip text="More info here" title="What is a product tour?" /> */} |
| 76 | + <ConfirmationPopup open={isPopupOpen} onConfirm={handleDelete} onCancel={handleClosePopup} /> |
| 77 | + </div> |
| 78 | + ); |
| 79 | +}; |
| 80 | + |
| 81 | +export default TourPage; |
0 commit comments