diff --git a/crates/web/frontend/package-lock.json b/crates/web/frontend/package-lock.json index f7673017..f875444d 100644 --- a/crates/web/frontend/package-lock.json +++ b/crates/web/frontend/package-lock.json @@ -21,6 +21,7 @@ "@radix-ui/react-hover-card": "^1.1.2", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-popover": "^1.1.2", + "@radix-ui/react-radio-group": "^1.2.1", "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slider": "^1.2.1", @@ -1464,6 +1465,38 @@ } } }, + "node_modules/@radix-ui/react-radio-group": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.2.1.tgz", + "integrity": "sha512-kdbv54g4vfRjja9DNWPMxKvXblzqbpEC8kspEkZ6dVP7kQksGCn+iZHkcCz2nb00+lPdRvxrqy4WrvvV1cNqrQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-direction": "1.1.0", + "@radix-ui/react-presence": "1.1.1", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-roving-focus": "1.1.0", + "@radix-ui/react-use-controllable-state": "1.1.0", + "@radix-ui/react-use-previous": "1.1.0", + "@radix-ui/react-use-size": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-roving-focus": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.0.tgz", diff --git a/crates/web/frontend/package.json b/crates/web/frontend/package.json index aa23b9f5..2ae25a1f 100644 --- a/crates/web/frontend/package.json +++ b/crates/web/frontend/package.json @@ -24,6 +24,7 @@ "@radix-ui/react-hover-card": "^1.1.2", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-popover": "^1.1.2", + "@radix-ui/react-radio-group": "^1.2.1", "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slider": "^1.2.1", diff --git a/crates/web/frontend/src/components/header/header.tsx b/crates/web/frontend/src/components/header/header.tsx index 0a8ad0bb..be762084 100644 --- a/crates/web/frontend/src/components/header/header.tsx +++ b/crates/web/frontend/src/components/header/header.tsx @@ -6,6 +6,7 @@ import { memo } from "react"; import ExamplesSheet from "../examples-sheet/examples-sheet"; import ShortcutPopup from "../shortcut-popup/shortcut-popup"; import StarCount from "../star-count/star-count"; +import SharePopup from "../share-popup/share-popup"; interface Props { className?: string; @@ -28,6 +29,7 @@ const Header = ({ className, onClickExample }: Props) => {
+
diff --git a/crates/web/frontend/src/components/import-popup/import-popup.tsx b/crates/web/frontend/src/components/import-popup/import-popup.tsx index f90cebe8..280f8f30 100644 --- a/crates/web/frontend/src/components/import-popup/import-popup.tsx +++ b/crates/web/frontend/src/components/import-popup/import-popup.tsx @@ -8,8 +8,8 @@ import { fromString } from "@/model/http-method"; import { type LoadingState, notLoading } from "@/model/loading-state"; import { File, FileUp, Trash } from "lucide-react"; import { type ChangeEvent, useCallback, useMemo, useState } from "react"; -import BodyTab from "../body-tab/body-tab"; -import HeadersTab from "../headers-tab/headers-tab"; +import RequestBodyTab from "../request-body-tab/request-body-tab"; +import RequestHeadersTab from "../request-headers-tab/request-headers-tab"; import { Button } from "../ui/button"; import { Dialog, @@ -211,11 +211,11 @@ const ImportPopup = ({ )} - + {httpMethod === "POST" && ( - + )} diff --git a/crates/web/frontend/src/components/body-tab/body-tab.tsx b/crates/web/frontend/src/components/request-body-tab/request-body-tab.tsx similarity index 93% rename from crates/web/frontend/src/components/body-tab/body-tab.tsx rename to crates/web/frontend/src/components/request-body-tab/request-body-tab.tsx index 89e57367..708689bd 100644 --- a/crates/web/frontend/src/components/body-tab/body-tab.tsx +++ b/crates/web/frontend/src/components/request-body-tab/request-body-tab.tsx @@ -7,12 +7,12 @@ import CodeMirror, { type Extension } from "@uiw/react-codemirror"; import { useCallback, useEffect, useMemo, useState } from "react"; import { formatCode, getCodemirrorExtensionsByFileType } from "../editor/editor-utils"; -interface BodyTabProps { +interface RequestBodyTabProps { body: string; setBody: (body: string) => void; } -const BodyTab = ({ body, setBody }: BodyTabProps) => { +const RequestBodyTab = ({ body, setBody }: RequestBodyTabProps) => { const [focused, setFocused] = useState(false); const { settings: { @@ -67,4 +67,4 @@ const BodyTab = ({ body, setBody }: BodyTabProps) => { ); }; -export default BodyTab; +export default RequestBodyTab; diff --git a/crates/web/frontend/src/components/headers-tab/headers-datalist.tsx b/crates/web/frontend/src/components/request-headers-tab/request-headers-datalist.tsx similarity index 86% rename from crates/web/frontend/src/components/headers-tab/headers-datalist.tsx rename to crates/web/frontend/src/components/request-headers-tab/request-headers-datalist.tsx index 43d2c53b..b2ed02a9 100644 --- a/crates/web/frontend/src/components/headers-tab/headers-datalist.tsx +++ b/crates/web/frontend/src/components/request-headers-tab/request-headers-datalist.tsx @@ -2,7 +2,7 @@ interface HeadersDatalistProps { id: string; } -const HeadersDatalist = ({ id }: HeadersDatalistProps) => { +const RequestHeadersDatalist = ({ id }: HeadersDatalistProps) => { return (