Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add contributor's insight on the workspace. #4060

Merged
17 changes: 16 additions & 1 deletion components/Workspaces/WorkspaceHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { SquareFillIcon } from "@primer/octicons-react";
import { FaEdit } from "react-icons/fa";
import { FiCopy } from "react-icons/fi";
import { usePostHog } from "posthog-js/react";
import Link from "next/link";
import { HiOutlineUsers } from "react-icons/hi2";
import Button from "components/shared/Button/button";
import useSupabaseAuth from "lib/hooks/useSupabaseAuth";
import { shortenUrl } from "lib/utils/shorten-url";
Expand All @@ -12,9 +14,11 @@ import { writeToClipboard } from "lib/utils/write-to-clipboard";
interface WorkspaceHeaderProps {
workspace: Workspace;
children?: React.ReactNode;
title: string;
url: string;
}

export const WorkspaceHeader = ({ workspace, children }: WorkspaceHeaderProps) => {
export const WorkspaceHeader = ({ workspace, children, title, url }: WorkspaceHeaderProps) => {
const { toast } = useToast();
const posthog = usePostHog();
const { userId } = useSupabaseAuth();
Expand Down Expand Up @@ -47,6 +51,17 @@ export const WorkspaceHeader = ({ workspace, children }: WorkspaceHeaderProps) =
</h1>
<div className="flex gap-2 justify-end">
nickytonline marked this conversation as resolved.
Show resolved Hide resolved
{children}

<Link
href={`/workspaces/${workspace.id}/contributor-insights`}
className="my-auto gap-2 items-center shrink-0 place-self-end bg-orange-50 text-[#ed5f00] font-inter font-semibold hover:bg-orange-100 text-[14px] px-4 py-2 rounded-md transition-colors duration-200"
>
<span className="flex gap-2 items-center">
<HiOutlineUsers />
Contributor insights
</span>
</Link>

<Button
variant="outline"
onClick={copyUrlToClipboard}
Expand Down
70 changes: 0 additions & 70 deletions components/organisms/UserSettingsPage/coupon-form.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions components/organisms/UserSettingsPage/user-settings-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { validateTwitterUsername } from "lib/utils/validate-twitter-username";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "components/molecules/Dialog/dialog";
import { LanguageSwitch } from "components/shared/LanguageSwitch/language-switch";
import useSupabaseAuth from "lib/hooks/useSupabaseAuth";
import CouponForm from "./coupon-form";
import DeveloperPackForm from "./developer-pack-form";

interface UserSettingsPageProps {
Expand Down Expand Up @@ -453,8 +452,6 @@ const UserSettingsPage = ({ user }: UserSettingsPageProps) => {
setCoupon("verified");
}}
/>

{!coupon && <CouponForm refreshUser={mutate} />}
</div>
) : null}
</div>
Expand Down
Loading