generated from wrappid/wrappid-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
those fix are related to toolbar and tab system in builder Ref #54
- Loading branch information
Showing
6 changed files
with
82 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { HistoryToolData } from "../components/data/toolbar/HistoryTool.data"; | ||
import { RequestForReviewToolData } from "../components/data/toolbar/RequestForReviewTool.data"; | ||
import { SaveToolData } from "../components/data/toolbar/SaveTool.data"; | ||
import { ToolbarData } from "../components/data/toolbar/Toolbar.data"; | ||
|
||
export default class ToolbarFactory { | ||
static ICONS = { | ||
HISTORY : "history", | ||
REQUEST_FOR_REVIEW: "rate_review", | ||
SAVE : "save", | ||
} as const; | ||
|
||
static getViewerData<T extends ToolbarData>(toolsIcon: string) :T { | ||
switch (toolsIcon) { | ||
case ToolbarFactory.ICONS.HISTORY: { | ||
return new HistoryToolData() as T; | ||
} | ||
|
||
case ToolbarFactory.ICONS.REQUEST_FOR_REVIEW: { | ||
return new RequestForReviewToolData() as T; | ||
} | ||
|
||
case ToolbarFactory.ICONS.SAVE: { | ||
return new SaveToolData() as T; | ||
} | ||
|
||
default: { | ||
throw new Error(`Unknown entity type: ${toolsIcon}`); | ||
} | ||
} | ||
} | ||
} | ||
|