From 7e79e886b820275876a1c9151383961120d7c85a Mon Sep 17 00:00:00 2001 From: Leroy Betterton Gage <116683456+LeroyBG@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:39:29 -0700 Subject: [PATCH] Convert ViewportAwareButton JS files to TypeScript (#1094) * convert to typescript * rename vanilla js files * re-style ViewportAwareButtonProps, revert test --------- Co-authored-by: Michael Lan --- ...{ViewportAwareButton.js => ViewportAwareButton.tsx} | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) rename src/components/common/{ViewportAwareButton.js => ViewportAwareButton.tsx} (78%) diff --git a/src/components/common/ViewportAwareButton.js b/src/components/common/ViewportAwareButton.tsx similarity index 78% rename from src/components/common/ViewportAwareButton.js rename to src/components/common/ViewportAwareButton.tsx index 3a318dd3..4b2aa2a1 100644 --- a/src/components/common/ViewportAwareButton.js +++ b/src/components/common/ViewportAwareButton.tsx @@ -9,7 +9,15 @@ import { Button } from 'reactstrap'; /** --------Optional props-------- * any props you would apply to a reactstrap Button. */ -const ViewportAwareButton = function (props) { + +interface ViewportAwareButtonProps{ + icon: React.JSX.Element, + text: string, + isSmall: boolean, + remainder: any, +}; + +const ViewportAwareButton = function (props : ViewportAwareButtonProps) { // extract icon and text from props. const { icon, text, isSmall, ...remainder