From ffc34a22cdb64665956f86aa44881b111128bc37 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 8 Dec 2021 08:12:29 -0600 Subject: add ShrinkableButton --- src/web/src/components/Shared/ShrinkableButton.js | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/web/src/components/Shared/ShrinkableButton.js (limited to 'src/web') diff --git a/src/web/src/components/Shared/ShrinkableButton.js b/src/web/src/components/Shared/ShrinkableButton.js new file mode 100644 index 00000000..c5a96849 --- /dev/null +++ b/src/web/src/components/Shared/ShrinkableButton.js @@ -0,0 +1,30 @@ +import React from 'react'; + +import { useMediaQuery } from 'react-responsive'; +import { Button, Icon, Popup } from 'semantic-ui-react'; + +const ShrinkableButton = ({ iconName, mediaQuery, children, ...rest }) => { + const shouldShrink = useMediaQuery({ query: mediaQuery }) + + if (!shouldShrink) { + return ( + + ) + } + + return ( + + + + } + /> + ) +} + +export default ShrinkableButton; \ No newline at end of file -- cgit v1.2.3