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

Remove <Loader/> from app setup pages and team user availability view #4931

Merged
merged 6 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions apps/web/pages/v2/apps/[slug]/setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ import { useRouter } from "next/router";

import { getStaticProps } from "@calcom/app-store/_pages/setup/_getStaticProps";
import { AppSetupPage } from "@calcom/app-store/_pages/v2/setup";
import Loader from "@calcom/ui/Loader";

export default function SetupInformation(props: InferGetStaticPropsType<typeof getStaticProps>) {
const router = useRouter();
const slug = router.query.slug as string;
const { status } = useSession();

if (status === "loading") {
return (
<div className="absolute z-50 flex h-screen w-full items-center bg-gray-200">
<Loader />
PeerRich marked this conversation as resolved.
Show resolved Hide resolved
</div>
);
return <div className="absolute z-50 flex h-screen w-full items-center bg-gray-200" />;
}

if (status === "unauthenticated") {
Expand Down
4 changes: 3 additions & 1 deletion apps/web/public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1299,5 +1299,7 @@
"dont_update": "Don't update",
"email_address_action": "send email to a specific email address",
"after_event_trigger": "after event ends",
"how_long_after": "How long after event ends?"
"how_long_after": "How long after event ends?",
"no_available_slots": "No Available slots",
"time_available": "Time available"
}
6 changes: 1 addition & 5 deletions packages/app-store/zapier/pages/v2/setup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {
}

if (integrations.isLoading) {
return (
<div className="absolute z-50 flex h-screen w-full items-center bg-gray-200">
<Loader />
</div>
);
return <div className="absolute z-50 flex h-screen w-full items-center bg-gray-200" />;
}

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { SkeletonContainer, SkeletonText } from "@calcom/ui";

function SkeletonLoader() {
return (
<SkeletonContainer>
<div className="mr-3">
<SkeletonText className="h-4 w-28" />
<SkeletonText className="mt-3 h-11 w-full" />
<SkeletonText className="mt-2 h-11 w-full" />
</div>
</SkeletonContainer>
);
}

export default SkeletonLoader;
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import React from "react";
import { ITimezone } from "react-timezone-select";

import { Dayjs } from "@calcom/dayjs";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import getSlots from "@calcom/lib/slots";
import { trpc } from "@calcom/trpc/react";
import { Loader } from "@calcom/ui/v2";

import SkeletonLoader from "./SkeletonLoaderAvailabilityTimes";

interface Props {
teamId: number;
Expand All @@ -18,6 +20,8 @@ interface Props {
}

export default function TeamAvailabilityTimes(props: Props) {
const { t } = useLocale();

const { data, isLoading } = trpc.useQuery(
[
"viewer.teams.getMemberAvailability",
Expand Down Expand Up @@ -47,13 +51,13 @@ export default function TeamAvailabilityTimes(props: Props) {
return (
<div className={classNames("min-w-60 flex-grow pl-0", props.className)}>
{props.HeaderComponent}
{isLoading && times.length === 0 && <Loader />}
{isLoading && times.length === 0 && <SkeletonLoader />}
{!isLoading && times.length === 0 ? (
<div className="flex flex-col items-center justify-center pt-4">
<span className="text-sm text-gray-500">No Available slots</span>
<span className="text-sm text-gray-500">{t("no_available_slots")}</span>
</div>
) : (
<>{!isLoading && <p className="mb-3 text-sm text-gray-600">Time available</p>}</>
<>{!isLoading && <p className="mb-3 text-sm text-gray-600">{t("time_available")}</p>}</>
)}
<div className="max-h-[390px] overflow-scroll">
{times.map((time) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { SkeletonAvatar, SkeletonContainer, SkeletonText } from "@calcom/ui";
import { Icon } from "@calcom/ui/Icon";
import { SkeletonContainer, SkeletonText } from "@calcom/ui";

function SkeletonLoader() {
return (
Expand Down