Front: Typechecking
This commit is contained in:
@@ -2,12 +2,12 @@ import { HStack, Icon, Text } from 'native-base';
|
||||
import { MaterialIcons } from '@expo/vector-icons';
|
||||
|
||||
type DurationComponentProps = {
|
||||
length: number;
|
||||
length: number | undefined;
|
||||
};
|
||||
|
||||
const DurationComponent = ({ length }: DurationComponentProps) => {
|
||||
const minutes = Math.floor(length / 60);
|
||||
const seconds = Math.round(length - minutes * 60);
|
||||
const minutes = Math.floor((length ?? 0) / 60);
|
||||
const seconds = Math.round((length ?? 0) - minutes * 60);
|
||||
|
||||
return (
|
||||
<HStack space={3}>
|
||||
@@ -26,7 +26,7 @@ const DurationComponent = ({ length }: DurationComponentProps) => {
|
||||
}}
|
||||
fontSize={'16px'}
|
||||
>
|
||||
{`${minutes}'${seconds}` ?? "--'--"}
|
||||
{length ? `${minutes}'${seconds}` : "--'--"}
|
||||
</Text>
|
||||
</HStack>
|
||||
);
|
||||
|
||||
@@ -4755,7 +4755,7 @@
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react-native@~0.70.6":
|
||||
"@types/react-native@~0.70.5":
|
||||
version "0.70.14"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.70.14.tgz#8619b8c94296f6456c5362d74a3d1b4fad3f54ab"
|
||||
integrity sha512-Kwc+BYBrnDqvacNxKp1UtcZJnJJnTih2NYmi/ieAKlHdxEPN6sYMwmIwgHdoLHggvml6bf3DYRaH2jt+gzaLjw==
|
||||
@@ -4783,7 +4783,7 @@
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react@*":
|
||||
"@types/react@*", "@types/react@~18.2.0":
|
||||
version "18.2.22"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.22.tgz#abe778a1c95a07fa70df40a52d7300a40b949ccb"
|
||||
integrity sha512-60fLTOLqzarLED2O3UQImc/lsNRgG0jE/a1mPW9KjMemY0LMITWEsbS4VvZ4p6rorEHd5YKxxmMKSDK505GHpA==
|
||||
@@ -4792,15 +4792,6 @@
|
||||
"@types/scheduler" "*"
|
||||
csstype "^3.0.2"
|
||||
|
||||
"@types/react@~18.0.24":
|
||||
version "18.0.38"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.38.tgz#02a23bef8848b360a0d1dceef4432c15c21c600c"
|
||||
integrity sha512-ExsidLLSzYj4cvaQjGnQCk4HFfVT9+EZ9XZsQ8Hsrcn8QNgXtpZ3m9vSIC2MWtx7jHictK6wYhQgGh6ic58oOw==
|
||||
dependencies:
|
||||
"@types/prop-types" "*"
|
||||
"@types/scheduler" "*"
|
||||
csstype "^3.0.2"
|
||||
|
||||
"@types/scheduler@*":
|
||||
version "0.16.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5"
|
||||
@@ -15713,10 +15704,10 @@ react-use-precision-timer@^3.3.1:
|
||||
dependencies:
|
||||
react-sub-unsub "^2.1.6"
|
||||
|
||||
react@18.1.0:
|
||||
version "18.1.0"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-18.1.0.tgz#6f8620382decb17fdc5cc223a115e2adbf104890"
|
||||
integrity sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ==
|
||||
react@18.2.0:
|
||||
version "18.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
|
||||
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user