MCPcopy Create free account
hub / github.com/callstack/react-native-paper / configureV3Fonts

Function configureV3Fonts

src/styles/fonts.tsx:81–111  ·  view source on GitHub ↗
(
  config: MD3FontsConfig
)

Source from the content-addressed store, hash-verified

79}
80
81function configureV3Fonts(
82 config: MD3FontsConfig
83): MD3Typescale | (MD3Typescale & { [key: string]: MD3Type }) {
84 if (!config) {
85 return typescale;
86 }
87
88 const isFlatConfig = Object.keys(config).every(
89 (key) => typeof config[key as keyof typeof config] !== 'object'
90 );
91
92 if (isFlatConfig) {
93 return Object.fromEntries(
94 Object.entries(typescale).map(([variantName, variantProperties]) => [
95 variantName,
96 { ...variantProperties, ...config },
97 ])
98 ) as MD3Typescale;
99 }
100
101 return Object.assign(
102 {},
103 typescale,
104 ...Object.entries(config).map(([variantName, variantProperties]) => ({
105 [variantName]: {
106 ...typescale[variantName as MD3TypescaleKey],
107 ...variantProperties,
108 },
109 }))
110 );
111}
112
113// eslint-disable-next-line no-redeclare
114export default function configureFonts(params: { isV3: false }): Fonts;

Callers 1

configureFontsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…