File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
pages/Home/components/StageSection
shared/frame/SlidingMainHeader Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ import { useTranslation } from 'react-i18next'
2222import { getAssetBase } from 'services/EnvironmentService'
2323import { SlidingMainHeader } from 'components/shared/frame/SlidingMainHeader/SlidingMainHeader'
2424import { useNavigate } from 'react-router-dom'
25+ import { userHasPortalRole } from 'services/AccessService'
26+ import { ROLES } from 'types/Constants'
2527
2628export default function StageSection ( ) {
2729 const { t } = useTranslation ( )
@@ -39,6 +41,7 @@ export default function StageSection() {
3941 handleClick : ( ) => {
4042 navigate ( t ( 'content.home.stage.slider1.navigation' ) )
4143 } ,
44+ hasAccess : userHasPortalRole ( ROLES . APPMANAGEMENT_VIEW ) ,
4245 } ,
4346 {
4447 title : t ( 'content.home.stage.slider2.title' ) ,
@@ -57,6 +60,7 @@ export default function StageSection() {
5760 handleClick : ( ) => {
5861 navigate ( t ( 'content.home.stage.slider3.navigation' ) )
5962 } ,
63+ hasAccess : userHasPortalRole ( ROLES . APPSTORE_VIEW ) ,
6064 } ,
6165 {
6266 title : t ( 'content.home.stage.slider4.title' ) ,
@@ -66,6 +70,7 @@ export default function StageSection() {
6670 handleClick : ( ) => {
6771 navigate ( t ( 'content.home.stage.slider4.navigation' ) )
6872 } ,
73+ hasAccess : userHasPortalRole ( ROLES . USERMANAGEMENT_VIEW ) ,
6974 } ,
7075 ] }
7176 stageHeaderInfo = { [
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export interface HeaderProps {
3131 subTitleTextVariant ?: 'h1' | 'h2' | 'h3'
3232 buttonText ?: string
3333 handleClick : ( ) => void
34+ hasAccess ?: boolean
3435}
3536
3637//TO-DO - Move this component to cx-shared repo after the yarn upgrade
@@ -44,6 +45,7 @@ export const Header = ({
4445 subTitleTextVariant = 'h2' ,
4546 buttonText,
4647 handleClick,
48+ hasAccess,
4749} : HeaderProps ) => {
4850 return (
4951 < Box
@@ -91,6 +93,7 @@ export const Header = ({
9193 onClick = { ( ) => {
9294 handleClick ( )
9395 } }
96+ disabled = { ! ( hasAccess ?? true ) }
9497 >
9598 { buttonText }
9699 </ Button >
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export interface SlidingMainHeaderProps {
2828 subTitle : string
2929 imagePath : string
3030 buttonText : string
31+ hasAccess ?: boolean
3132 handleClick : ( ) => void
3233 } [ ]
3334 autoplay ?: boolean
You can’t perform that action at this time.
0 commit comments