avian-flightdeck

Responsive Design System

This document describes the responsive design architecture implemented across the Avian FlightDeck Wallet application.

Overview

The Avian FlightDeck Wallet uses a mobile-first responsive design system that provides optimal user experiences across all device types. The system is built around a consistent breakpoint and component pattern that ensures seamless adaptation between mobile and desktop interfaces.

Design Principles

Mobile-First Architecture

Consistent Breakpoint System

Component Patterns

Drawer/Dialog Pattern

The core responsive pattern used throughout the application:

const isMobile = useMediaQuery('(max-width: 640px)');

return isMobile ? (
  <Drawer open={isOpen} onOpenChange={onClose}>
    <DrawerContent>{/* Mobile-optimized full-screen interface */}</DrawerContent>
  </Drawer>
) : (
  <Dialog open={isOpen} onOpenChange={onClose}>
    <DialogContent>{/* Desktop-optimized centered modal */}</DialogContent>
  </Dialog>
);

Components Using Responsive Pattern

1. AuthenticationDialog

2. BackupQRModal

3. BackupDrawer

4. DerivedAddressesPanel

5. WalletSettingsDashboard

6. LogViewer

7. MnemonicModal

Implementation Details

useMediaQuery Hook

The responsive system relies on the useMediaQuery hook:

import { useMediaQuery } from '@/hooks/use-media-query';

const isMobile = useMediaQuery('(max-width: 640px)');

Shared Content Pattern

Many components use shared content components that work in both mobile and desktop contexts:

// Shared content component
function SharedContent({ isDrawer = false }: { isDrawer?: boolean }) {
  return (
    <div className={`space-y-4 ${isDrawer ? 'p-4' : 'p-6'}`}>
      {/* Content that works in both contexts */}
    </div>
  );
}

// Usage in both contexts
{
  isMobile ? (
    <DrawerContent>
      <SharedContent isDrawer={true} />
    </DrawerContent>
  ) : (
    <DialogContent>
      <SharedContent isDrawer={false} />
    </DialogContent>
  );
}

Mobile Optimizations

Touch Targets

Typography

Styling Conventions

Responsive Classes

Layout Patterns

// Container responsive pattern
<div className="flex flex-col sm:flex-row gap-2 justify-between">
  {/* Mobile: stacked vertically, Desktop: horizontal layout */}
</div>

// Button responsive pattern
<Button className={isMobile ? 'w-full' : 'w-auto'}>
  {/* Full width on mobile, auto width on desktop */}
</Button>

Benefits

User Experience

Developer Experience

Performance

Testing Responsive Design

Manual Testing

  1. Test at 640px breakpoint boundary
  2. Verify touch interactions on mobile devices
  3. Ensure proper drawer/dialog behavior
  4. Check content overflow and scrolling

Responsive Testing Tools

Future Considerations

Potential Enhancements

Maintenance