From ba9e9b9b53ef6a86c863035ba26668df15e7f821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Thu, 13 Jun 2024 20:33:08 +0800 Subject: [PATCH] feat: use canyon-ui --- packages/canyon-platform/package.json | 2 +- .../src/pages/index/billing/cart.json | 75 -------- .../src/pages/index/billing/cart.tsx | 91 ---------- .../src/pages/index/billing/index.tsx | 164 ------------------ .../src/pages/index/members/index.tsx | 5 - .../index/projects/[id]/configure/index.tsx | 12 +- .../src/pages/index/projects/index.tsx | 8 +- .../src/pages/index/settings/index.tsx | 9 +- .../src/pages/index/usage/index.tsx | 56 ------ .../canyon-ui-old/src/components/index.ts | 1 - .../src/components/text/Title.tsx | 20 --- .../src/components/text/index.ts | 1 - 12 files changed, 14 insertions(+), 430 deletions(-) delete mode 100644 packages/canyon-platform/src/pages/index/billing/cart.json delete mode 100644 packages/canyon-platform/src/pages/index/billing/cart.tsx delete mode 100644 packages/canyon-platform/src/pages/index/billing/index.tsx delete mode 100644 packages/canyon-platform/src/pages/index/members/index.tsx delete mode 100644 packages/canyon-platform/src/pages/index/usage/index.tsx delete mode 100644 packages/canyon-ui-old/src/components/text/Title.tsx delete mode 100644 packages/canyon-ui-old/src/components/text/index.ts diff --git a/packages/canyon-platform/package.json b/packages/canyon-platform/package.json index a26b30ce..75983328 100644 --- a/packages/canyon-platform/package.json +++ b/packages/canyon-platform/package.json @@ -22,7 +22,7 @@ "ahooks": "^3.7.10", "antd": "^5.14.1", "axios": "^1.6.7", - "canyon-ui": "^0.0.10-alpha.3", + "canyon-ui": "^0.0.10-alpha.8", "canyon-ui-old": "workspace:^", "copy-to-clipboard": "^3.3.3", "dayjs": "^1.11.10", diff --git a/packages/canyon-platform/src/pages/index/billing/cart.json b/packages/canyon-platform/src/pages/index/billing/cart.json deleted file mode 100644 index 42e3cbef..00000000 --- a/packages/canyon-platform/src/pages/index/billing/cart.json +++ /dev/null @@ -1,75 +0,0 @@ -[ - { - "title": "按需计划", - "desc": "适用于用途可变的不断增长的项目。没有月租费,但使用量按使用量收费。", - "details": [ - { - "title": "流量配置", - "items": [ - { - "key": "流量", - "value": "每月 10G 流量" - }, - { - "key": "速率", - "value": "每秒 100Mbps" - }, - { - "key": "存储空间", - "value": "10 TiB/月" - } - ] - }, - { - "title": "用户", - "items": [ - { - "key": "最大用户", - "value": "100人" - } - ] - }, - { - "title": "支持", - "items": [ - { - "key": "优先响应", - "value": "勾" - } - ] - } - ] - }, - { - "title": "按需计划", - "desc": "适用于用途可变的不断增长的项目。没有月租费,但使用量按使用量收费。", - "details": [ - { - "title": "EAS构建", - "items": [ - { - "key": "构建", - "value": "每月 99 美元的构建信用" - }, - { - "key": "构建", - "value": "每月 99 美元的构建信用" - } - ] - }, - { - "title": "EAS构建", - "items": [ - { - "key": "构建", - "value": "每月 99 美元的构建信用" - }, - { - "key": "构建", - "value": "每月 99 美元的构建信用" - } - ] - } - ] - } -] diff --git a/packages/canyon-platform/src/pages/index/billing/cart.tsx b/packages/canyon-platform/src/pages/index/billing/cart.tsx deleted file mode 100644 index dbdad682..00000000 --- a/packages/canyon-platform/src/pages/index/billing/cart.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import Icon, { ArrowRightOutlined, CheckCircleFilled, CheckCircleTwoTone } from '@ant-design/icons'; -import { Button, ConfigProvider, Space, theme, Typography } from 'antd'; -import { CanyonBillingCollapse, CanyonBillingRadio } from 'canyon-ui-old'; -import { CanyonCardPrimary } from 'canyon-ui-old'; -import { useState } from 'react'; - -import cart from './cart.json'; -const { Text } = Typography; -// import {Text} from "echarts/types/src/util/graphic"; -// console.log(ss,'ss') -const { useToken } = theme; -const TestBtn = () => { - return ( - - ); -}; -const BillingCart = () => { - const { token } = useToken(); - const [value, setValue] = useState(0); - const [count, setCount] = useState(0); - return ( -
- - Choose a plan - - Get the most out of EAS with a monthly plan. - - -
- {cart.map((c,index) => { - return ( - - { - setValue(index); - }} - /> - } - /> - - ); - })} -
- -
- - - Choose a plan - - Get the most out of EAS with a monthly plan. - - - -
-
-

Usage-based pricing

-

Usage above what's included in each plan is charged at the following rates.

-
- -
-

EAS Build

-
-

Android medium worker

-

$1 per build

-
- -
-

Android medium worker

-

$1 per build

-
-
-
-
- -
- -
-
- ); -}; - -export default BillingCart; diff --git a/packages/canyon-platform/src/pages/index/billing/index.tsx b/packages/canyon-platform/src/pages/index/billing/index.tsx deleted file mode 100644 index 783f136d..00000000 --- a/packages/canyon-platform/src/pages/index/billing/index.tsx +++ /dev/null @@ -1,164 +0,0 @@ -import { - ArrowRightOutlined, - CaretRightOutlined, - CreditCardOutlined, - RightOutlined, - RightSquareOutlined, -} from '@ant-design/icons'; -// import {Text} from "echarts/types/src/util/graphic"; -// import { CanyonCardPrimary } from './index.ts'; -import { StockOutlined } from '@ant-design/icons'; -import { - Button, - Col, - Collapse, - CollapseProps, - Descriptions, - DescriptionsProps, - Progress, - Row, - Space, - Statistic, - theme, - Typography, -} from 'antd'; -import { CanyonCardPrimary, CanyonTextTitle } from 'canyon-ui-old'; -import { CanyonBillingCollapse, CanyonBillingUpdateCard } from 'canyon-ui-old'; -import { CSSProperties } from 'react'; -// import {CanyonBillingCollapse} from "canyon-ui-old/"; -// import { Button, Col, Divider, Row, Space, Statistic, theme, Typography } from 'antd'; -const { useToken } = theme; -// const { Title } = Typography; -const { Title, Text } = Typography; -import { useNavigate } from 'react-router-dom'; - -import c from './cart.json'; -// import {CanyonCardPrimary} from "canyon-ui-old/src"; -const items: DescriptionsProps['items'] = [ - { - key: '1', - label: 'UserName', - children: 'Zhou Maomao', - }, - { - key: '2', - label: 'Telephone', - children: '1810000000', - }, - { - key: '3', - label: 'Live', - children: 'Hangzhou, Zhejiang', - }, - { - key: '4', - label: 'Remark', - children: 'empty', - }, - { - key: '5', - label: 'Address', - children: 'No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China', - }, -]; -const Billing = () => { - const panelStyle: React.CSSProperties = { - marginBottom: 24, - // backgroundColor: '#f8f9fa', - // background: token.colorFillAlter, - borderRadius: 'none', - border: 'none', - }; - const text = ` - A dog is a type of domesticated animal. - Known for its loyalty and faithfulness, - it can be found as a welcome guest in many households across the world. -`; - const getItems: (panelStyle: CSSProperties) => CollapseProps['items'] = (panelStyle) => [ - { - key: '1', - label: ( -
- - Free plan - - - For startups, proofs-of-concept, hobbyists, and student projects. - -
- ), - children: ( -
- -
- ), - style: panelStyle, - }, - ]; - const nav = useNavigate(); - return ( -
- } /> - -
-
- - 计划 - - - -
-
- -
- - -
- - -
- - <Space> - <StockOutlined /> - 流量使用 - </Space> - -
- -
- Builds - -
- 已经使用30%,30G流量 - -
- - Included -
-
- - -
- - -
- ); -}; - -export default Billing; diff --git a/packages/canyon-platform/src/pages/index/members/index.tsx b/packages/canyon-platform/src/pages/index/members/index.tsx deleted file mode 100644 index 644c3392..00000000 --- a/packages/canyon-platform/src/pages/index/members/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -const Members = () => { - return
Members
-} - -export default Members; diff --git a/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx b/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx index e4ed73ff..4fcda5d1 100644 --- a/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx +++ b/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx @@ -1,7 +1,7 @@ import Icon, { AppstoreOutlined, ExperimentOutlined } from '@ant-design/icons'; import { useMutation, useQuery } from '@apollo/client'; import { Editor } from '@monaco-editor/react'; -import { FormRegion } from 'canyon-ui'; +import { FormRegion, TextTypography } from 'canyon-ui'; import { GetProjectByIdDocument, @@ -14,7 +14,7 @@ import TagTable from './helper/TagTable.tsx'; const gridStyle: any = { width: '100%', }; -const { Title, Text } = Typography; +const { Text } = Typography; const { useToken } = theme; const ProjectConfigure = () => { const prm: any = useParams(); @@ -36,11 +36,8 @@ const ProjectConfigure = () => { const basicFormsRef = useRef(null); return ( -
- - <AppstoreOutlined className={'text-[#687076] text-[32px]'} /> - <span>{t('projects.config.title')}</span> - +
+ } /> } @@ -149,7 +146,6 @@ const ProjectConfigure = () => { variables: { projectID: prm.id, coverage: coverage || GetProjectByIdDocumentData?.getProjectByID.coverage || '', - tag: '__null__', description: '__null__', defaultBranch: defaultBranch || diff --git a/packages/canyon-platform/src/pages/index/projects/index.tsx b/packages/canyon-platform/src/pages/index/projects/index.tsx index d332358a..2410e75a 100755 --- a/packages/canyon-platform/src/pages/index/projects/index.tsx +++ b/packages/canyon-platform/src/pages/index/projects/index.tsx @@ -8,7 +8,8 @@ import { import { useMutation, useQuery } from '@apollo/client'; import { Space } from 'antd'; import { ColumnsType } from 'antd/es/table'; -import { CanyonCardPrimary, CanyonTextTitle } from 'canyon-ui-old'; +import { TextTypography } from 'canyon-ui'; +import { CanyonCardPrimary } from 'canyon-ui-old'; import dayjs from 'dayjs'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -99,6 +100,7 @@ const ProjectPage = () => { className={'max-w-[240px]'} style={{ color: 'unset' }} target={'_blank'} + // @ts-ignore href={`${window.GITLAB_URL}/${text}`} rel='noreferrer' > @@ -242,9 +244,9 @@ const ProjectPage = () => { return ( <> - } + } right={