Adrien Béraud | 6ecaa40 | 2021-04-06 17:37:25 -0400 | [diff] [blame] | 1 | import React from 'react'; |
| 2 | |
| 3 | import Typography from '@material-ui/core/Typography'; |
| 4 | |
| 5 | import JamiIdCard from './JamiIdCard'; |
| 6 | import List from '@material-ui/core/List'; |
| 7 | import ListItem from '@material-ui/core/ListItem'; |
| 8 | import ListItemIcon from '@material-ui/core/ListItemIcon'; |
| 9 | import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; |
| 10 | import ListItemText from '@material-ui/core/ListItemText'; |
| 11 | import ListSubheader from '@material-ui/core/ListSubheader'; |
| 12 | import Switch from '@material-ui/core/Switch'; |
| 13 | import PhoneCallbackIcon from '@material-ui/icons/PhoneCallback'; |
| 14 | import GroupRoundedIcon from '@material-ui/icons/GroupRounded'; |
| 15 | import Account from '../../../model/Account'; |
| 16 | |
| 17 | class AccountPreferences extends React.Component { |
| 18 | |
| 19 | render() { |
| 20 | const account = this.props.account |
| 21 | const isJamiAccount = account.getType() === Account.TYPE_JAMI |
| 22 | return ( |
| 23 | <React.Fragment> |
Adrien Béraud | 0cb76c9 | 2021-04-07 19:59:08 -0400 | [diff] [blame^] | 24 | <Typography variant="h2" component="h2">{isJamiAccount ? "Jami account" : "SIP account"}</Typography> |
Adrien Béraud | 6ecaa40 | 2021-04-06 17:37:25 -0400 | [diff] [blame] | 25 | |
| 26 | {isJamiAccount && |
| 27 | <JamiIdCard account={account} />} |
| 28 | |
| 29 | <List subheader={<ListSubheader>Settings</ListSubheader>}> |
| 30 | <ListItem> |
| 31 | <ListItemIcon> |
| 32 | <GroupRoundedIcon /> |
| 33 | </ListItemIcon> |
| 34 | <ListItemText id="switch-list-label-rendezvous" primary="Rendez-Vous point" /> |
| 35 | <ListItemSecondaryAction> |
| 36 | <Switch |
| 37 | edge="end" |
| 38 | /*onChange={handleToggle('wifi')}*/ |
| 39 | checked={account.isRendezVous()} |
| 40 | inputProps={{ 'aria-labelledby': 'switch-list-label-wifi' }} |
| 41 | /> |
| 42 | </ListItemSecondaryAction> |
| 43 | </ListItem> |
| 44 | <ListItem> |
| 45 | <ListItemIcon> |
| 46 | <PhoneCallbackIcon /> |
| 47 | </ListItemIcon> |
| 48 | <ListItemText id="switch-list-label-publicin" primary="Allow connection from unkown peers" /> |
| 49 | <ListItemSecondaryAction> |
| 50 | <Switch |
| 51 | edge="end" |
| 52 | /*onChange={handleToggle('bluetooth')}*/ |
| 53 | checked={account.isPublicIn()} |
| 54 | inputProps={{ 'aria-labelledby': 'switch-list-label-bluetooth' }} |
| 55 | /> |
| 56 | </ListItemSecondaryAction> |
| 57 | </ListItem> |
| 58 | </List> |
| 59 | </React.Fragment>) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | export default AccountPreferences; |