2021-05-11 08:01:45 +00:00
|
|
|
import { DefaultTheme } from 'react-native-paper';
|
|
|
|
|
|
|
|
import { createColorTokens } from './utils';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a React Native Paper theme based on local UI tokens.
|
|
|
|
*
|
|
|
|
* @param {Object} arg - The ui tokens.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2022-08-22 09:40:59 +00:00
|
|
|
export function createNativeTheme({ font, colors, colorMap, shape, spacing, typography }: any): any {
|
2021-05-11 08:01:45 +00:00
|
|
|
return {
|
|
|
|
...DefaultTheme,
|
|
|
|
palette: createColorTokens(colorMap, colors),
|
|
|
|
shape,
|
|
|
|
spacing,
|
|
|
|
typography: {
|
|
|
|
font,
|
|
|
|
...typography
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|