mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 23:39:40 +02:00
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>
47 lines
1.1 KiB
TypeScript
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',
|
|
};
|
|
}
|