Skip to content

Commit

Permalink
Update create-barcode.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhanshumonga committed Jul 26, 2020
1 parent 1d2368a commit 3dd3b71
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions components/create-barcode/create-barcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ import moment from 'moment'
export default function CreateBarcode() {
const image = React.useRef(null);
const [name, setName] = React.useState("");
const [randomNum, setRandomNum] = React.useState(
Math.floor(Math.random() * 1000)
);
const [barcode, setBarcode] = React.useState(null);
const [prints, setNumberOfPrints] = React.useState(0);

Expand All @@ -33,8 +30,7 @@ export default function CreateBarcode() {
// const [hasPermission, setHasPermission] = React.useState(null);

const genrateBarcode = () => {
setRandomNum(Math.floor(Math.random() * 1000));
setBarcode(name.substr(0, 3).toUpperCase() + randomNum + moment(new Date()).format('DDMMYY'));
setBarcode(name);
Keyboard.dismiss();
};

Expand Down Expand Up @@ -132,7 +128,8 @@ export default function CreateBarcode() {
<Input
value={name}
onChangeText={(text) => changeName(text)}
placeholder="Enter Customer Name"
placeholder="Enter Customer ID"
maxLength={12}
/>
<Input
keyboardType="number-pad"
Expand Down

0 comments on commit 3dd3b71

Please sign in to comment.