From 6e653774beea04d6792ae54eb8bc3b7a4ef9262c Mon Sep 17 00:00:00 2001 From: Andre H Date: Fri, 1 Mar 2024 11:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20reskin=20with=20shared?= =?UTF-8?q?=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/create/template/index.tsx | 144 ++++++++---------- 1 file changed, 64 insertions(+), 80 deletions(-) diff --git a/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx b/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx index 9ff50c8..8f8a0f3 100644 --- a/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx +++ b/packages/frontend/src/pages/org-slug/projects/create/template/index.tsx @@ -1,15 +1,23 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { useForm, Controller, SubmitHandler } from 'react-hook-form'; +import { useForm, SubmitHandler } from 'react-hook-form'; import { useNavigate, useOutletContext, useParams } from 'react-router-dom'; import toast from 'react-hot-toast'; import assert from 'assert'; -import { Button, Option, Typography } from '@material-tailwind/react'; - import { useOctokit } from '../../../../../context/OctokitContext'; import { useGQLClient } from '../../../../../context/GQLClientContext'; -import AsyncSelect from '../../../../../components/shared/AsyncSelect'; import { Template } from '../../../../../types'; +import { Heading } from 'components/shared/Heading'; +import { Input } from 'components/shared/Input'; +import { Radio } from 'components/shared/Radio'; +import { Select } from 'components/shared/Select'; +import { + ArrowRightCircleFilledIcon, + GitIcon, + GitTeaIcon, +} from 'components/shared/CustomIcon'; +import { Checkbox } from 'components/shared/Checkbox'; +import { Button } from 'components/shared/Button'; type SubmitRepoValues = { framework: string; @@ -30,6 +38,19 @@ const CreateRepo = () => { const [gitAccounts, setGitAccounts] = useState([]); const [isLoading, setIsLoading] = useState(false); + const FRAMEWORK_OPTIONS = [ + { + value: 'react-native', + label: 'React Native', + leftIcon: , + }, + { + value: 'expo', + label: 'Expo', + leftIcon: , + }, + ]; + const submitRepoHandler: SubmitHandler = useCallback( async (data) => { assert(data.account); @@ -93,7 +114,7 @@ const CreateRepo = () => { fetchUserAndOrgs(); }, [octokit]); - const { register, handleSubmit, control, reset } = useForm({ + const { handleSubmit, reset } = useForm({ defaultValues: { framework: 'React', repoName: '', @@ -110,86 +131,49 @@ const CreateRepo = () => { return (
-
- - Create a repository - - - The project will be cloned into this repository - -
-
-
Framework
-
- - -
-
-
-
Git account
+
- ( - - {gitAccounts.map((account, key) => ( - - ))} - - )} + Create a repository + + The project will be cloned into this repository + +
+
+ Framework +
-
-
-
Name the repo
+
+ Git account + +
- + +
+
+
-
-
- -
-
-
);