Skip to content

Commit

Permalink
Phone Input (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: sajmalyousef <[email protected]>
  • Loading branch information
akashkbaburajan and sajmalyousef authored Apr 25, 2020
1 parent a23c315 commit d41a404
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/simplQ-frontend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 81 additions & 0 deletions simplq/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions simplq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"react": "^16.13.1",
"react-copy-to-clipboard": "^5.0.2",
"react-dom": "^16.13.1",
"react-phone-input-2": "^2.13.3",
"react-phone-number-input": "^3.0.22",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1"
},
Expand Down
36 changes: 27 additions & 9 deletions simplq/src/components/page/JoinQueue.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import React from "react";
import React, { useState } from "react";
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import CentralSection from "../CentralSection";
import PhoneInput from 'react-phone-input-2';
import 'react-phone-input-2/lib/material.css';
import { makeStyles } from '@material-ui/core/styles';

const useStyles = makeStyles((theme) => ({
textField: {
marginTop: theme.spacing(2)
}
}));

function JoinQueue(props) {
const [value, setValue] = useState();
const classes = useStyles();

return <CentralSection heading="Join Queue">
<TextField
placeholder="Your Name"
Expand All @@ -14,17 +26,23 @@ function JoinQueue(props) {
shrink: true,
}}
variant="outlined"
inputStyle="material"
/>
<TextField
<PhoneInput
containerClass={classes.textField}
placeholder="Contact Number"
fullWidth
required
margin="normal"
InputLabelProps={{
shrink: true,
country={'in'}
value={value}
inputProps={{
name: 'phone',
required: true,
autoFocus: true

}}
variant="outlined"
/>
inputStyle={{
width: '100%'
}}
onChange={setValue} />
<div style={{ display: "flex", justifyContent: 'flex-end' }}>
<Button variant="contained" color="primary" style={{
marginTop: 30,
Expand Down
1 change: 0 additions & 1 deletion simplq/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import ReactDOM from 'react-dom';
import './index.css';
import Layout from './components/Layout';
import * as serviceWorker from './serviceWorker';
import Routes from './components/Routes';
import {
BrowserRouter as Router
} from "react-router-dom";
Expand Down

0 comments on commit d41a404

Please sign in to comment.