Add end adornment icon to refresh the room uuid() (#62)

* Add end adornment icon to refresh room uuid()
* Make mobile compatible
This commit is contained in:
krayste 2022-11-06 02:40:42 +11:00 committed by GitHub
parent 8947bace94
commit 237fc0e6df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@ import Divider from '@mui/material/Divider'
import IconButton from '@mui/material/IconButton'
import MuiLink from '@mui/material/Link'
import GitHubIcon from '@mui/icons-material/GitHub'
import Cached from '@mui/icons-material/Cached'
import Tooltip from '@mui/material/Tooltip'
import { v4 as uuid } from 'uuid'
@ -69,6 +70,18 @@ export function Home({ userId }: HomeProps) {
variant="outlined"
value={roomName}
onChange={handleRoomNameChange}
InputProps={{
endAdornment: (
<IconButton
aria-label="Regenerate room id"
onClick={() => setRoomName(uuid())}
size="small"
>
<Cached />
</IconButton>
),
sx: { fontSize: { xs: '0.9rem', sm: '1rem' } },
}}
size="medium"
/>
</Tooltip>