From 207b32ce65afc30c7354ddf1d14b80896c16c577 Mon Sep 17 00:00:00 2001 From: Andre H Date: Fri, 1 Mar 2024 11:23:38 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20feat:=20integrate=20usefor?= =?UTF-8?q?m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/create/template/index.tsx | 68 ++++++++++++++----- 1 file changed, 50 insertions(+), 18 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 8f8a0f39..8364f60a 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,5 +1,5 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { useForm, SubmitHandler } from 'react-hook-form'; +import { useForm, SubmitHandler, Controller } from 'react-hook-form'; import { useNavigate, useOutletContext, useParams } from 'react-router-dom'; import toast from 'react-hot-toast'; import assert from 'assert'; @@ -10,7 +10,7 @@ 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 { Select, SelectOption } from 'components/shared/Select'; import { ArrowRightCircleFilledIcon, GitIcon, @@ -40,12 +40,12 @@ const CreateRepo = () => { const FRAMEWORK_OPTIONS = [ { - value: 'react-native', + value: 'React', label: 'React Native', leftIcon: , }, { - value: 'expo', + value: 'Expo', label: 'Expo', leftIcon: , }, @@ -114,7 +114,7 @@ const CreateRepo = () => { fetchUserAndOrgs(); }, [octokit]); - const { handleSubmit, reset } = useForm({ + const { handleSubmit, control, reset } = useForm({ defaultValues: { framework: 'React', repoName: '', @@ -140,29 +140,61 @@ const CreateRepo = () => {
Framework - ( + + )} />
Git account - onChange((value as SelectOption).value)} + options={ + gitAccounts.map((account) => ({ + value: account, + label: account, + })) ?? [] + } + /> + )} />
Name the repo - + ( + + )} + />
- + ( + + )} + />