Skip to content

Commit 6bb1bb2

Browse files
committed
ComponentBase added
1 parent bf89357 commit 6bb1bb2

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

reactjs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# misc
1313
.DS_Store
14+
.env.development
1415
.env.local
1516
.env.development.local
1617
.env.test.local
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as React from 'react';
2+
import AppConsts from 'src/lib/appconst';
3+
4+
class AppBaseComponent extends React.Component {
5+
localizationSourceName = AppConsts.localization.defaultLocalizationSourceName;
6+
7+
L(key: string, sourceName?: string): string {
8+
return abp.localization.localize(key, sourceName ? sourceName : this.localizationSourceName);
9+
}
10+
11+
isGranted(permissionName: string): boolean {
12+
return abp.auth.isGranted(permissionName);
13+
}
14+
}
15+
16+
export default AppBaseComponent;

0 commit comments

Comments
 (0)