managarten/picture/apps/mobile/hooks/useResponsive.ts
Till-JS c712a2504a feat: integrate uload and picture, unify package naming
- Add uload project with apps/web structure
  - Reorganize from flat to monorepo structure
  - Remove PocketBase binary and local data
  - Update to pnpm and @uload/web namespace

- Add picture project to monorepo
  - Remove embedded git repository

- Unify all package names to @{project}/{app} schema:
  - @maerchenzauber/* (was @storyteller/*)
  - @manacore/* (was manacore-*, manacore)
  - @manadeck/* (was web, backend, manadeck)
  - @memoro/* (was memoro-web, landing, memoro)
  - @picture/* (already unified)
  - @uload/web

- Add convenient dev scripts for all apps:
  - pnpm dev:{project}:web
  - pnpm dev:{project}:landing
  - pnpm dev:{project}:mobile
  - pnpm dev:{project}:backend

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 04:00:36 +01:00

31 lines
No EOL
928 B
TypeScript

import { useState, useEffect } from 'react';
import { Platform, Dimensions } from 'react-native';
export const useResponsive = () => {
const [dimensions, setDimensions] = useState(() => Dimensions.get('window'));
useEffect(() => {
const subscription = Dimensions.addEventListener('change', ({ window }) => {
setDimensions(window);
});
return () => subscription?.remove();
}, []);
const isWeb = Platform.OS === 'web';
const isMobile = Platform.OS === 'ios' || Platform.OS === 'android';
const isDesktop = isWeb && dimensions.width >= 768;
const isTablet = (isWeb && dimensions.width >= 768 && dimensions.width < 1024) ||
(isMobile && dimensions.width >= 768);
const isLargeDesktop = isWeb && dimensions.width >= 1280;
return {
isWeb,
isMobile,
isDesktop,
isTablet,
isLargeDesktop,
width: dimensions.width,
height: dimensions.height,
};
};