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 page height on mobile devices #181

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Fix page height on mobile devices #181

merged 1 commit into from
Mar 25, 2024

Conversation

alandao
Copy link
Contributor

@alandao alandao commented Mar 22, 2024

Issue #, if available:

Description of changes:
Was getting frustrated that I'd have to manually scroll down to see the chat input area on my phone... This should fix it!

h-screen/min-h-screen extend below the address bar on iOS Safari (at least on my iPhone 13 pro). h-dvh and min-h-dvh fix this. min-h-dvh is required on the element since the default styling is "min-height: 100vh".

This article explains it better than I do: https://ishadeed.com/article/new-viewport-units/

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Was geting frustrated that I'd have to manually scroll down to see the chat input on my phone... This should fix it!
@alandao
Copy link
Contributor Author

alandao commented Mar 22, 2024

Forgot to add that tailwindcss needs to be updated for this to work. Updated this PR with the latest version of it.

@wadabee wadabee self-requested a review March 24, 2024 08:04
Copy link
Contributor

@wadabee wadabee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.
This PR is going to improve the UX for mobile users!!
Please respond to my comment.

@@ -57,14 +57,14 @@ const App: React.FC = () => {
),
}}>
{({ signOut }) => (
<div className="relative flex h-screen w-screen bg-aws-paper">
<div className="relative flex h-dvh w-screen bg-aws-paper">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the following error with eslint-plugin-tailwindcss
Please upgrade eslint-plugin-tailwindcss to v3.14.0 or higher
image
https://github.com/francoismassart/eslint-plugin-tailwindcss/releases/tag/v3.14.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this on VSCode? I installed ESLint and Tailwind CSS IntelliSense extensions and can't reproduce. This is after I ran npm ci. Is there any setup I'm missing here?
image

alandao@Alans-MacBook-Air ~/P/b/frontend (main)> npm run lint

> [email protected] lint
> eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0


/Users/alandao/Projects/bedrock-claude-chat/frontend/src/components/DialogConfirmClearConversations.tsx
  34:11  warning  Classname 'bg-red-500' is not a Tailwind CSS class!  tailwindcss/no-custom-classname

/Users/alandao/Projects/bedrock-claude-chat/frontend/src/components/LazyOutputText.tsx
  31:5  error  Unused eslint-disable directive (no problems were reported from 'react-hooks/exhaustive-deps')

/Users/alandao/Projects/bedrock-claude-chat/frontend/src/hooks/useHttp.ts
  37:1  error  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-explicit-any')

/Users/alandao/Projects/bedrock-claude-chat/frontend/src/hooks/useScroll.ts
  24:5  error  Unused eslint-disable directive (no problems were reported from 'react-hooks/exhaustive-deps')

/Users/alandao/Projects/bedrock-claude-chat/frontend/src/i18n/fr/index.ts
  84:451  error  Irregular whitespace not allowed  no-irregular-whitespace
  96:39   error  Irregular whitespace not allowed  no-irregular-whitespace

✖ 6 problems (5 errors, 1 warning)
  3 errors and 0 warnings potentially fixable with the `--fix` option.

alandao@Alans-MacBook-Air ~/P/b/frontend (main) [1]> 

Copy link
Contributor

@wadabee wadabee Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm using VSCode.
Although I don't know the exact cause, after restarting and updating VSCode, the error message Classname 'h-dvh' is not a Tailwind CSS class! disappeared.
When I run npm run lint, the above error is also not occurring, so this issue has been resolved.
I will merge this PR as well. Thank you for your contribution!
image

As for your error, it seems that the tailwind.config.js file is not being recognized by the extension.

@wadabee wadabee merged commit 9989b59 into aws-samples:main Mar 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants