-
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.
Merge branch 'master' into dependabot/npm_and_yarn/ip-1.1.9
- Loading branch information
Showing
8 changed files
with
283 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
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', | ||
}, | ||
}, | ||
scrollable: { | ||
overflowY: 'auto', | ||
width: '100%', | ||
paddingBottom: 20, | ||
}, | ||
})); | ||
|
||
function FeatureListComponent() { | ||
const classes = useStyles(); | ||
const [featureList, setFeatureList] = useState(); | ||
useEffect(() => { | ||
try { | ||
getFeatureList(); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
}); | ||
|
||
function getFeatureList() { | ||
MiniApp.miniappUtils | ||
.getFeatureList() | ||
.then((response) => { | ||
setFeatureList(response); | ||
console.log('getFeatureList SUCCESS: ', response); | ||
}) | ||
.catch((error) => { | ||
console.log('getFeatureList ERROR: ', error); | ||
}); | ||
} | ||
|
||
return ( | ||
<div className={classes.scrollable}> | ||
{featureList && | ||
featureList.map((item) => ( | ||
<ListItem key={item} 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
Oops, something went wrong.