mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
inital message app
This commit is contained in:
1 parent
e6bb7f39a6
commit
374d4c9269
12 files changed
+284
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import React from 'react'
|
||||
import { InputBase, Paper } from '@material-ui/core';
|
||||
import SearchIcon from "@material-ui/icons/Search";
|
||||
|
||||
import useStyles from './list.styles';
|
||||
|
||||
export const MessageSearch = () => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper elevation={24} variant="outlined" className={classes.bg}>
|
||||
<div className={classes.search}>
|
||||
<div className={classes.searchIcon}>
|
||||
<SearchIcon />
|
||||
</div>
|
||||
<InputBase
|
||||
//onChange={handleChange}
|
||||
placeholder="Search contacts..."
|
||||
classes={{
|
||||
root: classes.inputRoot,
|
||||
input: classes.inputInput,
|
||||
}}
|
||||
inputProps={{ "aria-label": "search" }}
|
||||
/>
|
||||
</div>
|
||||
</Paper>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { List, ListItem, ListItemText, ListItemAvatar, Avatar as MuiAvatar } from '@material-ui/core';
|
||||
import React from 'react'
|
||||
import { useMessageModal } from '../../hooks/useMessageModal';
|
||||
|
||||
import { useMessages } from '../../hooks/useMessages';
|
||||
|
||||
const MessagesList = (): any => {
|
||||
const messages = useMessages();
|
||||
const { setMessageModal } = useMessageModal()
|
||||
return (
|
||||
<List>
|
||||
{messages.map((message) => (
|
||||
<ListItem divider onClick={() => setMessageModal(true)} button key={message.id}>
|
||||
<ListItemAvatar>
|
||||
<MuiAvatar />
|
||||
</ListItemAvatar>
|
||||
<ListItemText secondary="hello, how are...">
|
||||
{message.name}
|
||||
</ListItemText>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
)
|
||||
}
|
||||
|
||||
export default MessagesList;
|
||||
@@ -0,0 +1,55 @@
|
||||
import { makeStyles, fade } from '@material-ui/core';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
bg: {
|
||||
display: "flex",
|
||||
height: 60,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
},
|
||||
textFieldInput: {
|
||||
fontSize: 20,
|
||||
},
|
||||
inputRoot: {
|
||||
fontWeight: 400,
|
||||
fontSize: 18,
|
||||
},
|
||||
inputInput: {
|
||||
padding: theme.spacing(1, 4, 1, 4),
|
||||
// vertical padding + font size from searchIcon
|
||||
transition: theme.transitions.create("width"),
|
||||
width: "100%",
|
||||
|
||||
[theme.breakpoints.up("sm")]: {
|
||||
width: "13ch",
|
||||
"&:focus": {
|
||||
width: "20ch",
|
||||
},
|
||||
},
|
||||
},
|
||||
search: {
|
||||
position: "relative",
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
backgroundColor: fade(theme.palette.common.white, 0.25),
|
||||
"&:hover": {
|
||||
backgroundColor: fade(theme.palette.common.white, 0.25),
|
||||
},
|
||||
marginLeft: 0,
|
||||
width: "100%",
|
||||
[theme.breakpoints.up("sm")]: {
|
||||
marginLeft: theme.spacing(1),
|
||||
width: "auto",
|
||||
},
|
||||
},
|
||||
searchIcon: {
|
||||
padding: theme.spacing(0, 0.5),
|
||||
height: "100%",
|
||||
position: "absolute",
|
||||
pointerEvents: "none",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
},
|
||||
}))
|
||||
|
||||
export default useStyles;
|
||||
Reference in new issue
Block a user