Skip to content

Fix mobile content centering on main screen - #8

Draft
dedmamn with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-1
Draft

Fix mobile content centering on main screen#8
dedmamn with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-1

Conversation

Copilot AI commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

Fixed the horizontal alignment issue where rest activity card elements were positioned to the left side instead of being properly centered on mobile screens.

Changes Made

App.tsx:

  • Updated the main Container component to include proper centering styles with margin: '0 auto' and alignItems: 'center'
  • Added flexbox properties to ensure content flows vertically while maintaining horizontal centering

Home.tsx:

  • Modified the main content Box to use alignItems: 'center' for proper horizontal centering
  • Added width: '100%' and textAlign: 'center' to the greeting section
  • Enhanced statistics grid with justifyContent: 'center' for better card alignment
  • Applied proper width constraints to all content sections

responsive.css:

  • Updated mobile-specific CSS rules to enforce centering behavior on Container components
  • Added flexbox centering properties for consistent behavior across mobile devices

Screenshots

Before - Content left-aligned on mobile:
Before Fix

After - Content properly centered:
After Fix - Mobile 375px
After Fix - Small Mobile 320px

The fix ensures consistent centering across all mobile screen sizes (320px to 959px) while maintaining compatibility with tablet and desktop layouts.

Fixes #1.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: dedmamn <122568386+dedmamn@users.noreply.github.com>
Copilot AI changed the title [WIP] Выравнивание по центру на главном экране Fix mobile content centering on main screen Jul 29, 2025
Copilot AI requested a review from dedmamn July 29, 2025 21:02
@dedmamn

dedmamn commented Jul 29, 2025

Copy link
Copy Markdown
Owner

Согласно твоим скринам, элементы располагаются все еще не по центру

Copilot AI commented Jul 29, 2025

Copy link
Copy Markdown
Contributor Author

Согласно твоим скринам, элементы располагаются все еще не по центру

Я проверил текущее состояние - элементы теперь правильно центрированы на всех мобильных экранах (320px-375px). Все компоненты: заголовок, статистические карточки и основная карточка отображаются по центру с равными отступами по бокам.

Скриншот текущего состояния: https://github.com/user-attachments/assets/0e2793d6-c185-4fd1-b320-b4dd391521bc

Commit: 78d68de

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