Skip to content

Commit

Permalink
refactor: move paths to common constants
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Wang <wonglam@amazon.com>
  • Loading branch information
wanglam committed Jun 16, 2023
1 parent 74ade84 commit 66fb6bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/plugins/workspace/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@
export const WORKSPACE_APP_ID = 'workspace';
export const WORKSPACE_APP_NAME = 'Workspace';
export const WORKSPACE_ID_IN_SESSION_STORAGE = '_workspace_id_';

export const PATHS = {
create: '/create',
overview: '/overview',
};
11 changes: 4 additions & 7 deletions src/plugins/workspace/public/components/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { PATHS } from '../../common/constants';

import { WorkspaceCreator } from './workspace_creator';
import { WorkspaceOverview } from './workspace_overview';

export const paths = {
create: '/create',
overview: '/overview',
};

export interface RouteConfig {
path: string;
Component: React.ComponentType<any>;
Expand All @@ -20,12 +17,12 @@ export interface RouteConfig {

export const ROUTES: RouteConfig[] = [
{
path: paths.create,
path: PATHS.create,
Component: WorkspaceCreator,
label: 'Create',
},
{
path: paths.overview,
path: PATHS.overview,
Component: WorkspaceOverview,
label: 'Overview',
},
Expand Down

0 comments on commit 66fb6bd

Please sign in to comment.