-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: junior hide cart bun1741 (#862)
* feat: junior hide cart BUN1741 https://bigc-b2b.atlassian.net/browse/BUN-1741 * feat: junior hide cart bun1741
- Loading branch information
1 parent
b7aad70
commit e8751d3
Showing
6 changed files
with
16 additions
and
15 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 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// eslint-disable-next-line | ||
export { default as removeCartPermissions } from './juniorRolePermissions' | ||
export { default as setCartPermissions } from './juniorRolePermissions' |
8 changes: 4 additions & 4 deletions
8
apps/storefront/src/utils/b3RolePermissions/juniorRolePermissions.ts
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import globalB3 from '@b3/global-b3' | ||
|
||
const removeCartPermissions = (role: number | string) => { | ||
if (+role !== 2) return | ||
const setCartPermissions = (role: number | string) => { | ||
if (+role === 2) return | ||
const carts = document.querySelectorAll(globalB3['dom.cartElement']) | ||
|
||
// remove cart Entrance | ||
if (carts.length > 0) { | ||
carts.forEach((cart: any) => { | ||
cart.style.display = 'none' | ||
cart.style.display = '' | ||
}) | ||
} | ||
} | ||
|
||
export default removeCartPermissions | ||
export default setCartPermissions |
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