import { useEffect } from "react";
import * as ScreenOrientation from "expo-screen-orientation";

export const useRotationEnabled = () => {
  useEffect(() => {
    const lock = async () => {
      await ScreenOrientation.unlockAsync();
    };
    lock();
    return () => {
      ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT);
    };
  }, []);
};
