New dropdown implementation

This commit is contained in:
Elio Struyf
2024-02-15 13:00:45 +01:00
parent bdce486a24
commit 0a8723c544
18 changed files with 425 additions and 472 deletions
+20
View File
@@ -0,0 +1,20 @@
import { parseWinPath } from '../../helpers/parseWinPath';
export const getRelPath = (path: string, staticFolder?: string, wsFolder?: string) => {
let relPath: string | undefined = '';
if (wsFolder && path) {
const wsFolderParsed = parseWinPath(wsFolder);
const mediaParsed = parseWinPath(path);
relPath = mediaParsed.split(wsFolderParsed).pop();
// If the static folder is the root, we can just return the relative path
if (staticFolder === '/') {
return relPath;
} else if (staticFolder && relPath) {
const staticFolderParsed = parseWinPath(staticFolder);
relPath = relPath.split(staticFolderParsed).pop();
}
}
return relPath;
};
+1
View File
@@ -1,2 +1,3 @@
export * from './getRelPath';
export * from './preserveColor';
export * from './updateCssVariables';