From bef1c3328b098a2cffc31acc91340a2f336e027b Mon Sep 17 00:00:00 2001 From: Lucas Guild Date: Wed, 12 Jun 2019 13:58:12 -0400 Subject: [PATCH] update to 1.0.2 (#3) --- Makefile | 8 +++----- README.md | 2 +- client/package-lock.json | 2 +- client/package.json | 3 +-- client/src/components/Banner.jsx | 4 ++-- client/src/components/LinkButton.jsx | 2 +- client/src/components/MoreDetails.jsx | 20 +++++++++--------- client/src/hooks/index.js | 1 + client/src/hooks/useOnClickOutside.js | 29 +++++++++++++++++++++++++++ docker-compose.yml | 6 +++--- server/README.md | 2 +- server/package-lock.json | 2 +- server/package.json | 2 +- version.sh | 4 ++-- wait-for-client.sh | 14 +++++++------ 15 files changed, 65 insertions(+), 36 deletions(-) create mode 100644 client/src/hooks/useOnClickOutside.js diff --git a/Makefile b/Makefile index f063e0b9..c34401f6 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ help: @echo ' make ' @echo '' @echo 'Targets:' - @awk '/^[a-zA-Z\-\_0-9]+:/ { \ + @awk '/^[a-zA-Z_0-9-]+:/ { \ helpMessage = match(lastLine, /^## (.*)/); \ if (helpMessage) { \ helpCommand = substr($$1, 0, index($$1, ":")-1); \ @@ -59,13 +59,11 @@ logs: ## Stop the services stop: docker-compose down - docker volume rm $(current_dir)_client_node_modules || true - docker volume rm $(current_dir)_server_node_modules || true + docker volume rm $(current_dir)_{client,server}_node_modules 2>/dev/null || true ## Clear the sandbox and development databases clear-db: stop - docker volume rm $(current_dir)_pg_sandbox_data || true - docker volume rm $(current_dir)_pg_development_data || true + docker volume rm $(current_dir)_pg_{sandbox,development}_data 2>/dev/null || true $(envfile): @echo "Error: .env file does not exist! See the README for instructions." diff --git a/README.md b/README.md index 89d1f061..cc4d13da 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Plaid Pattern +# Plaid Pattern (Beta) ![Plaid Pattern client][client-img] diff --git a/client/package-lock.json b/client/package-lock.json index 953d7de5..a705d03d 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,6 +1,6 @@ { "name": "client", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/client/package.json b/client/package.json index 46b5b92d..7610d364 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "client", - "version": "1.0.1", + "version": "1.0.2", "private": true, "dependencies": { "axios": "^0.18.0", @@ -8,7 +8,6 @@ "prop-types": "^15.7.2", "react": "^16.8.6", "react-dom": "^16.8.6", - "react-onclickoutside": "^6.8.0", "react-router-dom": "^5.0.0", "react-scripts": "3.0.1", "react-toastify": "^5.1.0", diff --git a/client/src/components/Banner.jsx b/client/src/components/Banner.jsx index ff19dfd9..7d7642eb 100644 --- a/client/src/components/Banner.jsx +++ b/client/src/components/Banner.jsx @@ -18,7 +18,7 @@ const Banner = ({ initialSubheading }) => { const successText = 'Success! You can explore account and transaction details for the linked item'; - const subdeadingText = initialSubheading ? initialText : successText; + const subheadingText = initialSubheading ? initialText : successText; return (

- {subdeadingText} + {subheadingText}

); diff --git a/client/src/components/LinkButton.jsx b/client/src/components/LinkButton.jsx index 2981d339..4653c91a 100644 --- a/client/src/components/LinkButton.jsx +++ b/client/src/components/LinkButton.jsx @@ -28,7 +28,7 @@ export default function LinkButton({ const { linkHandlers, getLinkHandler } = useLink(); const isPrimary = primary ? 'button--is-primary' : ''; - const classlist = altClasses !== undefined ? altClasses : ''; + const classlist = altClasses !== null ? altClasses : ''; useEffect(() => { getLinkHandler({ userId, itemId }); diff --git a/client/src/components/MoreDetails.jsx b/client/src/components/MoreDetails.jsx index aa710d8b..e7f2ebea 100644 --- a/client/src/components/MoreDetails.jsx +++ b/client/src/components/MoreDetails.jsx @@ -1,7 +1,7 @@ -import React, { useState } from 'react'; +import React, { useState, useRef } from 'react'; import PropTypes from 'prop-types'; -import onClickOutside from 'react-onclickoutside'; import { IconDots, Button, LinkButton } from '.'; +import { useOnClickOutside } from '../hooks'; const propTypes = { handleDelete: PropTypes.func.isRequired, @@ -23,19 +23,23 @@ export function MoreDetails({ itemId, }) { const [menuShown, setmenuShown] = useState(false); - - MoreDetails.handleClickOutside = () => setmenuShown(false); + const refToButton = useRef(); + const refToMenu = useOnClickOutside({ + callback: () => setmenuShown(false), + ignoreRef: refToButton, + }); return (
{menuShown && ( -
+
{setBadStateShown && (