You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.js 653B

12345678910111213141516171819202122
  1. // @flow
  2. import { SET_ASPECT_RATIO } from './actionTypes';
  3. import { ASPECT_RATIO_NARROW, ASPECT_RATIO_WIDE } from './constants';
  4. /**
  5. * Sets the aspect ratio of the app's user interface based on specific width and
  6. * height.
  7. *
  8. * @param {number} width - The width of the app's user interface.
  9. * @param {number} height - The height of the app's user interface.
  10. * @returns {{
  11. * type: SET_ASPECT_RATIO,
  12. * aspectRatio: Symbol
  13. * }}
  14. */
  15. export function setAspectRatio(width: number, height: number): Object {
  16. return {
  17. type: SET_ASPECT_RATIO,
  18. aspectRatio: width < height ? ASPECT_RATIO_NARROW : ASPECT_RATIO_WIDE
  19. };
  20. }