first commit

This commit is contained in:
pasqualevitiello
2021-11-17 18:24:56 +01:00
parent 28f44ca066
commit 0a54a0c881
69 changed files with 6127 additions and 0 deletions

35
src/utils/Utils.js Normal file
View File

@@ -0,0 +1,35 @@
import resolveConfig from 'tailwindcss/resolveConfig';
import tailwindConfigFile from '@tailwindConfig';
export const tailwindConfig = () => {
// Tailwind config
return resolveConfig(tailwindConfigFile)
}
export const hexToRGB = (h) => {
let r = 0;
let g = 0;
let b = 0;
if (h.length === 4) {
r = `0x${h[1]}${h[1]}`;
g = `0x${h[2]}${h[2]}`;
b = `0x${h[3]}${h[3]}`;
} else if (h.length === 7) {
r = `0x${h[1]}${h[2]}`;
g = `0x${h[3]}${h[4]}`;
b = `0x${h[5]}${h[6]}`;
}
return `${+r},${+g},${+b}`;
};
export const formatValue = (value) => Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
maximumSignificantDigits: 3,
notation: 'compact',
}).format(value);
export const formatThousands = (value) => Intl.NumberFormat('en-US', {
maximumSignificantDigits: 3,
notation: 'compact',
}).format(value);