Skip to content

Commit

Permalink
Add team size field
Browse files Browse the repository at this point in the history
  • Loading branch information
Willdotwhite committed Jan 23, 2024
1 parent 761ecbf commit a61e454
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/pages/home/components/common/CustomSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type ValueType<OptionType> = OptionType | OptionsType<OptionType> | null

export interface CustomSelectOption {
label: ReactNode;
value: string | undefined;
value: string | number | undefined;
}

interface CustomSelectProps extends FieldProps {
Expand Down
29 changes: 28 additions & 1 deletion ui/src/pages/mypost/MyPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import {Button} from "../../common/components/Button.tsx";
import {Field, Form, FormikProps} from "formik";
import {skills} from "../../common/models/skills.tsx";
import CustomSelect from "../home/components/common/CustomSelect.tsx";
import CustomSelect, {CustomSelectOption} from "../home/components/common/CustomSelect.tsx";
import {languages} from "../../common/models/languages.ts";
import {tools} from "../../common/models/engines.tsx";
import {timezones} from "../../common/models/timezones.ts";
Expand Down Expand Up @@ -42,6 +42,7 @@ export const MyPost: React.FC<{

<div className="c-form-block bg-black">
<FieldTimezones />
<FieldTeamSize />
</div>

<Button
Expand Down Expand Up @@ -158,4 +159,30 @@ const FieldTimezones: React.FC = () => {
</span>
</div>
)
}

const FieldTeamSize: React.FC = () => {

const teamSizes: CustomSelectOption[] = []
for (let i = 1; i <= 20; i++) {
teamSizes.push({label: i, value: i});
}

return (
<div>
<label htmlFor="size">How many people are in your team/group?</label>
<Field
name="size"
className="c-dropdown form-block__field"
options={teamSizes}
component={CustomSelect}
placeholder={"Select option(s)"}
isMulti={false}
/>

<span className="text-xs">
(Including you!)
</span>
</div>
)
}
2 changes: 1 addition & 1 deletion ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import react from '@vitejs/plugin-react-swc'
// https://vitejs.dev/config/
export default defineConfig(() => {
return {
envDir: "../",
// envDir: "../", // Uncomment this if you're running the UI outside of Dockerw
server: {
host: "0.0.0.0",
port: 3000,
Expand Down

0 comments on commit a61e454

Please sign in to comment.