"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7315/react/features/base/styles/functions.web.ts" (2 Jun 2023, 949 Bytes) of package /linux/misc/jitsi-meet-7315.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "functions.web.ts": jitsi-meet_8319_vs_jitsi-meet_8615.

    1 import { StyleType } from './functions.any';
    2 
    3 export * from './functions.any';
    4 
    5 /**
    6  * Fixes the style prop that is passed to a platform generic component based on platform specific
    7  * format requirements.
    8  *
    9  * @param {StyleType} style - The passed style prop to the component.
   10  * @returns {StyleType}
   11  */
   12 export function getFixedPlatformStyle(style?: StyleType | StyleType[]) {
   13     if (Array.isArray(style)) {
   14         const _style = {};
   15 
   16         for (const component of style) {
   17             Object.assign(_style, component);
   18         }
   19 
   20         return _style;
   21     }
   22 
   23     return style;
   24 }
   25 
   26 /**
   27  * Sets the line height of a CSS Object group in pixels.
   28  * By default lineHeight is unitless in CSS, but not in RN.
   29  *
   30  * @param {Object} base - The base object containing the `lineHeight` property.
   31  * @returns {Object}
   32  */
   33 export function withPixelLineHeight(base: any) {
   34     return {
   35         ...base,
   36         lineHeight: `${base.lineHeight}px`
   37     };
   38 }