AOSSIE-Org / AOSSIE-Org/DebateAI

Bug : Avatar Modal not responsive on mobile devices

Open
#275 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
84
Forks
198
Avg merge
2d 19h
Merged PRs (30d)
30

Description

# Avatar Modal Responsiveness Issue

Image

## Bug Description

The Avatar customization modal (`AvatarModal.tsx`) is not responsive on smaller screens. The UI elements overflow and become unusable on mobile devices and narrow browser windows.

## Location

**File:** `frontend/src/components/AvatarModal.tsx`

## Root Cause

The modal uses a fixed 5-column grid layout (`grid-cols-5`) throughout the component without responsive breakpoints:

```tsx
// Line 443 - Character selection

// Line 470 - Background Color selection

// Line 490 - Ear Style selection

// ... and ~7 more instances for Eyes, Cheek, Face, Hair styles, etc.
```

## Expected Behavior

The avatar selection grids should adapt to screen size:
- **Mobile (< 640px):** 3 columns
- **Tablet (640px - 768px):** 4 columns
- **Desktop (> 768px):** 5 columns

## Suggested Fix

Replace all instances of:
```tsx
className='grid grid-cols-5 gap-4 mt-2'
```

With responsive classes:
```tsx
className='grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-2 sm:gap-4 mt-2'
```

Also consider reducing button sizes on mobile:
```tsx
// Current
className='w-16 h-16 rounded-full ...'

// Suggested
className='w-12 h-12 sm:w-14 sm:h-14 md:w-16 md:h-16 rounded-full ...'
```

## Affected Lines

| Line | Section |
|------|---------|
| 443 | Character selection grid |
| 470 | Background Color grid |
| 490 | Ear Style grid |
| 515 | Eyes Style grid |
| 540 | Cheek Style grid |
| 565 | Face Style grid |
| 590 | Front Hair Style grid |
| 615 | Hair Style grid |
| 640 | Mouth Style grid |
| 665 | Sideburn Style grid |
| 690 | Skin Color grid |

## Steps to Reproduce

1. Open the app on a mobile device or resize browser to < 640px width
2. Navigate to Profile page
3. Click on the avatar to open the customization modal
4. Observe that the avatar selection buttons overflow the container

### hey @bhavik-mangla, I found an issue on the responsiveness, Can you assign it to me please?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.