Skip to content

Commit d1440bb

Browse files
authored
added pwa: extension for standalone, lots of mobile improvements (#7218)
1 parent a000030 commit d1440bb

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

apps/web/pages/apps/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export default function Apps({ categories, appStore }: inferSSRProps<typeof getS
5757
heading={t("app_store")}
5858
subtitle={t("app_store_description")}
5959
actions={(className) => (
60-
<div className="flex w-full flex-col md:flex-row md:justify-between lg:w-auto">
61-
<div className="lg:hidden">
60+
<div className="flex w-full flex-col pt-4 md:flex-row md:justify-between md:pt-0 lg:w-auto">
61+
<div className="ltr:mr-2 rtl:ml-2 lg:hidden">
6262
<HorizontalTabs tabs={tabs} />
6363
</div>
6464
<div>

apps/web/pages/more.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ export default function MorePage() {
55
const { t } = useLocale();
66
return (
77
<Shell>
8-
<div className="mt-8 max-w-screen-lg">
8+
<div className="max-w-screen-lg">
99
<MobileNavigationMoreItems />
10-
{/* Save it for next preview version
11-
<div className="mt-6">
12-
<UserV2OptInBanner />
13-
</div> */}
1410
<p className="mt-6 text-xs leading-tight text-gray-500 md:hidden">{t("more_page_footer")}</p>
1511
</div>
1612
</Shell>

apps/web/styles/globals.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ html.todesktop nav a svg{
105105
*/
106106

107107

108-
109108
/*
110109
Adds Utility to hide scrollbar to tailwind
111110
https://github.com/tailwindlabs/tailwindcss/discussions/2394

packages/app-store/_components/AppCategoryNavigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const AppCategoryNavigation = ({
3131
const appCategories = useMemo(() => getAppCategories(baseURL, useQueryParam), [baseURL, useQueryParam]);
3232

3333
return (
34-
<div className={cs("flex flex-col gap-x-6 p-2 md:p-0 xl:flex-row", classNames?.root ?? className)}>
34+
<div className={cs("flex flex-col gap-x-6 md:p-0 xl:flex-row", classNames?.root ?? className)}>
3535
<div className="hidden xl:block">
3636
<VerticalTabs
3737
tabs={appCategories}
@@ -40,7 +40,7 @@ const AppCategoryNavigation = ({
4040
itemClassname={classNames?.verticalTabsItem}
4141
/>
4242
</div>
43-
<div className="mb-4 block overflow-x-scroll xl:hidden">
43+
<div className="block overflow-x-scroll xl:hidden">
4444
<HorizontalTabs tabs={appCategories} linkProps={{ shallow: true }} />
4545
</div>
4646
<main className={classNames?.container ?? containerClassname} ref={animationRef}>

packages/config/tailwind-preset.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ module.exports = {
140140
900: "#f3f4f6",
141141
},
142142
},
143+
screens: {
144+
pwa: { raw: "(display-mode: standalone)" },
145+
},
143146
keyframes: {
144147
"fade-in-up": {
145148
"0%": {

packages/features/shell/Shell.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import type { User } from "@prisma/client";
22
import { signOut, useSession } from "next-auth/react";
33
import Link from "next/link";
4-
import { NextRouter, useRouter } from "next/router";
5-
import React, { Dispatch, Fragment, ReactNode, SetStateAction, useEffect, useState } from "react";
4+
import type { NextRouter } from "next/router";
5+
import { useRouter } from "next/router";
6+
import type { Dispatch, ReactNode, SetStateAction } from "react";
7+
import React, { Fragment, useEffect, useState } from "react";
68
import { Toaster } from "react-hot-toast";
79

810
import dayjs from "@calcom/dayjs";
@@ -22,7 +24,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
2224
import useTheme from "@calcom/lib/hooks/useTheme";
2325
import { trpc } from "@calcom/trpc/react";
2426
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
25-
import { SVGComponent } from "@calcom/types/SVGComponent";
27+
import type { SVGComponent } from "@calcom/types/SVGComponent";
2628
import {
2729
Button,
2830
Credits,
@@ -640,7 +642,7 @@ const MobileNavigation = () => {
640642
<>
641643
<nav
642644
className={classNames(
643-
"bottom-nav fixed bottom-0 z-30 -mx-4 flex w-full border border-t border-gray-200 bg-gray-50 bg-opacity-40 px-1 shadow backdrop-blur-md md:hidden",
645+
"pwa:pb-2.5 fixed bottom-0 z-30 -mx-4 flex w-full border border-t border-gray-200 bg-gray-50 bg-opacity-40 px-1 shadow backdrop-blur-md md:hidden",
644646
isEmbed && "hidden"
645647
)}>
646648
{mobileNavigationBottomItems.map((item) => (
@@ -669,7 +671,7 @@ const MobileNavigationItem: React.FC<{
669671
<Link
670672
key={item.name}
671673
href={item.href}
672-
className="relative my-2 min-w-0 flex-1 overflow-hidden rounded-md py-2 px-1 text-center text-xs font-medium text-gray-400 hover:bg-gray-200 hover:text-gray-700 focus:z-10 sm:text-sm [&[aria-current='page']]:text-gray-900"
674+
className="relative my-2 min-w-0 flex-1 overflow-hidden rounded-md !bg-transparent p-1 text-center text-xs font-medium text-gray-400 hover:text-gray-700 focus:z-10 sm:text-sm [&[aria-current='page']]:text-gray-900"
673675
aria-current={current ? "page" : undefined}>
674676
{item.badge && <div className="absolute right-1 top-1">{item.badge}</div>}
675677
{item.icon && (
@@ -816,7 +818,7 @@ export function ShellMain(props: LayoutProps) {
816818
className={classNames(
817819
props.backPath
818820
? "relative"
819-
: "fixed bottom-[88px] z-40 ltr:right-4 rtl:left-4 md:z-auto md:ltr:right-0 md:rtl:left-0",
821+
: "pwa:bottom-24 fixed bottom-20 z-40 ltr:right-4 rtl:left-4 md:z-auto md:ltr:right-0 md:rtl:left-0",
820822
"flex-shrink-0 md:relative md:bottom-auto md:right-auto"
821823
)}>
822824
{props.CTA}
@@ -842,7 +844,7 @@ function MainContainer({
842844
<main className="relative z-0 flex-1 bg-white focus:outline-none">
843845
{/* show top navigation for md and smaller (tablet and phones) */}
844846
{TopNavContainerProp}
845-
<div className="max-w-full px-4 py-4 md:py-8 lg:px-12">
847+
<div className="max-w-full px-4 md:py-8 lg:px-12">
846848
<ErrorBoundary>
847849
{!props.withoutMain ? <ShellMain {...props}>{props.children}</ShellMain> : props.children}
848850
</ErrorBoundary>

packages/ui/components/button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const buttonClasses = cva(
4242
variant: {
4343
button: "",
4444
icon: "flex justify-center",
45-
fab: "rounded-full justify-center md:rounded-md radix-state-open:rotate-45 md:radix-state-open:rotate-0 transition-transform radix-state-open:shadown-none radix-state-open:ring-0 !shadow-none",
45+
fab: "rounded-full justify-center md:rounded-md radix-state-open:rotate-45 md:radix-state-open:rotate-0 transition-transform radix-state-open:shadown-none radix-state-open:ring-0 !shadow-none",
4646
},
4747
color: {
4848
primary: "text-white dark:text-black",

packages/ui/components/navigation/tabs/HorizontalTabItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const HorizontalTabItem = function ({ name, href, linkProps, avatar, ...props }:
3232
{...linkProps}
3333
className={classNames(
3434
isCurrent ? "bg-gray-100 text-gray-900" : " text-gray-600 hover:bg-gray-100 hover:text-gray-900 ",
35-
"inline-flex items-center justify-center whitespace-nowrap rounded-[6px] py-[10px] px-2 text-sm font-medium leading-4 md:mb-0",
35+
"inline-flex items-center justify-center whitespace-nowrap rounded-[6px] p-2 text-sm font-medium leading-4 md:mb-0",
3636
props.disabled && "pointer-events-none !opacity-30",
3737
props.className
3838
)}

0 commit comments

Comments
 (0)