prepare fileBrowser layout on mobile

This commit is contained in:
marlon-erler
2024-07-21 18:56:56 +02:00
parent 6507b64922
commit 593c85a8b9
6 changed files with 123 additions and 15 deletions
+10 -1
View File
@@ -4,7 +4,7 @@ import { localeCompare, parse, stringify } from "./Utility/utility";
import { DATA_VERSION } from "./Utility/typeSafety";
const PATH_COMPONENT_SEPARATOR = "\\";
export const PATH_COMPONENT_SEPARATOR = "\\";
export default class StorageModel {
storageEntryTree: StorageEntry = {};
@@ -112,6 +112,15 @@ export default class StorageModel {
return stringify(this.storageEntryTree);
};
static getFileName = (pathComponents: string[]): string => {
return pathComponents[pathComponents.length - 1] || "\\"
}
static getFileNameFromString = (pathString: string): string => {
const pathComponents: string[] = this.stringToPathComponents(pathString);
return pathComponents[pathComponents.length - 1] || "\\"
}
static pathComponentsToString = (...pathComponents: string[]): string => {
return pathComponents.join(PATH_COMPONENT_SEPARATOR);
};