chore: settings/teams and settings/billing - remove pages router and use app router (#16751)

* remove pages router and use app router

* revert yarn.lock

* remove line break from yarn lock

* Add booking limits page to app dir

* revert yarn.lock

* do not render bookingLimits from pages router

* clean up code

* remove isAppDir

* revert unneeded change

* add layout to billing page

* remove files not needed

* rename imports

* remove APP_ROUTER_SETTINGS_DEVELOPER

* remove layout
This commit is contained in:
Benny Joo authored and GitHub committed 2024-12-04 12:31:45 -05:00
1 parent 9085287fc6
commit d60b6c6a6d
41 files changed
+51 -353

No files matched your search

@@ -1,18 +1,9 @@
import SectionBottomActions from "@calcom/features/settings/SectionBottomActions";
import { Meta, SkeletonButton, SkeletonContainer, SkeletonText } from "@calcom/ui";
export const AppearanceSkeletonLoader = ({
title,
description,
isAppDir,
}: {
title: string;
description: string;
isAppDir?: boolean;
}) => {
export const AppearanceSkeletonLoader = () => {
return (
<SkeletonContainer>
{!isAppDir ? <Meta title={title} description={description} borderInShellHeader={false} /> : null}
<div className="border-subtle mt-6 flex items-center rounded-t-xl border p-6 text-sm">
<SkeletonText className="h-8 w-1/3" />
</div>
@@ -195,7 +195,6 @@ const OrgAppearanceView = ({
const OrgAppearanceViewWrapper = () => {
const router = useRouter();
const { t } = useLocale();
const session = useSession();
const orgRole = session?.data?.user?.org?.role;
const { data: currentOrg, isPending, error } = trpc.viewer.organizations.listCurrent.useQuery();
@@ -210,7 +209,7 @@ const OrgAppearanceViewWrapper = () => {
);
if (isPending) {
return <AppearanceSkeletonLoader title={t("appearance")} description={t("appearance_org_description")} />;
return <AppearanceSkeletonLoader />;
}
if (!currentOrg) return null;
@@ -23,9 +23,9 @@ type BrandColorsFormValues = {
darkBrandColor: string;
};
type ProfileViewProps = { team: RouterOutputs["viewer"]["teams"]["get"] } & { isAppDir?: boolean };
type ProfileViewProps = { team: RouterOutputs["viewer"]["teams"]["get"] };
const ProfileView = ({ team, isAppDir }: ProfileViewProps) => {
const ProfileView = ({ team }: ProfileViewProps) => {
const { t } = useLocale();
const utils = trpc.useUtils();
@@ -79,13 +79,6 @@ const ProfileView = ({ team, isAppDir }: ProfileViewProps) => {
return (
<>
{!isAppDir ? (
<Meta
title={t("booking_appearance")}
description={t("appearance_team_description")}
borderInShellHeader={false}
/>
) : null}
{isAdmin ? (
<>
<Form
@@ -183,7 +176,7 @@ const ProfileView = ({ team, isAppDir }: ProfileViewProps) => {
);
};
const ProfileViewWrapper = ({ isAppDir }: { isAppDir?: boolean }) => {
const ProfileViewWrapper = () => {
const router = useRouter();
const params = useParamsWithFallback();
@@ -209,18 +202,11 @@ const ProfileViewWrapper = ({ isAppDir }: { isAppDir?: boolean }) => {
[error]
);
if (isPending)
return (
<AppearanceSkeletonLoader
isAppDir={isAppDir}
title={t("appearance")}
description={t("appearance_team_description")}
/>
);
if (isPending) return <AppearanceSkeletonLoader />;
if (!team) return null;
return <ProfileView team={team} isAppDir={isAppDir} />;
return <ProfileView team={team} />;
};
export default ProfileViewWrapper;
@@ -140,8 +140,6 @@ const BookingLimitsViewWrapper = () => {
const router = useRouter();
const params = useParamsWithFallback();
const { t } = useLocale();
const {
data: team,
isPending,
@@ -162,13 +160,7 @@ const BookingLimitsViewWrapper = () => {
[error]
);
if (isPending)
return (
<AppearanceSkeletonLoader
title={t("booking_limits")}
description={t("booking_limits_team_description")}
/>
);
if (isPending) return <AppearanceSkeletonLoader />;
if (!team) return null;
@@ -5,14 +5,9 @@ import { Meta } from "@calcom/ui";
import { TeamsListing } from "../components";
const TeamListingView = ({ isAppDir }: { isAppDir?: boolean }) => {
const TeamListingView = () => {
const { t } = useLocale();
return (
<>
{!isAppDir ? <Meta title={t("teams")} description={t("create_manage_teams_collaborative")} /> : null}
<TeamsListing />
</>
);
return <TeamsListing />;
};
export default TeamListingView;
@@ -17,7 +17,7 @@ import { MemberInvitationModalWithoutMembers } from "../components/MemberInvitat
import MemberList from "../components/MemberList";
import TeamInviteList from "../components/TeamInviteList";
const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => {
const MembersView = () => {
const { t } = useLocale();
const [showMemberInvitationModal, setShowMemberInvitationModal] = useState(false);
const [showInviteLinkSettingsModal, setInviteLinkSettingsModal] = useState(false);
@@ -62,9 +62,6 @@ const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => {
return (
<>
{!isAppDir ? (
<Meta title={t("team_members")} description={t("members_team_description")} CTA={<></>} />
) : null}
{!isPending && (
<>
<div>
@@ -60,18 +60,9 @@ const teamProfileFormSchema = z.object({
type FormValues = z.infer<typeof teamProfileFormSchema>;
const SkeletonLoader = ({
isAppDir,
title,
description,
}: {
isAppDir?: boolean;
title: string;
description: string;
}) => {
const SkeletonLoader = () => {
return (
<SkeletonContainer>
{!isAppDir ? <Meta title={title} description={description} borderInShellHeader={true} /> : null}
<div className="border-subtle space-y-6 rounded-b-xl border border-t-0 px-4 py-8">
<div className="flex items-center">
<SkeletonAvatar className="me-4 mt-0 h-16 w-16 px-4" />
@@ -87,7 +78,7 @@ const SkeletonLoader = ({
);
};
const ProfileView = ({ isAppDir }: { isAppDir?: boolean }) => {
const ProfileView = () => {
const params = useParamsWithFallback();
const teamId = Number(params.id);
const { t } = useLocale();
@@ -165,17 +156,11 @@ const ProfileView = ({ isAppDir }: { isAppDir?: boolean }) => {
}
if (isPending) {
return (
<SkeletonLoader isAppDir={isAppDir} title={t("profile")} description={t("profile_team_description")} />
);
return <SkeletonLoader />;
}
return (
<>
{!isAppDir ? (
<Meta title={t("profile")} description={t("profile_team_description")} borderInShellHeader={true} />
) : null}
{isAdmin ? (
<TeamProfileForm team={team} />
) : (