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

fix(mobile): account for address bar height #13

Merged
merged 6 commits into from
Feb 11, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- name: Cypress run
uses: cypress-io/github-action@v5
with:
browser: chrome
build: npm run build
start: npm run dev
env:
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="h-screen w-screen bg-white" lang="en">
<html class="h-dvh w-screen bg-white" lang="en">
<head>
<meta name="description" content="Chat via XMTP" />
<link rel="icon" href="/favicon.ico" />
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"preview": "vite preview",
"lint": "eslint . --ignore-path .gitignore",
"typecheck": "tsc",
"cypress": "cypress run",
"cypress": "cypress run --browser chrome",
"cypress:open": "cypress open --browser chrome",
"fmt:check": "prettier -c --ignore-path .gitignore --ignore-path .prettierignore .",
"fmt:fix": "prettier -w --ignore-path .gitignore --ignore-path .prettierignore .",
"e2e:headless": "start-server-and-test dev http://localhost:5173 cypress",
Expand Down
2 changes: 1 addition & 1 deletion src/component-library/components/Error/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Error = ({ errorText, onConnect }: ErrorProps) => {
const { t } = useTranslation();

return (
<div className="bg-white flex flex-col justify-center items-center max-w-sm text-center m-auto w-screen p-4 h-screen">
<div className="bg-white flex flex-col justify-center items-center max-w-sm text-center m-auto w-screen p-4 h-dvh">
<ExclamationIcon className="text-red-600" width={82} />
<div className="mt-2">
<h1 className="text-4xl font-bold p-4 pt-0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export const HeaderDropdown = ({
data-testid={testId}
type="button"
className={classNames(
"text-lg mr-2 cursor-pointer",
"mr-2 cursor-pointer truncate",
activeTab === name ? "font-bold" : "",
isMobileView ? "text-md" : "text-lg",
)}
onClick={() => {
setActiveTab(name as ActiveTab);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const OnboardingStep = ({
const { header, subheader, cta, subtext, disconnect_tip } = stepInfo;

return (
<div className="bg-white flex flex-col justify-around items-center max-w-sm text-center m-auto w-screen p-4 h-screen">
<div className="bg-white flex flex-col justify-around items-center max-w-sm text-center m-auto w-screen p-4 h-dvh">
{isLoading ? (
<Spinner />
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/component-library/components/SideNav/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const SideNav = ({
"flex-col",
"justify-between",
"items-center",
"h-screen",
"h-dvh",
"bg-white",
isOpen ? "px-6" : "px-3",
"border-r",
Expand Down
2 changes: 1 addition & 1 deletion src/component-library/pages/ErrorPage/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const ErrorPage = ({
const { t } = useTranslation();

return (
<div className="bg-white h-screen max-w-sm flex flex-col justify-center items-center m-auto text-center">
<div className="bg-white h-dvh max-w-sm flex flex-col justify-center items-center m-auto text-center">
{icon}
<div className="text-4xl font-bold mb-4">
{header || t("status_messaging.error_1_header")}
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/FullConversationController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const FullConversationController: React.FC<
id="scrollableDiv"
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex={0}
className="w-full h-full flex flex-col overflow-auto relative pb-4">
className="w-full h-full flex flex-col overflow-auto relative">
{effect === "SNOW" ? (
<SnowEffect messageId={messageId} key={messageId} />
) : effect === "RAIN" ? (
Expand Down
6 changes: 3 additions & 3 deletions src/pages/inbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const Inbox: React.FC<{ children?: React.ReactNode }> = () => {
(!recipientAddress && !startedFirstMessage) ? (
<>
<SideNavController />
<div className="flex flex-col w-full h-screen overflow-y-auto md:w-[350px]">
<div className="flex flex-col w-full h-dvh overflow-y-auto md:w-[350px]">
<HeaderDropdownController />
<ConversationListController
setStartedFirstMessage={setStartedFirstMessage}
Expand All @@ -144,7 +144,7 @@ const Inbox: React.FC<{ children?: React.ReactNode }> = () => {
{size[0] > TAILWIND_MD_BREAKPOINT ||
recipientAddress ||
startedFirstMessage ? (
<div className="flex w-full flex-col h-screen overflow-hidden">
<div className="flex w-full flex-col h-dvh overflow-hidden">
{!conversations.length &&
!loadingConversations &&
!startedFirstMessage ? (
Expand All @@ -154,7 +154,7 @@ const Inbox: React.FC<{ children?: React.ReactNode }> = () => {
/>
) : (
// Full container including replies
<div className="flex h-screen">
<div className="flex h-dvh">
<div className="h-full w-full flex flex-col justify-between">
{activeMessage && selectedConversation ? (
<div className="h-full overflow-auto">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const OnboardingPage = () => {
}, [status]);

return (
<div className={classNames("h-screen", "w-full", "overflow-auto")}>
<div className={classNames("h-dvh", "w-full", "overflow-auto")}>
<OnboardingStep
step={step}
isLoading={isLoading}
Expand Down
Loading