cb150f7a24
- CRM domain modules removed (customers, services, software, calendar, tasks, invoices, leads, finance, etc.)
- DLS branding: package name=lab, logo wordmark, sidebar nav, header CTA
- Tenant layer extended with kind dimension (lab|clinic) + requireTenantKind helper
- Schema rewritten for DLS domain: jobs, job_files, job_status_history, prosthetics, connections, finance_entries, notifications
- Onboarding form: clinic/lab account-type selection + auto-generated memberNumber
- Placeholder routes for jobs/{inbound,outbound,new}, products, finance, connections
- PDF spec + spec.md under belgeler/
- db: lab database + 13 collections + indexes + storage bucket (job-files) provisioned via Appwrite MCP
Ref: belgeler/dls-ui-tasarim.pdf
28 lines
750 B
TypeScript
28 lines
750 B
TypeScript
import * as React from "react"
|
|
|
|
const MOBILE_BREAKPOINT = 768
|
|
|
|
export function useIsMobile() {
|
|
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
|
|
|
React.useEffect(() => {
|
|
const mql = typeof window !== "undefined" ? window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`) : null
|
|
const onChange = () => {
|
|
setIsMobile(typeof window !== "undefined" ? window.innerWidth < MOBILE_BREAKPOINT : false)
|
|
}
|
|
|
|
if (mql) {
|
|
mql.addEventListener("change", onChange)
|
|
}
|
|
setIsMobile(typeof window !== "undefined" ? window.innerWidth < MOBILE_BREAKPOINT : false)
|
|
|
|
return () => {
|
|
if (mql) {
|
|
mql.removeEventListener("change", onChange)
|
|
}
|
|
}
|
|
}, [])
|
|
|
|
return !!isMobile
|
|
}
|