MCPcopy Create free account
hub / github.com/dailydotdev/apps / SquadTour

Function SquadTour

packages/shared/src/components/squads/SquadTour.tsx:25–130  ·  view source on GitHub ↗
({ onClose }: SquadTourProps)

Source from the content-addressed store, hash-verified

23const FooterButton = classed(Button, 'w-22');
24
25function SquadTour({ onClose }: SquadTourProps): ReactElement {
26 const [shouldShowCarousel, setShouldShowCarousel] = useState(false);
27 const { onTourIndexChange } = useSquadTour();
28
29 if (!shouldShowCarousel) {
30 const start = (
31 <FooterButton
32 className="w-full tablet:ml-auto tablet:w-auto"
33 variant={ButtonVariant.Primary}
34 onClick={(e: React.MouseEvent) => {
35 e.stopPropagation();
36 onTourIndexChange(0);
37 setShouldShowCarousel(true);
38 }}
39 >
40 Start
41 </FooterButton>
42 );
43
44 return (
45 <>
46 <SquadTourCard
47 key="intro"
48 banner={cloudinarySquadsTourBanner0}
49 title="Let's see what you can do with Squads!"
50 className={{ container: 'h-[29.25rem]', banner: '!pt-0' }}
51 />
52 <span className="flex px-4 tablet:hidden">{start}</span>
53 <ModalFooter>
54 <FooterButton
55 variant={ButtonVariant.Tertiary}
56 onClick={(e: React.MouseEvent) => onClose(e.nativeEvent)}
57 >
58 Close
59 </FooterButton>
60 {start}
61 </ModalFooter>
62 </>
63 );
64 }
65
66 const items = [
67 <SquadTourCard
68 key="step1"
69 banner={cloudinarySquadsTourBanner1V2}
70 title="Share articles"
71 description="Share articles, receive and give feedback!"
72 badge="NEW"
73 />,
74 <SquadTourCard
75 key="step2"
76 banner={cloudinarySquadsTourBanner2}
77 title="Share from main feed"
78 description="Share articles using the share button!"
79 badge="NEW"
80 />,
81 <SquadTourCard
82 key="step3"

Callers

nothing calls this directly

Calls 4

useSquadTourFunction · 0.90
onSwipedRightFunction · 0.85
onSwipedLeftFunction · 0.85
onCloseFunction · 0.50

Tested by

no test coverage detected