Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 243 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"react-dom": "^18.2.0",
"react-router-dom": "^6.20.0",
"react-scripts": "5.0.1",
"react-select": "^5.8.0",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
26 changes: 21 additions & 5 deletions src/pages/dashboard/timeplace/AddTimePlaceForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import useToken from "../../../auth/Token";

// import { UserContext } from "./Auth/AuthContext";

import Select from 'react-select' // https://react-select.com/home


export function AddTimePlaceForm() {
const {token, setToken} = useToken()
console.log(token);
Expand All @@ -39,11 +42,23 @@ export function AddTimePlaceForm() {
}));
};

const handleSubmit = (e) => {
e.preventDefault();
// Here you would handle the submission to the backend
console.log(formData);
};
const handleSubmit = (e) => {
e.preventDefault();
// Here you would handle the submission to the backend
console.log(formData);
};

// TODO: get interests and activities from backend
const InterestOptions = [
{ value: 'chocolate', label: 'Chocolate' },
{ value: 'strawberry', label: 'Strawberry' },
{ value: 'vanilla', label: 'Vanilla' }
]

const InterestsList = () => (
<Select isMulti options={InterestOptions} />
)


return (
<div className="add-time-place-form-section">
Expand Down Expand Up @@ -96,6 +111,7 @@ export function AddTimePlaceForm() {
required
placeholder="Description"
/>
<InterestsList />
{/* Additional fields for interests and activities will depend on how you want to handle those, possibly with checkboxes or multi-select inputs */}
<button type="submit">Submit</button>
</form>
Expand Down