style: workspace and profile setting revamp (#2193)
* chore: custom theme mode svg added * style: workspace settings ui revamp * style: project settings and image upload modal improvement * style: profile setting ui revamp * chore: settings ui improvement and bug fixes
This commit is contained in:
parent
9bfdcff44d
commit
ccffbe1b4e
40 changed files with 1299 additions and 1072 deletions
|
|
@ -21,7 +21,6 @@ import {
|
|||
import { Loader, PrimaryButton } from "components/ui";
|
||||
// icons
|
||||
import { ArrowPathIcon } from "@heroicons/react/24/outline";
|
||||
import { ArrowRightIcon } from "components/icons";
|
||||
// types
|
||||
import { IImporterService } from "types";
|
||||
// fetch-keys
|
||||
|
|
@ -57,10 +56,10 @@ const IntegrationGuide = () => {
|
|||
data={importToDelete}
|
||||
user={user}
|
||||
/>
|
||||
<div className="h-full space-y-2">
|
||||
<div className="h-full">
|
||||
{(!provider || provider === "csv") && (
|
||||
<>
|
||||
<div className="mb-5 flex items-center gap-2">
|
||||
{/* <div className="mb-5 flex items-center gap-2">
|
||||
<div className="h-full w-full space-y-1">
|
||||
<div className="text-lg font-medium">Relocation Guide</div>
|
||||
<div className="text-sm">
|
||||
|
|
@ -78,85 +77,87 @@ const IntegrationGuide = () => {
|
|||
<ArrowRightIcon width={"18px"} color={"#3F76FF"} />
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
{IMPORTERS_EXPORTERS_LIST.map((service) => (
|
||||
<div
|
||||
key={service.provider}
|
||||
className="rounded-[10px] border border-custom-border-200 bg-custom-background-100 p-4"
|
||||
>
|
||||
<div className="flex items-center gap-4 whitespace-nowrap">
|
||||
<div className="relative h-10 w-10 flex-shrink-0">
|
||||
<Image
|
||||
src={service.logo}
|
||||
layout="fill"
|
||||
objectFit="cover"
|
||||
alt={`${service.title} Logo`}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<h3>{service.title}</h3>
|
||||
<p className="text-sm text-custom-text-200">{service.description}</p>
|
||||
</div>
|
||||
<div className="flex-shrink-0">
|
||||
<Link
|
||||
href={`/${workspaceSlug}/settings/imports?provider=${service.provider}`}
|
||||
>
|
||||
<a>
|
||||
<PrimaryButton>
|
||||
<span className="capitalize">{service.type}</span> now
|
||||
</PrimaryButton>
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div> */}
|
||||
{IMPORTERS_EXPORTERS_LIST.map((service) => (
|
||||
<div
|
||||
key={service.provider}
|
||||
className="flex items-center justify-between gap-2 border-b border-custom-border-200 bg-custom-background-100 px-4 py-6"
|
||||
>
|
||||
<div className="flex items-start gap-4">
|
||||
<div className="relative h-10 w-10 flex-shrink-0">
|
||||
<Image
|
||||
src={service.logo}
|
||||
layout="fill"
|
||||
objectFit="cover"
|
||||
alt={`${service.title} Logo`}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="flex items-center gap-4 text-sm font-medium">{service.title}</h3>
|
||||
<p className="text-sm text-custom-text-200 tracking-tight">
|
||||
{service.description}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="rounded-[10px] border border-custom-border-200 bg-custom-background-100 p-4">
|
||||
<h3 className="mb-2 flex gap-2 text-lg font-medium">
|
||||
Previous Imports
|
||||
<button
|
||||
type="button"
|
||||
className="flex flex-shrink-0 items-center gap-1 rounded bg-custom-background-80 py-1 px-1.5 text-xs outline-none"
|
||||
onClick={() => {
|
||||
setRefreshing(true);
|
||||
mutate(IMPORTER_SERVICES_LIST(workspaceSlug as string)).then(() =>
|
||||
setRefreshing(false)
|
||||
);
|
||||
}}
|
||||
>
|
||||
<ArrowPathIcon className={`h-3 w-3 ${refreshing ? "animate-spin" : ""}`} />{" "}
|
||||
{refreshing ? "Refreshing..." : "Refresh status"}
|
||||
</button>
|
||||
</h3>
|
||||
{importerServices ? (
|
||||
importerServices.length > 0 ? (
|
||||
<div className="space-y-2">
|
||||
<div className="divide-y divide-custom-border-200">
|
||||
{importerServices.map((service) => (
|
||||
<SingleImport
|
||||
key={service.id}
|
||||
service={service}
|
||||
refreshing={refreshing}
|
||||
handleDelete={() => handleDeleteImport(service)}
|
||||
/>
|
||||
))}
|
||||
<div className="flex-shrink-0">
|
||||
<Link href={`/${workspaceSlug}/settings/imports?provider=${service.provider}`}>
|
||||
<a>
|
||||
<PrimaryButton>
|
||||
<span className="capitalize">{service.type}</span>
|
||||
</PrimaryButton>
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
<div>
|
||||
<div className="flex items-center pt-7 pb-3.5 border-b border-custom-border-200">
|
||||
<h3 className="flex gap-2 text-xl font-medium">
|
||||
Previous Imports
|
||||
<button
|
||||
type="button"
|
||||
className="flex flex-shrink-0 items-center gap-1 rounded bg-custom-background-80 py-1 px-1.5 text-xs outline-none"
|
||||
onClick={() => {
|
||||
setRefreshing(true);
|
||||
mutate(IMPORTER_SERVICES_LIST(workspaceSlug as string)).then(() =>
|
||||
setRefreshing(false)
|
||||
);
|
||||
}}
|
||||
>
|
||||
<ArrowPathIcon className={`h-3 w-3 ${refreshing ? "animate-spin" : ""}`} />{" "}
|
||||
{refreshing ? "Refreshing..." : "Refresh status"}
|
||||
</button>
|
||||
</h3>
|
||||
</div>
|
||||
<div className="flex flex-col px-4 py-6">
|
||||
{importerServices ? (
|
||||
importerServices.length > 0 ? (
|
||||
<div className="space-y-2">
|
||||
<div className="divide-y divide-custom-border-200">
|
||||
{importerServices.map((service) => (
|
||||
<SingleImport
|
||||
key={service.id}
|
||||
service={service}
|
||||
refreshing={refreshing}
|
||||
handleDelete={() => handleDeleteImport(service)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<p className="py-2 text-sm text-custom-text-200">
|
||||
No previous imports available.
|
||||
</p>
|
||||
)
|
||||
) : (
|
||||
<p className="py-2 text-sm text-custom-text-200">
|
||||
No previous imports available.
|
||||
</p>
|
||||
)
|
||||
) : (
|
||||
<Loader className="mt-6 grid grid-cols-1 gap-3">
|
||||
<Loader.Item height="40px" width="100%" />
|
||||
<Loader.Item height="40px" width="100%" />
|
||||
<Loader.Item height="40px" width="100%" />
|
||||
<Loader.Item height="40px" width="100%" />
|
||||
</Loader>
|
||||
)}
|
||||
<Loader className="mt-6 grid grid-cols-1 gap-3">
|
||||
<Loader.Item height="40px" width="100%" />
|
||||
<Loader.Item height="40px" width="100%" />
|
||||
<Loader.Item height="40px" width="100%" />
|
||||
<Loader.Item height="40px" width="100%" />
|
||||
</Loader>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ type Props = {
|
|||
};
|
||||
|
||||
export const SingleImport: React.FC<Props> = ({ service, refreshing, handleDelete }) => (
|
||||
<div className="flex items-center justify-between gap-2 py-3">
|
||||
<div className="flex items-center justify-between gap-2 px-4 py-3">
|
||||
<div>
|
||||
<h4 className="flex items-center gap-2 text-sm">
|
||||
<span>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { DangerButton, Loader, PrimaryButton } from "components/ui";
|
|||
// icons
|
||||
import GithubLogo from "public/services/github.png";
|
||||
import SlackLogo from "public/services/slack.png";
|
||||
import { CheckCircle2 } from "lucide-react";
|
||||
// types
|
||||
import { IAppIntegration, IWorkspaceIntegration } from "types";
|
||||
// fetch-keys
|
||||
|
|
@ -27,13 +28,12 @@ type Props = {
|
|||
const integrationDetails: { [key: string]: any } = {
|
||||
github: {
|
||||
logo: GithubLogo,
|
||||
installed:
|
||||
"Activate GitHub integrations on individual projects to sync with specific repositories.",
|
||||
installed: "Activate GitHub on individual projects to sync with specific repositories.",
|
||||
notInstalled: "Connect with GitHub with your Plane workspace to sync project issues.",
|
||||
},
|
||||
slack: {
|
||||
logo: SlackLogo,
|
||||
installed: "Activate Slack integrations on individual projects to sync with specific channels.",
|
||||
installed: "Activate Slack on individual projects to sync with specific channels.",
|
||||
notInstalled: "Connect with Slack with your Plane workspace to sync project issues.",
|
||||
},
|
||||
};
|
||||
|
|
@ -99,31 +99,22 @@ export const SingleIntegrationCard: React.FC<Props> = ({ integration }) => {
|
|||
);
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-between gap-2 rounded-[10px] border border-custom-border-200 bg-custom-background-100 p-5">
|
||||
<div className="flex items-center justify-between gap-2 border-b border-custom-border-200 bg-custom-background-100 px-4 py-6">
|
||||
<div className="flex items-start gap-4">
|
||||
<div className="h-12 w-12 flex-shrink-0">
|
||||
<div className="h-10 w-10 flex-shrink-0">
|
||||
<Image
|
||||
src={integrationDetails[integration.provider].logo}
|
||||
alt={`${integration.title} Logo`}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="flex items-center gap-4 text-xl font-semibold">
|
||||
<h3 className="flex items-center gap-2 text-sm font-medium">
|
||||
{integration.title}
|
||||
{workspaceIntegrations ? (
|
||||
isInstalled ? (
|
||||
<span className="flex items-center gap-1 text-sm font-normal text-green-500">
|
||||
<span className="h-1.5 w-1.5 flex-shrink-0 rounded-full bg-green-500" /> Installed
|
||||
</span>
|
||||
) : (
|
||||
<span className="flex items-center gap-1 text-sm font-normal text-custom-text-200">
|
||||
<span className="h-1.5 w-1.5 flex-shrink-0 rounded-full bg-custom-background-80" />{" "}
|
||||
Not Installed
|
||||
</span>
|
||||
)
|
||||
) : null}
|
||||
{workspaceIntegrations
|
||||
? isInstalled && <CheckCircle2 className="h-3.5 w-3.5 text-white fill-green-500" />
|
||||
: null}
|
||||
</h3>
|
||||
<p className="text-sm text-custom-text-200">
|
||||
<p className="text-sm text-custom-text-200 tracking-tight">
|
||||
{workspaceIntegrations
|
||||
? isInstalled
|
||||
? integrationDetails[integration.provider].installed
|
||||
|
|
@ -135,12 +126,12 @@ export const SingleIntegrationCard: React.FC<Props> = ({ integration }) => {
|
|||
|
||||
{workspaceIntegrations ? (
|
||||
isInstalled ? (
|
||||
<DangerButton onClick={handleRemoveIntegration} loading={deletingIntegration}>
|
||||
{deletingIntegration ? "Removing..." : "Remove installation"}
|
||||
<DangerButton onClick={handleRemoveIntegration} loading={deletingIntegration} outline>
|
||||
{deletingIntegration ? "Uninstalling..." : "Uninstall"}
|
||||
</DangerButton>
|
||||
) : (
|
||||
<PrimaryButton onClick={startAuth} loading={isInstalling}>
|
||||
{isInstalling ? "Installing..." : "Add installation"}
|
||||
{isInstalling ? "Installing..." : "Install"}
|
||||
</PrimaryButton>
|
||||
)
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue