mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Time has been changed to a relative format. Locale specifics are pending merge of #168. Several typos have been fixed where "DAILER" was referenced instead of "DIALER" A translation key was added for when a user has no call history. The input box has been unlocked so users can use their keyboard directly rather than using the dial pad.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import React, { useState } from 'react';
|
|
import { makeStyles, Theme } from '@material-ui/core/styles';
|
|
import DialGrid from '../DialPadGrid';
|
|
import { DialerInput } from '../DialerInput';
|
|
import { DialInputCtx } from '../../context/InputContext';
|
|
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
|
|
|
|
const useStyles = makeStyles((theme: Theme) => ({
|
|
root: {
|
|
width: '100%',
|
|
minHeight: '100%',
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
},
|
|
}));
|
|
|
|
const DialPage = () => {
|
|
const classes = useStyles();
|
|
const query = useQueryParams();
|
|
const queryNumber = query.number;
|
|
const [inputVal, setInputVal] = useState(queryNumber || '');
|
|
|
|
return (
|
|
<div className={classes.root}>
|
|
<DialInputCtx.Provider
|
|
value={{
|
|
inputVal,
|
|
add: (val: string) => setInputVal(inputVal + val),
|
|
removeOne: () => setInputVal(inputVal.slice(0, -1)),
|
|
clear: () => setInputVal(''),
|
|
set: (val: string) => setInputVal(val),
|
|
}}
|
|
>
|
|
<DialerInput />
|
|
<DialGrid />
|
|
</DialInputCtx.Provider>
|
|
</div>
|
|
);
|
|
};
|
|
export default DialPage;
|