From 0455baea6c88cd7ffa301d67805a29dce2c5ba3c Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 10 Jul 2023 17:31:38 -0700 Subject: sprucing up onboarding --- extension/react-app/src/components/Onboarding.tsx | 146 ++++++++++++++++------ 1 file changed, 105 insertions(+), 41 deletions(-) (limited to 'extension/react-app') diff --git a/extension/react-app/src/components/Onboarding.tsx b/extension/react-app/src/components/Onboarding.tsx index 373f7bea..0e188e7a 100644 --- a/extension/react-app/src/components/Onboarding.tsx +++ b/extension/react-app/src/components/Onboarding.tsx @@ -1,51 +1,115 @@ import { useSelector } from "react-redux"; import { RootStore } from "../redux/store"; -import React, { useState } from 'react'; +import React, { useState, useEffect } from "react"; +import styled from "styled-components"; +import { ArrowLeft, ArrowRight } from "@styled-icons/heroicons-outline"; +import { defaultBorderRadius } from "."; +const StyledDiv = styled.div` + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #1e1e1e; + z-index: 200; +`; + +const StyledSpan = styled.span` + padding: 8px; + border-radius: ${defaultBorderRadius}; + &:hover { + background-color: #ffffff33; + } +`; const Onboarding = () => { - const [counter, setCounter] = useState(0); + const [counter, setCounter] = useState(4); + const gifs = ["intro", "explain", "edit", "generate"]; + const topMessages = [ + "Welcome to Continue!", + "Answer coding questions", + "Edit in natural language", + "Generate files from scratch", + ]; + const bottomMessages = [ + "", + "Ask Continue about a part of your code to get another perspective", + "Highlight a section of code and instruct Continue to refactor it", + "Let Continue build the scaffolding of Python scripts, React components, and more", + ]; - const handleClick = () => { - setCounter(counter + 1); - } + const vscMediaUrl = useSelector( + (state: RootStore) => state.config.vscMediaUrl + ); - const vscMediaUrl = useSelector( - (state: RootStore) => state.config.vscMediaUrl - ); + useEffect(() => { + const hasVisited = localStorage.getItem("hasVisited"); + if (hasVisited) { + setCounter(4); + } else { + setCounter(0); + localStorage.setItem("hasVisited", "true"); + } + }, []); - return ( -
- {counter === 0 && ( -
-

Welcome to Continue!

- Intro -
- )} - {counter === 1 && ( -
-

Answer coding questions

- Explain -

Ask Continue about a part of your code to get another perspective

-
- )} - {counter === 2 && ( -
-

Edit in natural language

- Edit -

Highlight a section of code and instruct Continue to refactor it

-
- )} - {counter === 3 && ( -
-

Generate files from scratch

- Generate -

Let Continue build the scaffolding of Python scripts, React components, and more

-
- )} -

Click to learn how to use Continue...

-
- ); -} + return ( + + ); +}; export default Onboarding; -- cgit v1.2.3-70-g09d2