Skip to content

Commit

Permalink
Merge pull request #27 from hive-one/basecamp-fixes
Browse files Browse the repository at this point in the history
more profile page and editing fixes
  • Loading branch information
rishimohan authored Nov 1, 2023
2 parents d231883 + 30f6dbc commit 4e0bd77
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 35 deletions.
1 change: 1 addition & 0 deletions apps/web/components/edit-profile/Account/BooksSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const BooksSection = ({ profile, setProfile, addBook, removeBook }) => {
<div className="col-span-2">
<Label>ISBN</Label>
<Input
required
label="ISBN"
placeholder="Enter book's ISBN e.g 9780471696483"
value={book.isbn}
Expand Down
2 changes: 2 additions & 0 deletions apps/web/components/edit-profile/Account/Experience.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Experience = ({ profile, setProfile, addExperience, removeExperience, remo
<div className="sm:col-span-3">
<Label>Company/Institution</Label>
<Input
required
value={company.name}
onChange={(e) => {
const newExperience = profile.experience;
Expand Down Expand Up @@ -71,6 +72,7 @@ const Experience = ({ profile, setProfile, addExperience, removeExperience, remo
<div className="sm:col-span-3">
<Label>Role/Title</Label>
<Input
required
label="Role/Title"
value={role.title}
onChange={(e) => {
Expand Down
6 changes: 3 additions & 3 deletions apps/web/components/edit-profile/Account/LinkedinImporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ const LinkedinImporter = ({ setProfile }) => {
className={!isValidLinkedInUrl(linkedinUrl) && "cursor-not-allowed opacity-50"}
loading={loading}
onClick={() => handleSubmit(linkedinUrl, setLoading, setLinkedinData)}>
Start Importing
Fetch profile
</Button>
</div>
<br />
<hr />
{linkedinData && linkedinData?.name && (
<div className="mt-4">
<p className="mb-4 font-mono text-sm">
Linkeding profile data available, click the button below to prefill the form.
LinkedIn profile data available, click the button below to prefill the form.
</p>
<Button type="button" variant="primary" onClick={startAutoFill}>
Confirm and Save
Add LinkedIn Data to Profile
</Button>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const PodcastAppearancesSection = ({
<div className="col-span-full">
<Label>Title</Label>
<Input
required
placeholder="e.g State of the web 2021"
value={appearance.title}
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const ProjectsSection = ({ profile, setProfile, addProject, removeProject }) =>
<div className="sm:col-span-3">
<Label>Title</Label>
<Input
required
placeholder="e.g Social media app for private circles"
value={project.title}
onChange={(e) => {
Expand Down
2 changes: 2 additions & 0 deletions apps/web/components/edit-profile/Account/VideosSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const VideosSection = ({ profile, setProfile, addVideo, removeVideo }) => {
<div className="col-span-full">
<Label>Title</Label>
<Input
required
value={video.title}
placeholder="Enter video title"
onChange={(e) => {
Expand All @@ -31,6 +32,7 @@ const VideosSection = ({ profile, setProfile, addVideo, removeVideo }) => {
<div className="col-span-2">
<Label>URL</Label>
<Input
required
value={video.url}
placeholder="e.g https://youtube.com/watch?v=1234"
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ const UserProfile = () => {
const telemetry = useTelemetry();
const [firstRender, setFirstRender] = useState(true);

const linksMutation = trpc.viewer.updateLinks.useMutation({});

const mutation = trpc.viewer.updateProfile.useMutation({
onSuccess: async (_data, context) => {
if (context.avatar) {
Expand Down Expand Up @@ -86,7 +84,7 @@ const UserProfile = () => {
const payload = {
bio: data?.bio,
adviceOn: data?.advises,
pricePerHour: data?.pricePerHour,
pricePerHour: data?.pricePerHour?.value,
completedOnboarding: true,
};

Expand All @@ -95,7 +93,6 @@ const UserProfile = () => {
telemetry.event(telemetryEventTypes.onboardingFinished);

mutation.mutate(payload);
linksMutation.mutate(data?.socialLinks);
});

async function updateProfileHandler(event) {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class MyDocument extends Document<Props> {
</Head>

<body
className="dark:bg-darkgray-50 desktop-transparent bg-subtle antialiased"
className="dark:bg-darkgray-50 desktop-transparent bg-white antialiased"
style={
isEmbed
? {
Expand Down
5 changes: 2 additions & 3 deletions apps/web/pages/edit-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const EditProfile = () => {
};

useEffect(() => {
setProfile((prev) => ({ ...prev, experience: transformExpForUI(profile) }));
setProfile((prev) => ({ ...prev, experience: transformExpForUI(user) }));
}, [user]);

const mutation = trpc.viewer.updateProfile.useMutation({
Expand Down Expand Up @@ -722,7 +722,7 @@ const EditProfile = () => {
<div className="my-5 md:my-20">
<Container width="960px" className="">
<div className="grid items-start md:grid-cols-[200px_1fr] md:gap-12">
<div className="flex h-[calc(100vh-200px)] max-w-full flex-row flex-nowrap gap-2 overflow-scroll whitespace-nowrap md:sticky md:top-[100px] md:flex-col md:gap-1 md:whitespace-normal">
<div className="flex h-[calc(100vh-100px)] max-w-full flex-row flex-nowrap gap-2 overflow-scroll whitespace-nowrap md:sticky md:top-[100px] md:flex-col md:gap-1 md:whitespace-normal">
{SETTINGS?.map((item) => (
<div key={item?.value} className="pb-3 md:w-full md:pb-0">
<Button
Expand Down Expand Up @@ -811,7 +811,6 @@ export const getServerSideProps = async (context) => {
return {
props: {
trpcState: ssr.dehydrate(),
user: JSON.stringify(user),
},
};
};
Expand Down
9 changes: 8 additions & 1 deletion apps/web/ui/valery/podcast-item.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Microphone } from "@phosphor-icons/react";
import Link from "next/link";

import ExternalLinkIcon from "../../ui/icons/external-link-icon";

const PodcastItem = ({ podcast }) => {
return (
Expand All @@ -18,8 +21,12 @@ const PodcastItem = ({ podcast }) => {
</div>
)}
</div>
<div className="flex-col justify-between space-y-3 sm:flex sm:space-y-0">
<div className="flex-col space-y-3 sm:flex sm:space-y-0">
<p className="font-semibold">{podcast?.title}</p>
<Link href={podcast?.url || "/"} className="mt-2 text-sm text-gray-400 hover:underline">
link
<ExternalLinkIcon className="mt-0.5 inline-block align-top text-gray-300" />
</Link>
{/* <p className="text-gray-500">Recent episodes:</p>
{podcast?.episodes?.length > 0 &&
podcast?.episodes.map((episode, i) => (
Expand Down
43 changes: 23 additions & 20 deletions apps/web/ui/valery/project-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@ import Link from "next/link";

import ExternalLinkIcon from "../../ui/icons/external-link-icon";

const Project = ({ title, description, url }) => (
<div className="inline-block w-full">
<div className="mb-7 flex w-full flex-col">
<div className="flex">
<Link
href={url || "/"}
target="_blank"
className="font-semibold decoration-gray-400 underline-offset-4 hover:underline">
{title}
<span className="whitespace-nowrap">
{"\u2009"}
<ExternalLinkIcon className="mt-0.5 inline-block align-top text-gray-300" />
</span>
</Link>
const Project = ({ title, description, url }) => {
if (!title) return "";
return (
<div className="inline-block w-full">
<div className="mb-7 flex w-full flex-col">
<div className="flex">
<Link
href={url || "/"}
target="_blank"
className="font-semibold decoration-gray-400 underline-offset-4 hover:underline">
{title}
<span className="whitespace-nowrap">
{"\u2009"}
<ExternalLinkIcon className="mt-0.5 inline-block align-top text-gray-300" />
</span>
</Link>
</div>
{description && (
<div className="prose max-w-none break-words" dangerouslySetInnerHTML={{ __html: description }} />
)}
<div className="flex flex-row items-center justify-between gap-4 self-start text-gray-400" />
</div>
{description && (
<div className="prose max-w-none break-words" dangerouslySetInnerHTML={{ __html: description }} />
)}
<div className="flex flex-row items-center justify-between gap-4 self-start text-gray-400" />
</div>
</div>
);
);
};

export default Project;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"vitest-mock-extended": "^1.1.3"
},
"dependencies": {
"@prisma/client": "latest",
"@tiptap/extension-link": "^2.1.11",
"@tiptap/pm": "^2.1.11",
"@tiptap/react": "^2.1.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"@calcom/lib": "*",
"@prisma/client": "^5.2.0",
"@prisma/client": "5.2.0",
"@prisma/extension-accelerate": "^0.6.2",
"@prisma/generator-helper": "^5.2.0",
"prisma": "^5.2.0",
Expand Down
26 changes: 24 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3673,7 +3673,7 @@ __metadata:
resolution: "@calcom/prisma@workspace:packages/prisma"
dependencies:
"@calcom/lib": "*"
"@prisma/client": ^5.2.0
"@prisma/client": 5.2.0
"@prisma/extension-accelerate": ^0.6.2
"@prisma/generator-helper": ^5.2.0
npm-run-all: ^4.1.5
Expand Down Expand Up @@ -7428,7 +7428,7 @@ __metadata:
languageName: node
linkType: hard

"@prisma/client@npm:^5.2.0":
"@prisma/client@npm:5.2.0":
version: 5.2.0
resolution: "@prisma/client@npm:5.2.0"
dependencies:
Expand All @@ -7442,6 +7442,20 @@ __metadata:
languageName: node
linkType: hard

"@prisma/client@npm:latest":
version: 5.5.2
resolution: "@prisma/client@npm:5.5.2"
dependencies:
"@prisma/engines-version": 5.5.1-1.aebc046ce8b88ebbcb45efe31cbe7d06fd6abc0a
peerDependencies:
prisma: "*"
peerDependenciesMeta:
prisma:
optional: true
checksum: 71ac5830041106070744645b882aa3270b8fb2d4a6bdf844c5e936543b2fccc3a6939e2ce47a5aad07f5c958e97ade06b7843a6664d8c9038403a357d04c5f88
languageName: node
linkType: hard

"@prisma/debug@npm:3.8.1":
version: 3.8.1
resolution: "@prisma/debug@npm:3.8.1"
Expand Down Expand Up @@ -7471,6 +7485,13 @@ __metadata:
languageName: node
linkType: hard

"@prisma/engines-version@npm:5.5.1-1.aebc046ce8b88ebbcb45efe31cbe7d06fd6abc0a":
version: 5.5.1-1.aebc046ce8b88ebbcb45efe31cbe7d06fd6abc0a
resolution: "@prisma/engines-version@npm:5.5.1-1.aebc046ce8b88ebbcb45efe31cbe7d06fd6abc0a"
checksum: bd0a1dd20f9c69526099800a9b1870ab5969ad8da728e3cec676b826f5d7e8751e118486901bde2f14f4edce02e98a26da1ad93560c4b51ec38be3356b1b6913
languageName: node
linkType: hard

"@prisma/engines@npm:5.2.0":
version: 5.2.0
resolution: "@prisma/engines@npm:5.2.0"
Expand Down Expand Up @@ -15590,6 +15611,7 @@ __metadata:
"@changesets/cli": ^2.26.1
"@deploysentinel/playwright": ^0.3.3
"@playwright/test": ^1.31.2
"@prisma/client": latest
"@snaplet/copycat": ^0.3.0
"@testing-library/jest-dom": ^5.16.5
"@tiptap/extension-link": ^2.1.11
Expand Down

0 comments on commit 4e0bd77

Please sign in to comment.