fix: other reported issues (#11015)

* fix: weird margin top in avatar

* fix: pending users are shown on booking page

* fix: avatar and naming issues

* fix: toast alignment and removing unneeded titles

* missing changes from toast improvements

* feat: empty state for teams without event types

* Removing console.log
This commit is contained in:
Leo Giovanetti authored and GitHub committed 2023-08-30 13:42:34 -07:00
1 parent 1bf68d50e0
commit 356117feaf
21 files changed
+102 -53

No files matched your search

+5 -2
View File
@@ -40,7 +40,7 @@ export function Avatar(props: AvatarProps) {
let avatar = (
<AvatarPrimitive.Root
className={classNames(
"bg-emphasis item-center relative inline-flex aspect-square justify-center overflow-hidden rounded-full",
"bg-emphasis item-center relative aspect-square justify-center overflow-hidden rounded-full",
props.className,
sizesPropsBySize[size]
)}>
@@ -50,7 +50,10 @@ export function Avatar(props: AvatarProps) {
alt={alt}
className={classNames("aspect-square rounded-full", sizesPropsBySize[size])}
/>
<AvatarPrimitive.Fallback delayMs={600} asChild={props.asChild} className="flex items-center">
<AvatarPrimitive.Fallback
delayMs={600}
asChild={props.asChild}
className="flex h-full items-center justify-center">
<>
{props.fallback ? (
props.fallback
@@ -22,7 +22,7 @@ export function EmptyScreen({
Icon?: SVGComponent | IconType;
avatar?: React.ReactElement;
headline: string | React.ReactElement;
description: string | React.ReactElement;
description?: string | React.ReactElement;
buttonText?: string;
buttonOnClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
buttonRaw?: ReactNode; // Used incase you want to provide your own button.
@@ -49,9 +49,11 @@ export function EmptyScreen({
)}
<div className="flex max-w-[420px] flex-col items-center">
<h2 className="text-semibold font-cal text-emphasis mt-6 text-center text-xl">{headline}</h2>
<div className="text-default mb-8 mt-3 text-center text-sm font-normal leading-6">
{description}
</div>
{description && (
<div className="text-default mb-8 mt-3 text-center text-sm font-normal leading-6">
{description}
</div>
)}
{buttonOnClick && buttonText && <Button onClick={(e) => buttonOnClick(e)}>{buttonText}</Button>}
{buttonRaw}
</div>
+20 -12
View File
@@ -13,56 +13,64 @@ type IToast = {
export const SuccessToast = ({ message, toastVisible, onClose, toastId }: IToast) => (
<button
className={classNames(
"data-testid-toast-success bg-brand-default text-inverted mb-2 flex h-auto items-center space-x-2 rounded-md p-3 text-sm font-semibold shadow-md rtl:space-x-reverse md:max-w-sm",
"data-testid-toast-success bg-brand-default text-inverted mb-2 flex h-auto space-x-2 rounded-md p-3 text-sm font-semibold shadow-md rtl:space-x-reverse md:max-w-sm",
toastVisible && "animate-fade-in-up cursor-pointer"
)}
onClick={() => onClose(toastId)}>
<span>
<span className="mt-0.5">
<Check className="h-4 w-4" />
</span>
<p data-testid="toast-success">{message}</p>
<p data-testid="toast-success" className="text-left">
{message}
</p>
</button>
);
export const ErrorToast = ({ message, toastVisible, onClose, toastId }: IToast) => (
<button
className={classNames(
"animate-fade-in-up bg-error text-error mb-2 flex h-auto items-center space-x-2 rounded-md p-3 text-sm font-semibold shadow-md rtl:space-x-reverse md:max-w-sm",
"animate-fade-in-up bg-error text-error mb-2 flex h-auto space-x-2 rounded-md p-3 text-sm font-semibold shadow-md rtl:space-x-reverse md:max-w-sm",
toastVisible && "animate-fade-in-up cursor-pointer"
)}
onClick={() => onClose(toastId)}>
<span>
<span className="mt-0.5">
<Info className="h-4 w-4" />
</span>
<p data-testid="toast-error">{message}</p>
<p data-testid="toast-error" className="text-left">
{message}
</p>
</button>
);
export const WarningToast = ({ message, toastVisible, onClose, toastId }: IToast) => (
<button
className={classNames(
"animate-fade-in-up bg-brand-default text-brand mb-2 flex h-auto items-center space-x-2 rounded-md p-3 text-sm font-semibold shadow-md rtl:space-x-reverse md:max-w-sm",
"animate-fade-in-up bg-brand-default text-brand mb-2 flex h-auto space-x-2 rounded-md p-3 text-sm font-semibold shadow-md rtl:space-x-reverse md:max-w-sm",
toastVisible && "animate-fade-in-up cursor-pointer"
)}
onClick={() => onClose(toastId)}>
<span>
<span className="mt-0.5">
<Info className="h-4 w-4" />
</span>
<p data-testid="toast-warning">{message}</p>
<p data-testid="toast-warning" className="text-left">
{message}
</p>
</button>
);
export const DefaultToast = ({ message, toastVisible, onClose, toastId }: IToast) => (
<button
className={classNames(
"animate-fade-in-up bg-brand-default text-inverted mb-2 flex h-auto items-center space-x-2 rounded-md p-3 text-sm font-semibold shadow-md rtl:space-x-reverse md:max-w-sm",
"animate-fade-in-up bg-brand-default text-inverted mb-2 flex h-auto space-x-2 rounded-md p-3 text-sm font-semibold shadow-md rtl:space-x-reverse md:max-w-sm",
toastVisible && "animate-fade-in-up cursor-pointer"
)}
onClick={() => onClose(toastId)}>
<span>
<span className="mt-0.5">
<Check className="h-4 w-4" />
</span>
<p data-testid="toast-default">{message}</p>
<p data-testid="toast-default" className="text-left">
{message}
</p>
</button>
);