From 4ebec0d6cacc60af551cd65342e2540209e5c70c Mon Sep 17 00:00:00 2001 From: aajaleel <86304133+aajaleel@users.noreply.github.com> Date: Thu, 10 Aug 2023 13:28:33 -0400 Subject: [PATCH] [CIT-19] Update user profile (#48) * edit client and server components for user profile * user profile successfully updating * bug fixes * CIT-19: fix refresh, text boxes, api, profile display * Trigger build * CIT-19: bugfix Co-authored-by: Ishaan Upadhyay * Trigger build * add pricing * [CIT-19] Visual improvements * [CIT-19] Bugfix --------- Co-authored-by: Daniel Co-authored-by: Ishaan Co-authored-by: Ishaan Upadhyay Co-authored-by: Ishaan Upadhyay <33141569+ishaan-upadhyay@users.noreply.github.com> --- citrus/app/(users)/layout.tsx | 2 +- .../app/(users)/profile/UserProfileClient.tsx | 126 +++++++++++++++ .../app/(users)/profile/UserProfileServer.tsx | 26 +++ citrus/app/(users)/profile/page.tsx | 32 ++++ citrus/app/(users)/profile/profile.module.css | 81 ++++++++++ citrus/app/api/users/[id]/route.ts | 9 +- citrus/app/api/users/route.ts | 26 +-- citrus/package-lock.json | 148 ++++++++++++------ citrus/package.json | 1 + 9 files changed, 386 insertions(+), 65 deletions(-) create mode 100644 citrus/app/(users)/profile/UserProfileClient.tsx create mode 100644 citrus/app/(users)/profile/UserProfileServer.tsx create mode 100644 citrus/app/(users)/profile/page.tsx create mode 100644 citrus/app/(users)/profile/profile.module.css diff --git a/citrus/app/(users)/layout.tsx b/citrus/app/(users)/layout.tsx index 985ca54..10fd844 100644 --- a/citrus/app/(users)/layout.tsx +++ b/citrus/app/(users)/layout.tsx @@ -43,7 +43,7 @@ export default async function RootLayout({ Experiences
  • - About + Profile
  • Chats diff --git a/citrus/app/(users)/profile/UserProfileClient.tsx b/citrus/app/(users)/profile/UserProfileClient.tsx new file mode 100644 index 0000000..51a47cf --- /dev/null +++ b/citrus/app/(users)/profile/UserProfileClient.tsx @@ -0,0 +1,126 @@ +"use client"; +import { FormEvent, useState, useEffect } from 'react'; +import { useSession } from 'next-auth/react'; +import { useRouter } from "next/navigation"; +import '@/lib/patch' + +async function updateUserProfile(data: any) { + try { + const res = await fetch(`/api/users`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(data), + }); + + if (res.ok) { + console.log('Profile updated successfully!'); + } else { + console.error('Failed to update profile:', res.status); + } + } catch (error) { + console.error('An error occurred while updating the profile:', error); + } +} + +export default function UserProfileClient() { + const { data: session } = useSession(); + + const [phoneNumber, setPhoneNumber] = useState(''); + const [instagram, setInstagram] = useState(''); + const [facebook, setFacebook] = useState(''); + const [interest, setInterest] = useState(''); // Separate state for individual interest + const [interests, setInterests] = useState([]); // State to store all interests + + const handleInterestChange = (e: React.ChangeEvent) => { + setInterest(e.target.value); + }; + + const handleAddInterest = () => { + if (interest.trim() !== '') { + setInterests([...interests, interest.trim()]); // Add the new interest to the interests array + setInterest(''); // Clear the individual interest state + } + }; + + const handleRemoveInterest = (index: number) => { + const updatedInterests = interests.filter((_, i) => i !== index); + setInterests(updatedInterests); + }; + + const handleSubmit = async (e: FormEvent) => { + e.preventDefault(); + + // Assuming you have a user ID in userData + const updatedData = { + username: session?.user?.name, + phone_number: phoneNumber == "" ? undefined : phoneNumber, + instagram: instagram == "" ? undefined : instagram, + facebook: facebook == "" ? undefined : facebook, + interests: interests.length == 0 ? undefined : interests, // Use the interests array in the updated data + }; + + await updateUserProfile(updatedData); + router.refresh(); + }; + + const router = useRouter(); + + return ( + <> +

    + Edit Profile +

    +
    +
    + +
    + setPhoneNumber(e.target.value)} /> +
    +
    + +
    + setInstagram(e.target.value)} /> +
    +
    + + setFacebook(e.target.value)} /> +
    +
    + +
    + + +
    +
    +
      + {interests.map((item, index) => ( +
    • + {item}{' '} + +
    • + ))} +
    + +
    + + ); +} \ No newline at end of file diff --git a/citrus/app/(users)/profile/UserProfileServer.tsx b/citrus/app/(users)/profile/UserProfileServer.tsx new file mode 100644 index 0000000..4889278 --- /dev/null +++ b/citrus/app/(users)/profile/UserProfileServer.tsx @@ -0,0 +1,26 @@ +import { getServerSession } from 'next-auth/next'; +import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import '@/lib/patch' + +export default async function UserProfileServer(){ + + const session = await getServerSession(authOptions); + + if(!session) return

    You're not signed in.

    + + const res = await fetch(process.env.BASE_API_URL + `api/users/${session.user?.name}`); + const userData = await res.json(); + + if (!userData) return

    Loading user data...

    ; + + return ( +
    +

    Name: {userData.username}

    +

    Email: {userData.email}

    +

    Phone Number: {userData.phone_number}

    +

    Instagram: {userData.instagram}

    +

    Facebook: {userData.facebook}

    +

    Interests: {userData.interests && userData.interests.length > 0 ? userData.interests.join(", ") : ""}

    +
    + ); +} diff --git a/citrus/app/(users)/profile/page.tsx b/citrus/app/(users)/profile/page.tsx new file mode 100644 index 0000000..c14f555 --- /dev/null +++ b/citrus/app/(users)/profile/page.tsx @@ -0,0 +1,32 @@ +// App.tsx +import { getServerSession } from 'next-auth/next'; +import { authOptions } from '@/app/api/auth/[...nextauth]/route'; +import { useState, useEffect } from 'react'; +import UserProfileServer from './UserProfileServer'; +import UserProfileClient from './UserProfileClient'; +import styles from './profile.module.css'; + +export default async function Page() { + + const session = await getServerSession(authOptions); + if (!session) + return

    You're not signed in.

    ; + +return ( + +
    + {/* Big Header */} +

    User Profile

    + +
    +
    + {/* @ts-expect-error Server Component */} + +
    +
    + +
    +
    +
    + ); + } diff --git a/citrus/app/(users)/profile/profile.module.css b/citrus/app/(users)/profile/profile.module.css new file mode 100644 index 0000000..00739ec --- /dev/null +++ b/citrus/app/(users)/profile/profile.module.css @@ -0,0 +1,81 @@ +.custom-heading { + font-size: 40px; + } + + .custom-background { + background-color: rgb(0, 0, 0); + } + + .custom-avatar { + width: 100px; + height: 100px; + display: flex; + align-items: center; /* Vertically align the avatar */ + justify-content: center; /* Horizontally align the avatar */ + } + + .custom-input { + border: 1px solid #ccc; + padding: 0.5rem; + border-radius: 4px; + margin-bottom: 1rem; + color: black; + width: 300px; + } + .custom-box { + border: 1px solid #ccc; + padding: 3rem; + border-radius: 4px; + margin-bottom: 1rem; + margin: 20px; /* Add a margin of 20px around the custom-box */ + background-color: rgb(37, 99, 235); + display: flex; /* Display the container as a flex container */ + flex-direction: column; /* Stack the content vertically */ + align-items: center; /* Center the content horizontally */ + justify-content: center; /* Center the content vertically */ + /* Add the following CSS properties to prevent horizontal growth */ + flex-wrap: wrap; /* Allow content to wrap to the next line */ + max-width: 100%; /* Limit the maximum width of the container */ + + /* height: 100%; */ + } + .custom-acc-button { + border: 1px solid #ccc; + padding: 0.5rem; + border-radius: 4px; + } + + .custom-box-content { + flex-grow: 1; /* Ensure the content expands to fill the box */ + } + + .custom-box-footer { + margin-top: 1rem; /* Add some space above the footer */ + } + + .custom-avatar-container { + display: flex; + justify-content: center; + align-items: center; + height: 100%; + } + + .custombox2{ + border: 1px solid #ccc; + padding: 1rem; + border-radius: 50px; + margin-bottom: 1rem; + margin: 20px; /* Add a margin of 20px around the custom-box */ + + display: flex; /* Display the container as a flex container */ + flex-direction: column; /* Stack the content vertically */ + align-items: center; /* Center the content horizontally */ + justify-content: center; /* Center the content vertically */ + /* Add the following CSS properties to prevent horizontal growth */ +flex-wrap: wrap; /* Allow content to wrap to the next line */ +max-width: 100%; /* Limit the maximum width of the container */ +} + +.blackText { + color: black; +} \ No newline at end of file diff --git a/citrus/app/api/users/[id]/route.ts b/citrus/app/api/users/[id]/route.ts index 98e9452..7af8c18 100644 --- a/citrus/app/api/users/[id]/route.ts +++ b/citrus/app/api/users/[id]/route.ts @@ -1,5 +1,6 @@ import * as db from '@/lib/db' import { NextResponse } from 'next/server'; +import '@/lib/patch' const prisma = db.getClient(); @@ -19,10 +20,8 @@ const prisma = db.getClient(); * "username": "sampleUsername", * "email": "sampleEmail@mail.com", * "phone_number": "16471234567", - * "socials": [ - * "https://www.instagram.com/sampleUsername/", - * "https://www.facebook.com/sampleUsername/" - * ], + * "instagram": "https://www.instagram.com/sampleUsername/", + * "facebook": "https://www.facebook.com/sampleUsername/" * "premium": true, * "experiences": [] * } @@ -32,10 +31,12 @@ export async function GET(request: Request, { params }: { params: { id: string } let select = { username: true, + phone_number: true, email: true, instagram: true, facebook: true, premium: true, + interests: true, experiences: true }; diff --git a/citrus/app/api/users/route.ts b/citrus/app/api/users/route.ts index 3b3428e..e99b1de 100644 --- a/citrus/app/api/users/route.ts +++ b/citrus/app/api/users/route.ts @@ -34,7 +34,9 @@ schema * @apiSuccess {String} users.username The username of the user * @apiSuccess {String} users.email The email of the user * @apiSuccess {String} users.phone_number The phone number of the user - * @apiSuccess {String[]} users.socials The social media links of the user + * @apiSuccess {String} users.instagram The instagram link of the user + * @apiSuccess {String} users.facebook The facebook link of the user + * @apiSuccess {Boolean} users.premium Whether the user is a premium user * * @apiSuccessExample Success-Response: @@ -48,10 +50,8 @@ schema * "username": "sampleUsername", * "email": "sampleEmail@mail.com", * "phone_number": "16471234567", - * "socials": [ - * "https://www.instagram.com/sampleUsername/", - * "https://www.facebook.com/sampleUsername/" - * ], + * "instagram": "https://www.instagram.com/sampleUsername/", + * "facebook": "https://www.facebook.com/sampleUsername/" * "premium": true * } * ] @@ -108,9 +108,11 @@ schema username: true, email: true, premium: true, + phone_number: true, instagram: true, facebook: true, - experiences: true + experiences: true, + interests: true, }; try { @@ -208,7 +210,9 @@ schema * @apiParam {String} email The email of the user * @apiParam {Boolean} premium Whether the user is a premium user * @apiParam {String} phone_number The phone number of the user - * @apiParam {String[]} socials The social media links of the user + * @apiParam {String} instagram The instagram link of the user + * @apiParam {String} facebook The facebook link of the user + * * @apiSuccess {String} username The username of the user * @apiSuccess {String} message The message indicating the success of the request @@ -235,7 +239,9 @@ export async function PUT(request: Request) { const email = body.email; const premium = body.premium; const phone_number = body.phone_number; - //const socials = body.socials; + const instagram = body.instagram; + const facebook = body.facebook; + const interests = body.interests; if (password !== undefined) { if (!schema.validate(password)) { @@ -251,7 +257,9 @@ export async function PUT(request: Request) { email: email, premium: premium, phone_number: phone_number, - //socials: socials + instagram: instagram, + facebook: facebook, + interests: interests, } try { diff --git a/citrus/package-lock.json b/citrus/package-lock.json index 4b5231f..691e59f 100644 --- a/citrus/package-lock.json +++ b/citrus/package-lock.json @@ -42,6 +42,7 @@ "react-datepicker": "^4.16.0", "react-dom": "18.2.0", "react-icons": "^4.9.0", + "react-select": "^5.7.4", "react-infinite-scroll-component": "^6.1.0", "request": "^2.88.2", "streamsearch": "^1.1.0", @@ -137,7 +138,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", - "peer": true, "dependencies": { "@babel/highlight": "^7.22.5" }, @@ -149,7 +149,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", - "peer": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -161,7 +160,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -170,7 +168,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -179,7 +176,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "peer": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", @@ -193,7 +189,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "peer": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -205,7 +200,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "peer": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -219,7 +213,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "peer": true, "dependencies": { "color-name": "1.1.3" } @@ -227,14 +220,12 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "peer": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "peer": true, "engines": { "node": ">=0.8.0" } @@ -243,7 +234,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "peer": true, "engines": { "node": ">=4" } @@ -252,7 +242,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "peer": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -275,7 +264,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", - "peer": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -1439,7 +1427,6 @@ "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", - "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", @@ -1458,7 +1445,6 @@ "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", - "peer": true, "dependencies": { "@emotion/memoize": "^0.8.1", "@emotion/sheet": "^1.2.2", @@ -1470,8 +1456,7 @@ "node_modules/@emotion/hash": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", - "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==", - "peer": true + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" }, "node_modules/@emotion/is-prop-valid": { "version": "1.2.1", @@ -1485,14 +1470,12 @@ "node_modules/@emotion/memoize": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", - "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==", - "peer": true + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" }, "node_modules/@emotion/react": { "version": "11.11.1", "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz", "integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -1516,7 +1499,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.2.tgz", "integrity": "sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==", - "peer": true, "dependencies": { "@emotion/hash": "^0.9.1", "@emotion/memoize": "^0.8.1", @@ -1528,8 +1510,7 @@ "node_modules/@emotion/sheet": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", - "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==", - "peer": true + "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" }, "node_modules/@emotion/styled": { "version": "11.11.0", @@ -1557,14 +1538,12 @@ "node_modules/@emotion/unitless": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", - "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==", - "peer": true + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" }, "node_modules/@emotion/use-insertion-effect-with-fallbacks": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz", "integrity": "sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==", - "peer": true, "peerDependencies": { "react": ">=16.8.0" } @@ -1572,14 +1551,12 @@ "node_modules/@emotion/utils": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", - "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==", - "peer": true + "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" }, "node_modules/@emotion/weak-memoize": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", - "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==", - "peer": true + "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", @@ -1633,6 +1610,19 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.3.1.tgz", + "integrity": "sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g==" + }, + "node_modules/@floating-ui/dom": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.4.5.tgz", + "integrity": "sha512-96KnRWkRnuBSSFbj0sFGwwOUd8EkiecINVl0O9wiZlZ64EkpyAOG3Xc2vKKNJmru0Z7RqWNymA+6b8OZqjgyyw==", + "dependencies": { + "@floating-ui/core": "^1.3.1" + } + }, "node_modules/@fortawesome/fontawesome-common-types": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.0.tgz", @@ -2158,8 +2148,7 @@ "node_modules/@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "peer": true + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" }, "node_modules/@types/prop-types": { "version": "15.7.5", @@ -2195,6 +2184,14 @@ "@types/react": "*" } }, + "node_modules/@types/react-transition-group": { + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.6.tgz", + "integrity": "sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/responselike": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", @@ -2827,7 +2824,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", - "peer": true, "dependencies": { "@babel/runtime": "^7.12.5", "cosmiconfig": "^7.0.0", @@ -3248,8 +3244,7 @@ "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "peer": true + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "node_modules/cookie": { "version": "0.5.0", @@ -3276,7 +3271,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", - "peer": true, "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", @@ -3292,7 +3286,6 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "peer": true, "engines": { "node": ">= 6" } @@ -3563,6 +3556,15 @@ "node": ">=6.0.0" } }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -3606,7 +3608,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "peer": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -4235,8 +4236,7 @@ "node_modules/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "peer": true + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" }, "node_modules/find-up": { "version": "5.0.0", @@ -4770,7 +4770,6 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "peer": true, "dependencies": { "react-is": "^16.7.0" } @@ -4923,8 +4922,7 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "peer": true + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, "node_modules/is-bigint": { "version": "1.0.4", @@ -5318,8 +5316,7 @@ "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "peer": true + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" }, "node_modules/json-schema": { "version": "0.4.0", @@ -5503,6 +5500,11 @@ "semver": "bin/semver.js" } }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -6166,7 +6168,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "peer": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -6797,6 +6798,26 @@ } } }, + "node_modules/react-select": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.4.tgz", + "integrity": "sha512-NhuE56X+p9QDFh4BgeygHFIvJJszO1i1KSkg/JPcIJrbovyRtI+GuOEa4XzFCEpZRAEoEI8u/cAHK+jG/PgUzQ==", + "dependencies": { + "@babel/runtime": "^7.12.0", + "@emotion/cache": "^11.4.0", + "@emotion/react": "^11.8.1", + "@floating-ui/dom": "^1.0.1", + "@types/react-transition-group": "^4.4.0", + "memoize-one": "^6.0.0", + "prop-types": "^15.6.0", + "react-transition-group": "^4.3.0", + "use-isomorphic-layout-effect": "^1.1.2" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-style-singleton": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz", @@ -6819,6 +6840,21 @@ } } }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -7220,7 +7256,6 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -7436,8 +7471,7 @@ "node_modules/stylis": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", - "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", - "peer": true + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" }, "node_modules/sucrase": { "version": "3.32.0", @@ -7629,7 +7663,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "peer": true, "engines": { "node": ">=4" } @@ -7854,6 +7887,19 @@ } } }, + "node_modules/use-isomorphic-layout-effect": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz", + "integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/use-sidecar": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz", diff --git a/citrus/package.json b/citrus/package.json index b84d773..c518677 100644 --- a/citrus/package.json +++ b/citrus/package.json @@ -43,6 +43,7 @@ "react-datepicker": "^4.16.0", "react-dom": "18.2.0", "react-icons": "^4.9.0", + "react-select": "^5.7.4", "react-infinite-scroll-component": "^6.1.0", "request": "^2.88.2", "streamsearch": "^1.1.0",