-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MALI-1458] Get feature list changes
- Loading branch information
1 parent
1cf26ef
commit 63a59f4
Showing
6 changed files
with
150 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
|
||
import { makeStyles } from '@material-ui/core'; | ||
import MiniApp from 'js-miniapp-sdk'; | ||
import ListItem from '@mui/material/ListItem'; | ||
import ListItemButton from '@mui/material/ListItemButton'; | ||
import ListItemIcon from '@mui/material/ListItemIcon'; | ||
import ListItemText from '@mui/material/ListItemText'; | ||
import Brightness1Icon from '@mui/icons-material/Brightness1'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
content: { | ||
height: '25%', | ||
justifyContent: 'center', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
fontSize: 18, | ||
color: theme.color.primary, | ||
fontWeight: 'bold', | ||
}, | ||
card: { | ||
marginTop: '40px', | ||
}, | ||
actions: { | ||
justifyContent: 'center', | ||
flexDirection: 'column', | ||
}, | ||
button: { | ||
marginTop: '20px', | ||
width: '80%', | ||
maxWidth: 280, | ||
}, | ||
textfield: { | ||
width: '80%', | ||
maxWidth: 300, | ||
'& input': { | ||
color: theme.color.primary, | ||
lineHeight: '1.5em', | ||
fontSize: '1.2em', | ||
background: 'white', | ||
}, | ||
}, | ||
})); | ||
|
||
function FeatureListComponent() { | ||
const classes = useStyles(); | ||
const [featureList, setFeatureList] = useState(); | ||
useEffect(() => { | ||
try { | ||
getFeatureList(); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
}); | ||
|
||
function getFeatureList() { | ||
console.log('getFeatureList') | ||
MiniApp.miniappUtils | ||
.getFeatureList() | ||
.then((response) => { | ||
setFeatureList(test); | ||
console.log('getFeatureList SUCCESS: ', response); | ||
}) | ||
.catch((error) => { | ||
console.log('getFeatureList ERROR: ', error); | ||
}); | ||
} | ||
|
||
return ( | ||
<div className={classes.card}> | ||
{featureList && | ||
featureList.map((item) => ( | ||
<ListItem disablePadding> | ||
<ListItemButton> | ||
<ListItemIcon> | ||
<Brightness1Icon /> | ||
</ListItemIcon> | ||
<ListItemText primary={item} /> | ||
</ListItemButton> | ||
</ListItem> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export default FeatureListComponent; |
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
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