Skip to content

Commit

Permalink
Fix CLI warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtom committed May 11, 2022
1 parent ad93883 commit c540681
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/components/CollectCardDetails/CollectCardDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useState, useCallback, useEffect } from "react";
import Styles from "./CollectCardDetails.module.scss";
import { Formik, Form, FormikProps, Field } from "formik";
import * as Yup from "yup";
Expand Down Expand Up @@ -65,7 +64,7 @@ const CollectCardDetails: React.FC<CardDetailsProps> = ({
setShowInput,
setCardDetails,
}) => {
const [value, setValue] = useStickyState({}, "cardDetails");
const [, setValue] = useStickyState({}, "cardDetails");
return (
<div className={Styles["CollectCardDetails"]}>
<header className={Styles["CollectCardDetails--acceptedCards"]}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { icons } from "../../utils/icon";
import "./icon.module.scss";
import { CardType, IconType } from "../../utils/types";
import { IconType } from "../../utils/types";

interface IconProps {
iconName: IconType;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ interface InputProps {
}

const Input: React.FC<InputProps> = ({ ...props }) => {
const [field, meta, helpers] = useField(props);
const [field, meta] = useField(props);

const isError = Boolean(meta.error && meta.touched);
const applyBorder = {
border: "1px solid red",
};

const [active, setActive] = useState(false);
const [, setActive] = useState(false);

const inputType = props.type;

Expand Down
5 changes: 2 additions & 3 deletions src/helpers/FormatString.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const formatString = (event: any) => {
var inputChar = String.fromCharCode(event.keyCode);
var code = event.keyCode;
var allowedKeys = [8];
if (allowedKeys.indexOf(code) !== -1) {
Expand All @@ -8,7 +7,7 @@ export const formatString = (event: any) => {

event.target.value = event.target.value
.replace(
/^([1-9]\/|[2-9])$/g,
/^([1-9]|[2-9])$/g,
"0$1/" // 3 > 03/
)
.replace(
Expand All @@ -24,7 +23,7 @@ export const formatString = (event: any) => {
"$1/$2" // 141 > 01/41
)
.replace(
/^([0]+)\/|[0]+$/g,
/^([0]+)|[0]+$/g,
"0" // 0/ > 0 and 00 > 0
)
.replace(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Checkout/Checkout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect } from "react";
import { useState } from "react";
import Button from "../../components/Button/Button";
import { Link, Navigate, useNavigate } from "react-router-dom";
import Header from "../../components/Header/Header";
Expand Down
14 changes: 7 additions & 7 deletions src/pages/Show/Show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ function Show() {

const handleTicketChange = (e: React.ChangeEvent<any>) => {
setTicketValue(e.target.value);
if (e.target.value == 1) setFees(450);
else if (e.target.value == 2) setFees(900);
else if (e.target.value == 3) setFees(1350);
else if (e.target.value == 4) setFees(1800);
else if (e.target.value == 5) setFees(2250);
if (Number(e.target.value) === 1) setFees(450);
else if (Number(e.target.value) === 2) setFees(900);
else if (Number(e.target.value) === 3) setFees(1350);
else if (Number(e.target.value) === 4) setFees(1800);
else if (Number(e.target.value) === 5) setFees(2250);
};

const handleCheckout = () => {
Expand Down Expand Up @@ -135,7 +135,7 @@ function Show() {
<p>
$
{numberWithCommas(
Number(parseFloat(show.ticketPrice) + fees)
Number(parseInt(show.ticketPrice) + fees)
)}
</p>
</section>
Expand All @@ -147,7 +147,7 @@ function Show() {
<h3>
$
{numberWithCommas(
Number(parseFloat(show.ticketPrice) + fees)
Number(parseInt(show.ticketPrice) + fees)
)}
</h3>
</div>
Expand Down

0 comments on commit c540681

Please sign in to comment.