diff --git a/apps/ui/src/components/forms/createProject/select-repo-box.tsx b/apps/ui/src/components/forms/createProject/select-repo-box.tsx index 3d66b3d..28a17ca 100644 --- a/apps/ui/src/components/forms/createProject/select-repo-box.tsx +++ b/apps/ui/src/components/forms/createProject/select-repo-box.tsx @@ -1,9 +1,10 @@ import * as React from 'react'; import { useEffect, useState } from 'react'; import { getRepositories } from '../../../api/services/integration.service'; +import Props from './props.type'; import RepoSelectItem from './repo-select-item'; -const SelectRepoBox: React.FC = () => { +const SelectRepoBox: React.FC = (props: Props) => { const [repos, setRepos] = useState([]); diff --git a/apps/ui/src/components/modals/project/create-project-modal.tsx b/apps/ui/src/components/modals/project/create-project-modal.tsx index e3cfa1b..b13dd72 100644 --- a/apps/ui/src/components/modals/project/create-project-modal.tsx +++ b/apps/ui/src/components/modals/project/create-project-modal.tsx @@ -4,41 +4,74 @@ import SelectRepoStage from './stages/select-repo-stage'; import SocialLinksStage from './stages/social-links-stage'; const CreateProjectModal: React.FC = () => { + + type RepositoryData = { + title: string, + description: string, + slug: string, + technologies: [ + string + ], + } + const [selectedStage, setSelectedStage] = React.useState(0); - const [stage, setStage] = React.useState([, , ]) + + /** + * Handle repository selection + */ + const [repository, setRepository] = React.useState(null); + const handleSelectRepo = (selectedRepository: RepositoryData) => { + setRepository(selectedRepository); + setSelectedStage(selectedStage + 1); + }; + + + const stages = [ + { + title: "Submit Product", + description: "Let's change the world with your amazing project", + component: + }, + { + title: "Submit Product", + description: "Let's change the world with your amazing project", + component: + }, + { + title: "Product / Links", + description: "Add all the places that link to your product", + component: + } + ]; + + return (
- {selectedStage == 0 || selectedStage == 1 ? ( + {(selectedStage === 0 || selectedStage === 1) && (
- Submit Product + {stages[selectedStage].title}
- Let's change the world with your amazing project + {stages[selectedStage].description}
- ) : ( - <> )} - {selectedStage == 2 ? ( + {selectedStage === 2 && (
- Product / Links + {stages[selectedStage].title}
- Add all the places that link to your product + {stages[selectedStage].description}
- ) : ( - <> )} -
- {stage[selectedStage]} -
+
{stages[selectedStage].component}
- ) -} + ); +}; export default CreateProjectModal; diff --git a/apps/ui/src/components/modals/project/stages/select-repo-stage.tsx b/apps/ui/src/components/modals/project/stages/select-repo-stage.tsx index 928ed61..c84ca87 100644 --- a/apps/ui/src/components/modals/project/stages/select-repo-stage.tsx +++ b/apps/ui/src/components/modals/project/stages/select-repo-stage.tsx @@ -4,8 +4,18 @@ import { Button } from '../../../../packages/ui/components/buttons/Button'; import ContentSearchInput from '../../../../packages/ui/components/forms/inputs/ContentSearchInput'; import SelectRepoBox from '../../../forms/createProject/select-repo-box'; +type RepositoryData = { + title: string, + description: string, + slug: string, + technologies: [ + string + ], +} + type Props = { - setStage: () => void + setStage: () => void; + handleSelectRepo: (selectedRepository: RepositoryData) => void; } const SelectRepoStage: React.FC = (props: Props) => { @@ -14,7 +24,7 @@ const SelectRepoStage: React.FC = (props: Props) => { - +
+ +
+ + Submit Project +
+ + } + dialogContent={} + /> {token ? ( diff --git a/apps/ui/src/components/view/filters/filter-item.tsx b/apps/ui/src/components/view/filters/filter-item.tsx index af0337b..6b9b611 100644 --- a/apps/ui/src/components/view/filters/filter-item.tsx +++ b/apps/ui/src/components/view/filters/filter-item.tsx @@ -1,8 +1,10 @@ -import * as React from 'react' -import * as Checkbox from '@radix-ui/react-checkbox' +import * as Checkbox from '@radix-ui/react-checkbox'; +import * as React from 'react'; +import { useState } from 'react'; import { GoCheck } from 'react-icons/go'; const FilterItem: React.FC = () => { + const [checked, setChecked] = useState(false); return (
{ - Boostrapped + Bootstrapped
) } diff --git a/apps/ui/src/components/view/filters/filter-sidebar.tsx b/apps/ui/src/components/view/filters/filter-sidebar.tsx index 5e8e6e2..dc4b4f7 100644 --- a/apps/ui/src/components/view/filters/filter-sidebar.tsx +++ b/apps/ui/src/components/view/filters/filter-sidebar.tsx @@ -1,4 +1,4 @@ -import * as React from 'react' +import * as React from 'react'; import FilterItem from './filter-item'; const FilterSidebar: React.FC = () => { @@ -8,28 +8,30 @@ const FilterSidebar: React.FC = () => { Filters
-
-
- Project Type +
+
+ Project Type +
+
+ + + +
-
- - - +
+
+ Languages +
+
+ + + +
-
-
- Languages -
-
- - - -
-
-
+ + ) } diff --git a/apps/ui/src/packages/ui/components/forms/inputs/SearchInput.tsx b/apps/ui/src/packages/ui/components/forms/inputs/SearchInput.tsx index 18c08aa..6bf297d 100644 --- a/apps/ui/src/packages/ui/components/forms/inputs/SearchInput.tsx +++ b/apps/ui/src/packages/ui/components/forms/inputs/SearchInput.tsx @@ -5,21 +5,26 @@ import { InputProps } from "./type"; import { GoSearch } from "react-icons/go"; export const SearchInput = React.forwardRef(function SearchInput( - { isFullWidth = true, ...props }, - ref + { isFullWidth = true, ...props }, + ref ) { - return ( -
- - {props.placeholder} -
- ); + return ( +
+ + +
+ ); });