You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2024/04/02 07:30:12 UTC

(incubator-devlake) branch main updated: feat: adjust the welcome page for onboard (#7269)

This is an automated email from the ASF dual-hosted git repository.

mintsweet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new b21acffc6 feat: adjust the welcome page for onboard (#7269)
b21acffc6 is described below

commit b21acffc6e0ef6ce6a7b9e5a7891755f9c247730
Author: 青湛 <0x...@gmail.com>
AuthorDate: Tue Apr 2 20:30:07 2024 +1300

    feat: adjust the welcome page for onboard (#7269)
---
 config-ui/src/routes/onboard/index.tsx  | 11 +++--
 config-ui/src/routes/onboard/step-0.tsx | 75 +++++++++++++++------------------
 2 files changed, 41 insertions(+), 45 deletions(-)

diff --git a/config-ui/src/routes/onboard/index.tsx b/config-ui/src/routes/onboard/index.tsx
index fceb49ebf..4f76a515f 100644
--- a/config-ui/src/routes/onboard/index.tsx
+++ b/config-ui/src/routes/onboard/index.tsx
@@ -16,7 +16,7 @@
  *
  */
 
-import { useState, useEffect } from 'react';
+import React, { useState, useEffect } from 'react';
 import { useNavigate } from 'react-router-dom';
 import { CloseOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
 import { theme, Layout, Modal } from 'antd';
@@ -49,7 +49,12 @@ const steps = [
   },
 ];
 
-export const Onboard = () => {
+interface Props {
+  logo?: React.ReactNode;
+  title?: React.ReactNode;
+}
+
+export const Onboard = ({ logo, title }: Props) => {
   const [step, setStep] = useState(0);
   const [records, setRecords] = useState<Record[]>([]);
   const [projectName, setProjectName] = useState<string>();
@@ -106,7 +111,7 @@ export const Onboard = () => {
       <Layout style={{ height: '100vh' }}>
         <S.Inner>
           {step === 0 ? (
-            <Step0 />
+            <Step0 logo={logo} title={title} />
           ) : (
             <>
               <S.Header>
diff --git a/config-ui/src/routes/onboard/step-0.tsx b/config-ui/src/routes/onboard/step-0.tsx
index 08487dc7c..e880c3857 100644
--- a/config-ui/src/routes/onboard/step-0.tsx
+++ b/config-ui/src/routes/onboard/step-0.tsx
@@ -17,56 +17,49 @@
  */
 
 import { useState, useContext } from 'react';
-import { Button } from 'antd';
+import { Flex, Button } from 'antd';
 import styled from 'styled-components';
 
 import API from '@/api';
+import { Logo } from '@/components';
 import { operator } from '@/utils';
 
 import { Context } from './context';
 
 const Wrapper = styled.div`
-  margin-top: 100px;
-  text-align: center;
-
-  .welcome {
+  .logo {
     display: flex;
-    align-items: center;
-    justify-content: center;
-    padding: 30px 0;
-    font-size: 40px;
+    margin-bottom: 200px;
+  }
 
-    span.line {
-      display: inline-block;
-      width: 242px;
-      height: 1px;
-      background-color: #dbdcdf;
-    }
+  h1 {
+    margin-bottom: 24px;
+    font-size: 64px;
+    font-weight: 400;
 
-    span.content {
-      margin: 0 24px;
+    & > span {
+      color: #e8471c;
     }
   }
 
-  .title {
-    margin: 15px 0;
-    padding: 16px 0;
-    font-size: 60px;
-    font-weight: 600;
-  }
-
-  .subTitle {
+  h4 {
+    margin-bottom: 70px;
     font-size: 16px;
+    font-weight: 400;
   }
 
   .action {
     margin: 0 auto;
-    width: 200px;
-    margin-top: 64px;
+    width: 280px;
   }
 `;
 
-export const Step0 = () => {
+interface Props {
+  logo?: React.ReactNode;
+  title?: React.ReactNode;
+}
+
+export const Step0 = ({ logo = <Logo />, title = 'DevLake' }: Props) => {
   const [operating, setOperating] = useState(false);
 
   const { step, records, done, projectName, plugin, setStep } = useContext(Context);
@@ -87,20 +80,18 @@ export const Step0 = () => {
 
   return (
     <Wrapper>
-      <div className="welcome">
-        <span className="line" />
-        <span className="content">Welcome</span>
-        <span className="line" />
-      </div>
-      <div className="title">Connect to your first repository</div>
-      <div className="subTitle">
-        Integrate your first Git tool and observe engineering metrics with just a few clicks.
-      </div>
-      <div className="action">
-        <Button block size="large" type="primary" loading={operating} onClick={handleSubmit}>
-          Start
-        </Button>
-      </div>
+      <div className="logo">{logo}</div>
+      <Flex vertical justify="center" align="center">
+        <h1>
+          Welcome to <span>{title}</span>
+        </h1>
+        <h4>With just a few clicks, you can integrate your initial DevOps tool and observe engineering metrics.</h4>
+        <div className="action">
+          <Button block size="large" type="primary" loading={operating} onClick={handleSubmit}>
+            Connect to your first repository
+          </Button>
+        </div>
+      </Flex>
     </Wrapper>
   );
 };