File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { useTranslation } from 'react-i18next' ;
3- import { showModal } from '@openmrs/esm-framework' ;
3+ import { showModal , useConfig } from '@openmrs/esm-framework' ;
4+ import { type Config } from '../config-schema' ;
45
56const Tutorial = ( ) => {
67 const { t } = useTranslation ( ) ;
8+ const config = useConfig ( ) as Config ;
9+ const showTutorial = config ?. showTutorial ;
710
811 const handleOpenModal = ( ) => {
912 const dispose = showModal ( 'tutorial-modal' , {
@@ -12,11 +15,7 @@ const Tutorial = () => {
1215 } ) ;
1316 } ;
1417
15- return (
16- < >
17- < div onClick = { handleOpenModal } > { t ( 'tutorials' , 'Tutorials' ) } </ div >
18- </ >
19- ) ;
18+ return < > { showTutorial && < div onClick = { handleOpenModal } > { t ( 'tutorials' , 'Tutorials' ) } </ div > } </ > ;
2019} ;
2120
2221export default Tutorial ;
You can’t perform that action at this time.
0 commit comments