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

chore: removed props.hideHeadingOnMobile #19208

Merged
merged 3 commits into from
Feb 10, 2025
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
11 changes: 6 additions & 5 deletions apps/web/app/(use-page-wrapper)/(main-nav)/ShellMainAppDir.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ export function ShellMainAppDir(props: LayoutProps) {
<div
className={classNames(
"flex items-center md:mb-6 md:mt-0",
props.smallHeading ? "lg:mb-7" : "lg:mb-8",
props.hideHeadingOnMobile ? "mb-0" : "mb-6"
props.smallHeading ? "lg:mb-7" : "lg:mb-8"
)}>
{!!props.backPath && <ShellMainAppDirBackButton backPath={props.backPath} />}
{props.heading && (
<header
className={classNames(props.large && "py-8", "flex w-full max-w-full items-center truncate")}>
{props.HeadingLeftIcon && <div className="ltr:mr-4">{props.HeadingLeftIcon}</div>}
<div
className={classNames("w-full truncate ltr:mr-4 rtl:ml-4 md:block", props.headerClassName)}>
className={classNames(
"hidden w-full truncate ltr:mr-4 rtl:ml-4 md:block",
props.headerClassName
)}>
{props.heading && (
<h3
className={classNames(
"font-cal text-emphasis max-w-28 sm:max-w-72 md:max-w-80 inline truncate text-lg font-semibold tracking-wide sm:text-xl md:block xl:max-w-full",
props.smallHeading ? "text-base" : "text-xl",
props.hideHeadingOnMobile && "hidden"
props.smallHeading ? "text-base" : "text-xl"
)}>
{props.heading}
</h3>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/(use-page-wrapper)/(main-nav)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Shell from "@calcom/features/shell/Shell";

const Layout = ({ children }: { children: React.ReactNode }) => {
return (
<Shell hideHeadingOnMobile withoutSeo={true} withoutMain={true}>
<Shell withoutSeo={true} withoutMain={true}>
{children}
</Shell>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ export default function SettingsLayoutAppDirClient({
<Shell
withoutSeo={true}
flexChildrenContainer
hideHeadingOnMobile
{...rest}
SidebarContainer={
<SidebarContainerElement
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/apps/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ShellHeading = () => {

export default function WrappedApp(props: AppPageProps) {
return (
<Shell smallHeading isPublic hideHeadingOnMobile heading={<ShellHeading />} backPath="/apps" withoutSeo>
<Shell smallHeading isPublic heading={<ShellHeading />} backPath="/apps" withoutSeo>
{props.licenseRequired ? (
<LicenseRequired>
<AppPage {...props} />
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/apps/layouts/AppsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function AppsLayout({ children, actions, emptyStore, ...rest }: A

if (session.status === "loading") return <></>;
return (
<Shell {...rest} actions={actions?.("block")} hideHeadingOnMobile>
<Shell {...rest} actions={actions?.("block")}>
<div className="flex flex-col xl:flex-row">
<main className="w-full">
{emptyStore ? (
Expand Down
6 changes: 1 addition & 5 deletions apps/web/components/apps/layouts/InstalledAppsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ export default function InstalledAppsLayout({
...rest
}: { children: React.ReactNode } & ComponentProps<typeof Shell>) {
return (
<Shell
{...rest}
title="Installed Apps"
description="Manage your installed apps or change settings"
hideHeadingOnMobile>
<Shell {...rest} title="Installed Apps" description="Manage your installed apps or change settings">
<AppCategoryNavigation baseURL="/apps/installed" containerClassname="min-w-0 w-full">
{children}
</AppCategoryNavigation>
Expand Down
8 changes: 1 addition & 7 deletions apps/web/modules/apps/categories/categories-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ export default function Apps({ categories }: PageProps) {
const { t, isLocaleReady } = useLocale();

return (
<Shell
isPublic
large
hideHeadingOnMobile
title={t("app_store")}
description={t("app_store_description")}
withoutSeo>
<Shell isPublic large title={t("app_store")} description={t("app_store_description")} withoutSeo>
<div className="text-md flex items-center gap-1 px-4 pb-3 pt-3 font-normal md:px-8 lg:px-0 lg:pt-0">
<Link
href="/apps"
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/more/more-page-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
export default function MorePage() {
const { t } = useLocale();
return (
<Shell hideHeadingOnMobile withoutSeo={true}>
<Shell withoutSeo={true}>
<div className="max-w-screen-lg">
<MobileNavigationMoreItems />
<p className="text-subtle mt-6 text-xs leading-tight md:hidden">{t("more_page_footer")}</p>
Expand Down
8 changes: 1 addition & 7 deletions apps/web/modules/settings/platform/billing/billing-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ export default function PlatformBillingUpgrade() {
if (!isPlatformUser)
return (
<div>
<Shell
withoutSeo={true}
isPlatformUser={true}
hideHeadingOnMobile
withoutMain={false}
SidebarContainer={<></>}>
<Shell withoutSeo={true} isPlatformUser={true} withoutMain={false} SidebarContainer={<></>}>
<NoPlatformPlan />
</Shell>
</div>
Expand All @@ -72,7 +67,6 @@ export default function PlatformBillingUpgrade() {
<Shell
heading={t("platform_billing")}
title={t("platform_billing")}
hideHeadingOnMobile
withoutMain={false}
withoutSeo={true}
subtitle={t("manage_billing_description")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const ManagedUsersView = () => {
subtitle={t("managed_users_description")}
title={t("managed_users")}
description={t("managed_users_description")}
hideHeadingOnMobile
withoutMain={false}
isPlatformUser={true}>
<Skeleton as={Label} loadingClassName="w-16" title={t("select_oAuth_client")}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,7 @@ export default function EditOAuthClient() {

return (
<div>
<Shell
withoutSeo={true}
isPlatformUser={true}
hideHeadingOnMobile
withoutMain={false}
SidebarContainer={<></>}>
<Shell withoutSeo={true} isPlatformUser={true} withoutMain={false} SidebarContainer={<></>}>
<NoPlatformPlan />
</Shell>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,7 @@ export default function EditOAuthClientWebhooks() {

return (
<div>
<Shell
withoutSeo={true}
isPlatformUser={true}
hideHeadingOnMobile
withoutMain={false}
SidebarContainer={<></>}>
<Shell withoutSeo={true} isPlatformUser={true} withoutMain={false} SidebarContainer={<></>}>
<NoPlatformPlan />
</Shell>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,7 @@ export default function CreateOAuthClient() {

return (
<div>
<Shell
withoutSeo={true}
isPlatformUser={true}
hideHeadingOnMobile
withoutMain={false}
SidebarContainer={<></>}>
<Shell withoutSeo={true} isPlatformUser={true} withoutMain={false} SidebarContainer={<></>}>
<NoPlatformPlan />
</Shell>
</div>
Expand Down
2 changes: 0 additions & 2 deletions apps/web/modules/settings/platform/platform-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export default function Platform() {
subtitle={t("platform_description")}
title={t("platform")}
description={t("platform_description")}
hideHeadingOnMobile
withoutSeo={true}
withoutMain={false}
isPlatformUser={true}>
Expand All @@ -89,7 +88,6 @@ export default function Platform() {
// we want to hide org banner and have different sidebar tabs for platform clients
// hence we pass isPlatformUser boolean as prop
isPlatformUser={true}
hideHeadingOnMobile
withoutMain={false}
withoutSeo={true}
SidebarContainer={<></>}>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/modules/upgrade/upgrade-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function UpgradePage() {
const doesUserHaveOrgToUpgrade = trpc.viewer.organizations.checkIfOrgNeedsUpgrade.useQuery();

return (
<Shell hideHeadingOnMobile withoutSeo={true}>
<Shell withoutSeo={true}>
<div className="max-w-screen-lg">
{doesUserHaveOrgToUpgrade.data ? (
<EmptyScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,7 @@ const ShellContainer = ({ page }: { page: React.ReactElement }) => {
const { t } = useLocale();

return (
<Shell
title={t("routing_forms")}
description={t("routing_forms_description")}
withoutMain={true}
hideHeadingOnMobile>
<Shell title={t("routing_forms")} description={t("routing_forms_description")} withoutMain={true}>
{page}
</Shell>
);
Expand Down
3 changes: 1 addition & 2 deletions packages/features/ee/platform/pages/settings/members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const PlatformMembersView = () => {
if (!isPlatformUser)
return (
<div>
<Shell isPlatformUser={true} hideHeadingOnMobile withoutMain={false} SidebarContainer={<></>}>
<Shell isPlatformUser={true} withoutMain={false} SidebarContainer={<></>}>
<NoPlatformPlan />
</Shell>
</div>
Expand All @@ -65,7 +65,6 @@ const PlatformMembersView = () => {
}
title={t("platform_members")}
subtitle={t("platform_members_description")}
hideHeadingOnMobile
withoutMain={false}
isPlatformUser={true}>
<div>{!isPending && canLoggedInUserSeeMembers && <UserListTable />}</div>
Expand Down
1 change: 0 additions & 1 deletion packages/features/ee/workflows/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ function WorkflowsPage({ filteredList }: PageProps) {
subtitle={t("workflows_to_automate_notifications")}
title={t("workflows")}
description={t("workflows_to_automate_notifications")}
hideHeadingOnMobile
CTA={
session.data?.hasValidLicense ? (
<CreateButtonWithTeamsList
Expand Down
1 change: 0 additions & 1 deletion packages/features/ee/workflows/pages/workflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ function WorkflowPage({
</div>
)
}
hideHeadingOnMobile
heading={
isAllDataLoaded && (
<div className="flex">
Expand Down
11 changes: 4 additions & 7 deletions packages/features/shell/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export type LayoutProps = {
beforeCTAactions?: JSX.Element;
afterHeading?: ReactNode;
smallHeading?: boolean;
hideHeadingOnMobile?: boolean;
isPlatformUser?: boolean;
};

Expand Down Expand Up @@ -145,9 +144,8 @@ export function ShellMain(props: LayoutProps) {
{(props.heading || !!props.backPath) && (
<div
className={classNames(
"flex items-center md:mb-6 md:mt-0",
props.smallHeading ? "lg:mb-7" : "lg:mb-8",
props.hideHeadingOnMobile ? "mb-0" : "mb-6"
"hidden items-center md:mb-6 md:mt-0 md:flex",
props.smallHeading ? "lg:mb-7" : "lg:mb-8"
)}>
{!!props.backPath && (
<Button
Expand All @@ -173,8 +171,7 @@ export function ShellMain(props: LayoutProps) {
<h3
className={classNames(
"font-cal text-emphasis max-w-28 sm:max-w-72 md:max-w-80 inline truncate text-lg font-semibold tracking-wide sm:text-xl md:block xl:max-w-full",
props.smallHeading ? "text-base" : "text-xl",
props.hideHeadingOnMobile && "hidden"
props.smallHeading ? "text-base" : "text-xl"
)}>
{!isLocaleReady ? <SkeletonText invisible /> : props.heading}
</h3>
Expand Down Expand Up @@ -239,7 +236,7 @@ function MainContainer({
<main className="bg-default relative z-0 flex-1 focus:outline-none">
{/* show top navigation for md and smaller (tablet and phones) */}
{TopNavContainerProp}
<div className="max-w-full px-2 py-4 lg:px-6">
<div className="max-w-full p-2 sm:py-4 lg:px-6">
<ErrorBoundary>
{!props.withoutMain ? <ShellMain {...props}>{props.children}</ShellMain> : props.children}
</ErrorBoundary>
Expand Down
Loading