@grantbii/design-system 1.0.66 → 1.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Colors, GrantMatch } from "@/.";
3
- import { useGrantMatchQueryItems } from "@/core/organisms/GrantMatch";
2
+ import { GrantMatch } from "@/.";
3
+ import { useGrantMatchActiveQuery } from "@/core/organisms/GrantMatch";
4
4
  import { useState } from "react";
5
5
  import styled from "styled-components";
6
- const GrantMatchExample = ({ isMobile }) => {
6
+ const GrantMatchExample = () => {
7
7
  const [status, setStatus] = useState("pending query");
8
8
  const performGrantMatch = (newQuery) => {
9
9
  const fileNames = newQuery.files.map((file) => file.name).join(", ");
10
- setStatus(`finding grants using files [${fileNames}] and text [${newQuery.text}]`);
11
- setTimeout(() => setStatus("found grants"), 3000);
10
+ const printableQuery = `files [${fileNames}] and text [${newQuery.text}]`;
11
+ setStatus(`finding grants using ${printableQuery}`);
12
+ setTimeout(() => setStatus(`found grants with ${printableQuery}`), 3000);
12
13
  };
13
14
  const resetGrantMatch = () => setStatus("pending query");
14
- const grantMatchQueryProps = useGrantMatchQueryItems(performGrantMatch, resetGrantMatch);
15
- return (_jsxs(Container, { "$isMobile": isMobile, children: [_jsx(GrantMatch, Object.assign({}, grantMatchQueryProps, { isSmallerThanLaptop: isMobile })), _jsxs("p", { children: ["Status: ", status] })] }));
15
+ const grantMatchQueryProps = useGrantMatchActiveQuery({}, performGrantMatch, resetGrantMatch);
16
+ return (_jsxs(Container, { children: [_jsx(GrantMatch, Object.assign({}, grantMatchQueryProps)), _jsxs("p", { children: ["Status: ", status] })] }));
16
17
  };
17
18
  const Container = styled.div `
18
19
  display: flex;
@@ -20,13 +21,12 @@ const Container = styled.div `
20
21
  gap: 8px;
21
22
 
22
23
  padding: 16px;
23
-
24
- width: ${({ $isMobile = false }) => ($isMobile ? "360px" : "90vw")};
25
- height: ${({ $isMobile = false }) => ($isMobile ? "600px" : "100vh")};
26
-
27
- border: ${({ $isMobile = false }) => $isMobile ? `1px solid ${Colors.neutral.grey2}` : "none"};
28
- border-radius: 32px;
29
24
  `;
25
+ // width: ${({ $screenSize }) => ($screenSize === "small" ? "360px" : "90vw")};
26
+ // height: ${({ $screenSize }) => ($screenSize === "small" ? "600px" : "100vh")};
27
+ // border: ${({ $screenSize }) =>
28
+ // $screenSize === "small" ? `1px solid ${Colors.neutral.grey2}` : "none"};
29
+ // border-radius: 32px;
30
30
  const meta = {
31
31
  title: "Organisms/Grant Match",
32
32
  component: GrantMatchExample,
@@ -36,9 +36,6 @@ const meta = {
36
36
  },
37
37
  };
38
38
  export default meta;
39
- export const Desktop = {
40
- args: { isMobile: false },
41
- };
42
- export const Mobile = {
43
- args: { isMobile: true },
39
+ export const Example = {
40
+ args: {},
44
41
  };