2.0 Settings / My Account {View} (#3874)

* Fix breadcrumb colors

* HorizontalTabs

* Team List Item WIP

* Horizontal Tabs

* Cards

* Remove team list item WIP

* Login Page

* Add welcome back i118n

* EventType page work

* Update EventType Icons

* WIP Availability

* Horizontal Tab Work

* Add build command for in root

* Update build DIr/command

* Add Edit Button + change buttons to v2

* Availablitiy page

* Fix IPAD

* Make mobile look a little nicer

* WIP bookingshell

* Remove list items from breaking build

* Mian bulk of Booking Page.

* Few updates to components

* Fix chormatic feedback

* Fix banner

* Fix Empty Screen

* Text area + embded window fixes

* Semi fix avatar

* Troubleshoot container + Active on count

* Improve mobile

* NITS

* Fix padding on input

* Fix icons

* Starting to move event types settings to tabs

* Begin migration to single page form

* Single page tabs

* Limits Page

* Advanced tab

* Add RHF to dependancies

* Most of advanced tab

* Solved RHF mismtach

* Build fixes

* RHF conditionals fixes

* Improved legibility

* Major refactor/organisation into optional V2 UI

* Portal EditLocationModal

* Fix dialoug form

* Update imports

* Auto Animate + custom inputs WIP

* Custom Inputs

* WIP Apps

* Fixing stories imports

* Stripe app

* Remove duplicate dialog

* Remove duplicate dialog

* Fix embed URL

* Fix app toggles + number of active apps

* Fix container padding on disabledBorder prop

* Removes strict

* EventType Team page WIP

* Fix embed

* NIT

* Add Darkmode gray color

* V2 Shell WIP

* Create my account folder

* Add profile section

* Fix headings on shell V2

* Fix mobile layout with V2 shell

* V2 create event type button

* Checked Team Select

* Hidden to happen on save - not on toggle

* Team Attendee Select animation

* WIP

* Fix scheduling type and remove multi select label

* Fix overflow on teams url

* Finish profile fields

* Show toast on success

* General tab WIP

* Even Type move order handles

* Add switching of destination calendar

* List calendar and delete

* Render empty screenwhen no calendars

* Fix Embed TS errors

* Fix TS errors

* Fix Eslint errors

* Fix TS errors for UI

* Fix ESLINT error

* added SidebarCard for promo to v2 and storybook (#3906)

Co-authored-by: Julian Benegas <[email protected]>
Co-authored-by: Alan <[email protected]>
Co-authored-by: sean-brydon <[email protected]>

* Tooltip Provider - Wrapper due to dep upgrade

* public event type list darkmode

* V2 Color changes to public booking

* Remove unused component

* Fix typecheck

* Transfer to SSR

* Appearance screen made

* V2 image uploader

* WIP appearance page

* Remove unnecessary data from viewer.me

* Add profile translations

* Add translations to general page

* Add calendar switch

* Add calendar switch

* Add translations to appearance page

* Clean up conferencing page

* Settings sidebar fixes

* Updates middleware

* Update SettingsLayout.tsx

* Settings layout improvements

* Type fix

Co-authored-by: sean-brydon <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: zomars <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Julian Benegas <[email protected]>
Co-authored-by: Alan <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-08-25 18:11:41 -06:00
1 parent 11dc9c668e
commit 87cce8eab6
16 files changed
+1322 -29

No files matched your search

+2 -1
View File
@@ -135,7 +135,7 @@ const Layout = (props: LayoutProps) => {
</div>
<div className="flex h-screen overflow-hidden" data-testid="dashboard-shell">
<SideBarContainer />
{props.SidebarContainer || <SideBarContainer />}
<div className="flex w-0 flex-1 flex-col overflow-hidden">
<ImpersonatingBanner />
<MainContainer {...props} />
@@ -153,6 +153,7 @@ type LayoutProps = {
children: ReactNode;
CTA?: ReactNode;
large?: boolean;
SidebarContainer?: ReactNode;
HeadingLeftIcon?: ReactNode;
backPath?: string; // renders back button to specified path
// use when content needs to expand with flex
+22 -10
View File
@@ -2,6 +2,7 @@ import React, { ComponentProps } from "react";
import { Icon } from "../../../Icon";
import Shell from "../Shell";
import { VerticalTabItem } from "../navigation/tabs";
import VerticalTabs from "../navigation/tabs/VerticalTabs";
const tabs = [
@@ -10,12 +11,13 @@ const tabs = [
href: "/settings/profile",
icon: Icon.FiUser,
children: [
{ name: "profile", href: "/settings/profile" },
{ name: "general", href: "/settings/profile" },
{ name: "calendars", href: "/settings/profile" },
{ name: "conferencing", href: "/settings/profile" },
{ name: "appearance", href: "/settings/profile" },
{ name: "referrals", href: "/settings/profile" },
{ name: "profile", href: "/settings/my-account/profile" },
{ name: "general", href: "/settings/my-account/general" },
{ name: "calendars", href: "/settings/my-account/calendars" },
{ name: "conferencing", href: "/settings/my-account/conferencing" },
{ name: "appearance", href: "/settings/my-account/appearance" },
// TODO
{ name: "referrals", href: "/settings/my-account/referrals" },
],
},
{
@@ -72,10 +74,20 @@ export default function SettingsLayout({
...rest
}: { children: React.ReactNode } & ComponentProps<typeof Shell>) {
return (
<Shell {...rest}>
<div className="flex-grow-0 bg-gray-50 p-2">
<VerticalTabs tabs={tabs} />
</div>
<Shell
flexChildrenContainer
{...rest}
SidebarContainer={
<VerticalTabs tabs={tabs} className="py-3 pl-3">
<VerticalTabItem
name="Settings"
href="/"
icon={Icon.FiArrowLeft}
textClassNames="text-md font-medium leading-none text-black"
className="mb-1"
/>
</VerticalTabs>
}>
<div className="flex-1 [&>*]:flex-1">{children}</div>
</Shell>
);
@@ -14,6 +14,8 @@ export type VerticalTabItemProps = {
icon?: SVGComponent;
disabled?: boolean;
children?: VerticalTabItemProps[];
textClassNames?: string;
className?: string;
isChild?: boolean;
} & (
| {
@@ -59,19 +61,17 @@ const VerticalTabItem: FC<VerticalTabItemProps> = ({ name, href, tabName, info,
<a
onClick={onClick}
className={classNames(
isCurrent ? "bg-gray-200 text-gray-900" : "text-gray-600 hover:bg-gray-100",
"group flex h-14 w-64 flex-row items-center rounded-md px-3 py-[10px]",
props.textClassNames || "text-sm font-medium leading-none text-gray-600",
"group flex h-14 w-64 flex-row items-center rounded-md px-3 py-[10px] hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900",
props.disabled && "pointer-events-none !opacity-30",
(isChild || !props.icon) && "ml-9 mr-5 w-auto",
!info ? "h-9" : "h-14"
!info ? "h-9" : "h-14",
props.className
)}
aria-current={isCurrent ? "page" : undefined}>
{props.icon && <props.icon className="mr-[10px] h-[16px] w-[16px] self-start stroke-[2px]" />}
<div
className={classNames(
isCurrent ? "font-bold text-gray-900" : "text-gray-600 group-hover:text-gray-700"
)}>
<p className="text-sm font-medium leading-none">{t(name)}</p>
<div>
<p>{t(name)}</p>
{info && <p className="pt-1 text-xs font-normal">{t(info)}</p>}
</div>
{/* {isCurrent && (
@@ -4,17 +4,18 @@ import VerticalTabItem, { VerticalTabItemProps } from "./VerticalTabItem";
export interface NavTabProps {
tabs: VerticalTabItemProps[];
children?: React.ReactNode;
className?: string;
}
const NavTabs: FC<NavTabProps> = ({ tabs, ...props }) => {
const NavTabs: FC<NavTabProps> = ({ tabs, className = "", ...props }) => {
return (
<>
<nav className="no-scrollbar flex flex-col space-y-1" aria-label="Tabs" {...props}>
{tabs.map((tab, idx) => (
<VerticalTabItem {...tab} key={idx} />
))}
</nav>
</>
<nav className={`no-scrollbar flex flex-col space-y-1 ${className}`} aria-label="Tabs" {...props}>
{props.children}
{tabs.map((tab, idx) => (
<VerticalTabItem {...tab} key={idx} />
))}
</nav>
);
};
+72
View File
@@ -0,0 +1,72 @@
import Link from "next/link";
import { createElement } from "react";
import classNames from "@calcom/lib/classNames";
export function List(props: JSX.IntrinsicElements["ul"]) {
return (
<ul {...props} className={classNames("-mx-4 rounded-sm sm:mx-0 sm:overflow-hidden", props.className)}>
{props.children}
</ul>
);
}
export type ListItemProps = { expanded?: boolean } & ({ href?: never } & JSX.IntrinsicElements["li"]);
export function ListItem(props: ListItemProps) {
const { href, expanded, ...passThroughProps } = props;
const elementType = href ? "a" : "li";
const element = createElement(
elementType,
{
...passThroughProps,
className: classNames(
"items-center rounded-md bg-white min-w-0 flex-1 flex border-neutral-200 p-2 sm:mx-0 sm:p-8 md:border md:p-4 xl:mt-0",
expanded ? "my-2 border" : "border -mb-px last:mb-0",
props.className,
(props.onClick || href) && "hover:bg-neutral-50"
),
},
props.children
);
return href ? (
<Link passHref href={href}>
{element}
</Link>
) : (
element
);
}
export function ListItemTitle<TComponent extends keyof JSX.IntrinsicElements = "span">(
props: JSX.IntrinsicElements[TComponent] & { component?: TComponent }
) {
const { component = "span", ...passThroughProps } = props;
return createElement(
component,
{
...passThroughProps,
className: classNames("text-sm font-medium text-neutral-900 truncate", props.className),
},
props.children
);
}
export function ListItemText<TComponent extends keyof JSX.IntrinsicElements = "span">(
props: JSX.IntrinsicElements[TComponent] & { component?: TComponent }
) {
const { component = "span", ...passThroughProps } = props;
return createElement(
component,
{
...passThroughProps,
className: classNames("text-sm text-gray-500 truncate", props.className),
},
props.children
);
}
@@ -0,0 +1,54 @@
import { useState } from "react";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Icon } from "@calcom/ui";
import { Button } from "@calcom/ui/v2/core/Button";
import { Dialog, DialogTrigger, DialogContent } from "@calcom/ui/v2/core/Dialog";
import showToast from "@calcom/ui/v2/core/notfications";
export default function DisconnectIntegration({
credentialId,
label,
trashIcon,
isGlobal,
}: {
credentialId: number;
label: string;
trashIcon?: boolean;
isGlobal?: boolean;
}) {
const { t } = useLocale();
const [modalOpen, setModalOpen] = useState(false);
const mutation = trpc.useMutation("viewer.deleteCredential", {
onSuccess: () => {
showToast("Integration deleted successfully", "success");
setModalOpen(false);
},
onError: () => {
showToast("Error deleting app", "error");
setModalOpen(false);
},
});
return (
<>
<Dialog open={modalOpen} onOpenChange={setModalOpen}>
<DialogTrigger asChild>
<Button color="destructive" StartIcon={trashIcon ? Icon.FiTrash : undefined} disabled={isGlobal}>
{label}
</Button>
</DialogTrigger>
<DialogContent
title="Remove app"
description="Are you sure you want to remove this app?"
type="confirmation"
actionText="Yes, remove app"
Icon={Icon.FiAlertCircle}
actionOnClick={() => mutation.mutate({ id: credentialId })}
/>
</Dialog>
</>
);
}