mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 00:24:53 +00:00
28 lines
731 B
TypeScript
28 lines
731 B
TypeScript
import React, { useEffect } from 'react';
|
|
import { View, Text } from 'react-native';
|
|
import * as ScreenOrientation from 'expo-screen-orientation';
|
|
|
|
const TabletChoresPage = () => {
|
|
// Function to lock the screen orientation to landscape
|
|
const lockScreenOrientation = async () => {
|
|
await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT);
|
|
};
|
|
|
|
useEffect(() => {
|
|
lockScreenOrientation(); // Lock orientation when the component mounts
|
|
|
|
return () => {
|
|
// Optional: Unlock to default when the component unmounts
|
|
ScreenOrientation.unlockAsync();
|
|
};
|
|
}, []);
|
|
|
|
return (
|
|
<View>
|
|
<Text>TabletChoresPage</Text>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default TabletChoresPage;
|