revamp template

This commit is contained in:
fro1991
2025-02-01 16:44:51 +07:00
parent c432df568a
commit 276a289580
1212 changed files with 112762 additions and 0 deletions

14
src/utils/Assets.ts Normal file
View File

@ -0,0 +1,14 @@
// Exaxmples of usage:
//* 1. In a background image: <div style={{backgroundImage: `url('${toAbsoluteUrl('/media/misc/pattern-1.jpg')}')`}}>...
//* 2. In img tag: <img src={toAbsoluteUrl('/media/avatars/300-2.jpg')} />
const toAbsoluteUrl = (pathname: string): string => {
const baseUrl = import.meta.env.BASE_URL;
if (baseUrl && baseUrl !== '/') {
return import.meta.env.BASE_URL + pathname;
} else {
return pathname;
}
};
export { toAbsoluteUrl };