managarten/apps-archived/memoro/apps/mobile/hooks/useResponsive.ts
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
Move inactive projects out of active workspace:
- bauntown (community website)
- maerchenzauber (AI story generation)
- memoro (voice memo app)
- news (news aggregation)
- nutriphi (nutrition tracking)
- reader (reading app)
- uload (URL shortener)
- wisekeep (AI wisdom extraction)

Update CLAUDE.md documentation:
- Add presi to active projects
- Document archived projects section
- Update workspace configuration

Archived apps can be re-activated by moving back to apps/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:03:59 +01:00

47 lines
1.1 KiB
TypeScript

import { useState, useEffect } from 'react';
import { Dimensions, Platform } from 'react-native';
const BREAKPOINTS = {
mobile: 640,
tablet: 768,
desktop: 1024,
wide: 1440,
} as const;
export function useResponsive() {
const [dimensions, setDimensions] = useState(() => {
const { width, height } = Dimensions.get('window');
return { width, height };
});
useEffect(() => {
if (Platform.OS !== 'web') return;
const updateDimensions = () => {
const { width, height } = Dimensions.get('window');
setDimensions({ width, height });
};
const subscription = Dimensions.addEventListener('change', updateDimensions);
return () => subscription?.remove();
}, []);
const { width } = dimensions;
return {
width,
height: dimensions.height,
isMobile: width < BREAKPOINTS.tablet,
isTablet: width >= BREAKPOINTS.tablet && width < BREAKPOINTS.desktop,
isDesktop: width >= BREAKPOINTS.desktop,
isWide: width >= BREAKPOINTS.wide,
breakpoint:
width < BREAKPOINTS.tablet
? 'mobile'
: width < BREAKPOINTS.desktop
? 'tablet'
: width < BREAKPOINTS.wide
? 'desktop'
: 'wide',
};
}