From d93c26259b1e2447bbead00b31d250f1a764d94f Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 30 Nov 2022 12:05:10 +0100 Subject: [PATCH] added Readonly label to File Explorer --- apps/remix-ide/src/app/plugins/file-decorator.ts | 2 -- libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/plugins/file-decorator.ts b/apps/remix-ide/src/app/plugins/file-decorator.ts index c81c1894ff..31aaf109be 100644 --- a/apps/remix-ide/src/app/plugins/file-decorator.ts +++ b/apps/remix-ide/src/app/plugins/file-decorator.ts @@ -12,7 +12,6 @@ const profile = { events: ['fileDecoratorsChanged'], version: '0.0.1' } - export class FileDecorator extends Plugin { private _fileStates: fileDecoration[] = [] constructor() { @@ -26,7 +25,6 @@ export class FileDecorator extends Plugin { } /** - * * @param fileStates Array of file states */ async setFileDecorators(fileStates: fileDecoration[] | fileDecoration) { diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index d76f21a1fa..a4247b9c8a 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -350,6 +350,10 @@ export function Workspace () { ) } + const formatNameForReadonly = (name: string) => { + return global.fs.readonly ? name + " (Read-only)" : name + } + const cloneModalMessage = () => { return ( <> @@ -607,7 +611,7 @@ export function Workspace () { - { selectedWorkspace ? selectedWorkspace.name : currentWorkspace === LOCALHOST ? 'localhost' : NO_WORKSPACE } + { selectedWorkspace ? selectedWorkspace.name : currentWorkspace === LOCALHOST ? formatNameForReadonly("localhost") : NO_WORKSPACE }