All files / components/Text textSelectors.js

100% Statements 13/13
100% Branches 6/6
100% Functions 5/5
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18    17x   12x   5x 11x 11x 4x   7x     9x   7x  
import { getText } from '../../theme/themeSelectors';
 
export const getTextSizingStyle = (theme, sizing) => getText(theme).sizings[sizing] || {};
 
export const getTextColor = (theme, color) => getText(theme).colors[color];
 
export const getTextColorOnBg = (theme, bgColor, color) => {
  const surfaceColors = getText(theme).onBackground[bgColor];
  if (surfaceColors && surfaceColors[color]) {
    return surfaceColors[color];
  }
  return getTextColor(theme, color);
};
 
export const getTextOpacity = (theme, emphasis) => getText(theme).opacities[emphasis];
 
export const getTextCommonStyle = theme => getText(theme).common;