mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Feat: Dial section
Still WIP
This commit is contained in:
1 parent
5a9707ae3c
commit
d6e9a85b40
8 files changed
+221
-4
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import React, { useState } from 'react';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import DialGrid from '../DialPadGrid';
|
||||
import { DialerInput } from '../DialerInput';
|
||||
import ContactSearch from '../ContactSearch';
|
||||
import { DialInputCtx } from '../../context/InputContext';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
root: {
|
||||
width: '100%',
|
||||
minHeight: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
},
|
||||
}));
|
||||
|
||||
const DialPage = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
const [inputVal, setInputVal] = useState('');
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<DialInputCtx.Provider
|
||||
value={{
|
||||
inputVal,
|
||||
add: (val: string) => setInputVal(inputVal + val),
|
||||
removeOne: () => setInputVal(inputVal.slice(0, -1)),
|
||||
clear: () => setInputVal(''),
|
||||
}}
|
||||
>
|
||||
<ContactSearch />
|
||||
<DialerInput />
|
||||
<DialGrid />
|
||||
</DialInputCtx.Provider>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default DialPage;
|
||||
Reference in new issue
Block a user