Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New How it works modal on HomePage and minor UX tweeks #37

Merged
merged 15 commits into from
Mar 27, 2023
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
credentials.sql
credentials.sql
mivasconcelos marked this conversation as resolved.
Show resolved Hide resolved
previewConfig.json
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
37 changes: 37 additions & 0 deletions web/src/assets/howitworks/create-workspace-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions web/src/assets/howitworks/rtdm-connect-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions web/src/assets/howitworks/workspace-connect-direct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion web/src/components/GithubButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const GithubStargazer: React.FC<GithubStargazerProps> = ({
repoName,
}) => {
const [stargazersCount, setStargazersCount] = React.useState(0);

sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
const handleFlexRedirect = () => {
window.open(`https://github.com/${owner}/${repoName}`, "_blank");
};
Expand Down
171 changes: 171 additions & 0 deletions web/src/components/HowItWorksModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import {
Box,
Grid,
GridItem,
Icon,
Image,
Link,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Stack,
Text,
useColorModeValue,
} from "@chakra-ui/react";
import * as React from "react";
import { HiChevronRight } from "react-icons/hi";

import CreateWorkspaceButtonSVG from "@/assets/howitworks/create-workspace-button.svg";
import RTDMConnectButtonSVG from "@/assets/howitworks/rtdm-connect-button.svg";
import WorkspaceConnectDirectOptionSVG from "@/assets/howitworks/workspace-connect-direct.svg";

import { InvertedPrimaryButton } from "./customcomponents/Button";

const HOW_IT_WORKS_STEPS = [
{
title: "1. Enter your workspace host address.",
description: (
<>
Go to your SingleStoreDB <b>workspace group page</b> and copy
SinglestoreDB endpoints by clicking in workspace Connect options.
</>
),
imageSrc: WorkspaceConnectDirectOptionSVG,
},
{
title: "2. Paste Workspace Group's password",
description: (
<>
This can be obtained from the <b>Connect Directly flyout</b>. The
password can be reset in the Access tab of your Workspace Group.
</>
),
imageSrc: CreateWorkspaceButtonSVG,
},
{
title: "3. Select Martech database and connect",
description: (
<>
Follow the <b>Try with sample data</b> tutorial in SingleStoreDB help
menu to know how to create and connect to a Martech database.
</>
),
imageSrc: RTDMConnectButtonSVG,
},
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
];

const StepSeparator = () => (
<Box
display="inline-flex"
padding={3}
justifyContent="center"
alignItems="center"
>
<Icon
as={HiChevronRight}
color={useColorModeValue("white", "#2F206E")}
background={useColorModeValue("#553ACF", "#CCC3F9")}
borderRadius="50%"
fontSize="1.2em"
/>
</Box>
);

export const HowItWorksModal = () => {
const [showModal, setShowModal] = React.useState(false);

const openModal = () => setShowModal(true);
const closeModal = () => setShowModal(false);

const SingleStepContainer = ({
title,
description,
imageSrc,
}: {
title: string;
description: React.ReactNode;
imageSrc: string;
}) => (
<GridItem
alignItems="center"
justifyContent="center"
display="flex"
flexDirection="column"
textAlign="center"
gap="8px"
>
<Image
src={imageSrc}
width="70%"
objectFit="contain"
background="#FFFFFF"
marginBottom="16px"
/>
<Text fontSize="md" fontWeight="bold">
{title}
</Text>
<Text fontSize="sm">{description}</Text>
</GridItem>
);

const StepGridItems = () => {
const numOfSteps = HOW_IT_WORKS_STEPS.length;
return (
<>
{HOW_IT_WORKS_STEPS.map(({ title, description, imageSrc }, index) => (
<React.Fragment key={index}>
<SingleStepContainer
title={title}
description={description}
imageSrc={imageSrc}
/>
{/* We add a arrow separator in between each steps.*/}
{index < numOfSteps - 1 && <StepSeparator />}
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
</React.Fragment>
))}
</>
);
};

return (
<>
<Link onClick={openModal}>How it works?</Link>
<Modal size="6xl" isOpen={showModal} onClose={closeModal} isCentered>
<ModalOverlay />
<ModalContent
display="flex"
alignItems="center"
padding="24px 26px 24px 26px"
>
<Stack justifyContent="center" alignItems="center" gap="26px">
<ModalHeader fontSize="26px" fontWeight="bold" padding="8px">
How Real-Time Digital marketing app works?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
How Real-Time Digital marketing app works?
How does the Real-Time Digital marketing app work?

Copy link
Contributor Author

@sandeshvijayraj sandeshvijayraj Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I do not like either of the statement. We are not explaining how the RTDM works rather we are explaining how the connection to singlestoreDB works

Should we better rename it something like

"How does the connection to singlesytoreDB work in RTDM?"
?? @TitoGrine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. What about: "How to connect to the Real-Time Digital marketing app?"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreeded, what do you think about:

"How to connect the Real-Time Digital marketing app to SingleStoreDB?"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"How to connect the Real-Time Digital marketing app to SingleStoreDB?"

This one is better

what do you think @mivasconcelos

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deal! It seems good to me

Copy link
Contributor

@mivasconcelos mivasconcelos Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you just add a screenshot just to make sure it isn't too long?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot from 2023-03-24 11-33-31

</ModalHeader>
<ModalCloseButton
_focus={{ boxShadow: "none" }}
// onClick={closeModal}
/>
<ModalBody padding={0} margin={0}>
<Grid display="flex" padding={0} margin={0}>
<StepGridItems />
</Grid>
</ModalBody>
<ModalFooter margin="8px">
<InvertedPrimaryButton
onClick={closeModal}
fontSize="1.2rem"
lineHeight="20px"
>
Start now
</InvertedPrimaryButton>
</ModalFooter>
</Stack>
</ModalContent>
</Modal>
</>
);
};
20 changes: 6 additions & 14 deletions web/src/components/dataConfigForm/DatabaseConfigFormAutomatic.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link, SimpleGrid, Stack, Text } from "@chakra-ui/react";
import { SimpleGrid, Stack, Text } from "@chakra-ui/react";
import * as React from "react";
import { useRecoilState } from "recoil";

Expand Down Expand Up @@ -29,7 +29,7 @@ export const DatabaseConfigForm = ({
if (showDatabase) {
databaseInput = (
<ConfigInput
label="Database"
label="Martech database name"
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
placeholder="martech"
value={database}
setValue={setDatabase}
Expand All @@ -45,30 +45,22 @@ export const DatabaseConfigForm = ({
return (
<Stack spacing={4}>
<ConfigInput
label="Host & Port"
label="Workspace Host"
placeholder="http://127.0.0.1:8808"
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
value={host}
setValue={setHost}
helpText={
<Text>
The protocol (http, https), host, and port for the SingleStore{" "}
<Link href="https://docs.singlestore.com/docs/http-api" isExternal>
Data API
</Link>
.
</Text>
}
helpText={<Text>Your workspace hostname.</Text>}
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
/>
<SimpleGrid columns={2} gap={2}>
<ConfigInput
label="Username"
label="Workspace group username"
helpText="Fill in the Security credentials of your workspace group."
placeholder="admin"
value={user}
setValue={setUser}
/>
<ConfigInput
label="Password"
label="Workspace group password"
placeholder=""
value={password}
setValue={setPassword}
Expand Down
19 changes: 5 additions & 14 deletions web/src/components/dataConfigForm/DatabaseConfigFormManual.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
Box,
Link,
SimpleGrid,
Stack,
Text,
Expand Down Expand Up @@ -81,7 +80,7 @@ export const DatabaseConfigFormManual = ({
if (showDatabase) {
databaseInput = (
<ConfigInput
label="Database"
label="Martech Database name"
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
placeholder="martech"
required
value={localDatabase}
Expand Down Expand Up @@ -114,32 +113,24 @@ export const DatabaseConfigFormManual = ({
return (
<Stack spacing={4} onKeyDown={handleEnterKeyPress}>
<ConfigInput
label="Host & Port"
label="Workspace Host"
placeholder="http://127.0.0.1:8808"
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
value={localHost}
required
setValue={setLocalHost}
helpText={
<Text>
The protocol (http, https), host, and port for the SingleStore{" "}
<Link href="https://docs.singlestore.com/docs/http-api/" isExternal>
Data API
</Link>
.
</Text>
}
helpText={<Text>Your workspace hostname.</Text>}
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
/>
<SimpleGrid columns={2} gap={2}>
<ConfigInput
label="Username"
label="Workspace group username"
required
helpText="Fill in the Security credentials of your workspace group."
placeholder="admin"
value={localUser}
setValue={setLocalUser}
/>
<ConfigInput
label="Password"
label="Workspace group password"
required
placeholder=""
value={localPassword}
Expand Down
2 changes: 1 addition & 1 deletion web/src/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const selectableCitiesData: Array<City> = [
},
{
id: 120658,
name: "New York City",
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
name: "New York",
centerLat: 40.71427003,
centerLon: -74.00597003,
diameter: 0.4,
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const DashboardContainerChild = () => {
<Stack gap={10}>
<Stack spacing={3}>
<Stack spacing={2}>
<Heading fontSize="md">Engagement</Heading>
<Heading fontSize="xl">Engagement</Heading>
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
<Text overflowWrap="break-word">
Conversion rate with subscribers
</Text>
Expand All @@ -142,7 +142,7 @@ const DashboardContainerChild = () => {
</Stack>
<Stack spacing={3}>
<Stack spacing={2}>
<Heading fontSize="md">Top Performing Customers</Heading>
<Heading fontSize="xl">Top Performing Customers</Heading>
<Text overflowWrap="break-word">
Companies with the highest conversion rate
</Text>
Expand Down
8 changes: 4 additions & 4 deletions web/src/pages/Configure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,17 @@ const CollapsibleSection = ({
<div style={containerStyle}>
<Button
justifyContent="space-between"
size="sm"
size="md"
width="100%"
style={buttonStyle}
onClick={() => setSectionOpen(!sectionOpen)}
>
{title}
{accordionIcon}
</Button>
<div style={childContainerStyle}>
<Box style={childContainerStyle}>
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
<Collapse in={sectionOpen}>{childComponent}</Collapse>
</div>
</Box>
</div>
);
};
Expand Down Expand Up @@ -1103,7 +1103,7 @@ export const Configure = () => {
>
<Flex gap={5} justifyContent="space-between" marginBottom="50px">
<Stack spacing={2}>
<Heading fontSize="md">Setting up Your Application</Heading>
<Heading fontSize="xl">Setting up Your Application</Heading>
<Text size="xs" overflowWrap="break-word">
Connect to a SingleStoreDB workspace to see how we power the
real-time Digital Marketing applications. If you have any questions
Expand Down
6 changes: 3 additions & 3 deletions web/src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const RealtimeChart = () => {
<Stack spacing={4}>
<Stack spacing={3}>
<Stack spacing={2}>
<Heading size="md">Key Metrics</Heading>
<Heading fontSize="xl">Key Metrics</Heading>
<Text>Serving ads real-time to simulated subscribers</Text>
</Stack>
</Stack>
Expand Down Expand Up @@ -195,7 +195,7 @@ const StatsWrapper = () => {
<Stack spacing={4}>
<Stack spacing={3}>
<Stack spacing={2}>
<Heading fontSize="md">Locations</Heading>
<Heading fontSize="xl">Locations</Heading>
<Text overflowWrap="break-word">
Select cities to add to the dataset
</Text>
Expand Down Expand Up @@ -266,7 +266,7 @@ export const NotificationsMap = () => {
left={0}
top={0}
overflow={isSmallScreen ? undefined : "auto"}
width={isSmallScreen ? "100%" : "30%"}
width={isSmallScreen ? "100%" : "31%"}
sandeshvijayraj marked this conversation as resolved.
Show resolved Hide resolved
height={isSmallScreen ? "auto" : "100%"}
borderBottomRightRadius="10px"
padding="36px 48px 36px 48px"
Expand Down
Loading