diff --git a/app/page.tsx b/app/page.tsx index b61ee47..b35992e 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,10 +1,8 @@ -import InputForm from "@/components/InputForm"; import ClientOnly from "@/components/ClientOnly"; import { Card, CardContent, CardDescription, - CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; @@ -13,18 +11,10 @@ import FormContainer from "@/components/FormContainer"; export default function Home() { return (
-
- - - M-OAuth - Card Description - - - - - - - +
+ + +
); diff --git a/components/FormContainer.tsx b/components/FormContainer.tsx index 465f8a1..d849bdb 100644 --- a/components/FormContainer.tsx +++ b/components/FormContainer.tsx @@ -3,13 +3,19 @@ import { useState } from "react"; import InputForm from "@/components/InputForm"; import ResultTable from "@/components/tables/ResultTable"; import useCreateApp from "@/hooks/useCreateApp"; - +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; import { FormSchema } from "@/components/InputForm"; export type AppInfo = Pick; const FormContainer = () => { - const { credentials, createApp } = useCreateApp() + const { credentials, createApp } = useCreateApp(); const [appInfo, setAppInfo] = useState({ instanceUrl: "", @@ -18,9 +24,25 @@ const FormContainer = () => { return ( <> - + + + M-OAuth + Card Description + + + + + {credentials && ( - + + + Result + Card Description + + + + + )} ); diff --git a/components/tables/ResultTable.tsx b/components/tables/ResultTable.tsx index 9450e2a..75050d4 100644 --- a/components/tables/ResultTable.tsx +++ b/components/tables/ResultTable.tsx @@ -12,10 +12,11 @@ import { import { Credentials } from "@/lib/types"; import { CopyButton } from "@/components/ui/copybutton"; import { Button } from "@/components/ui/button"; +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { ExternalLink } from "lucide-react"; import { getAuth } from "@/lib/utils"; import { AppInfo } from "../FormContainer"; - +import { KeyRound } from "lucide-react"; interface ResultTableProps { credentials: Credentials; appInfo: AppInfo; @@ -43,8 +44,9 @@ const ResultTable: React.FC = ({ credentials, appInfo }) => { vapid_key, } = credentials; + const isLocal = redirect_uri === "urn:ietf:wg:oauth:2.0:oob"; return ( -
+
@@ -64,11 +66,20 @@ const ResultTable: React.FC = ({ credentials, appInfo }) => { )}
- {redirect_uri === "urn:ietf:wg:oauth:2.0:oob" && ( - diff --git a/package.json b/package.json index 63fb19b..6e04373 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,7 @@ "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-collapsible": "^1.0.3", "@radix-ui/react-label": "^2.0.2", - "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", - "@radix-ui/react-tabs": "^1.0.4", "@types/node": "20.2.5", "@types/react": "18.2.7", "@types/react-dom": "18.2.4", @@ -25,7 +23,7 @@ "class-variance-authority": "^0.6.0", "clsx": "^1.2.1", "eslint-config-next": "13.4.4", - "lucide-react": "^0.230.0", + "lucide-react": "^0.240.0", "masto": "^5.11.3", "next": "13.4.4", "postcss": "^8.4.24", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7fc1690..4bac59e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,15 +13,9 @@ dependencies: '@radix-ui/react-label': specifier: ^2.0.2 version: 2.0.2(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-separator': - specifier: ^1.0.3 - version: 1.0.3(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-slot': specifier: ^1.0.2 version: 1.0.2(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-tabs': - specifier: ^1.0.4 - version: 1.0.4(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) '@types/node': specifier: 20.2.5 version: 20.2.5 @@ -44,8 +38,8 @@ dependencies: specifier: 13.4.4 version: 13.4.4(eslint@8.41.0)(typescript@5.0.4) lucide-react: - specifier: ^0.230.0 - version: 0.230.0(react@18.2.0) + specifier: ^0.240.0 + version: 0.240.0(react@18.2.0) masto: specifier: ^5.11.3 version: 5.11.3 @@ -398,30 +392,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-collection@1.0.3(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - dependencies: - '@babel/runtime': 7.22.3 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.2.7)(react@18.2.0) - '@types/react': 18.2.7 - '@types/react-dom': 18.2.4 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - /@radix-ui/react-compose-refs@1.0.1(@types/react@18.2.7)(react@18.2.0): resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==} peerDependencies: @@ -450,20 +420,6 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-direction@1.0.1(@types/react@18.2.7)(react@18.2.0): - resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@babel/runtime': 7.22.3 - '@types/react': 18.2.7 - react: 18.2.0 - dev: false - /@radix-ui/react-id@1.0.1(@types/react@18.2.7)(react@18.2.0): resolution: {integrity: sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==} peerDependencies: @@ -543,56 +499,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-roving-focus@1.0.4(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - dependencies: - '@babel/runtime': 7.22.3 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@types/react': 18.2.7 - '@types/react-dom': 18.2.4 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - - /@radix-ui/react-separator@1.0.3(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - dependencies: - '@babel/runtime': 7.22.3 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.7 - '@types/react-dom': 18.2.4 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - /@radix-ui/react-slot@1.0.2(@types/react@18.2.7)(react@18.2.0): resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==} peerDependencies: @@ -608,34 +514,6 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-tabs@1.0.4(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-egZfYY/+wRNCflXNHx+dePvnz9FbmssDTJBtgRfDY7e8SE5oIo3Py2eCB1ckAbh1Q7cQ/6yJZThJ++sgbxibog==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - dependencies: - '@babel/runtime': 7.22.3 - '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-context': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-direction': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-roving-focus': 1.0.4(@types/react-dom@18.2.4)(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.7)(react@18.2.0) - '@types/react': 18.2.7 - '@types/react-dom': 18.2.4 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - /@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.2.7)(react@18.2.0): resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} peerDependencies: @@ -2458,8 +2336,8 @@ packages: yallist: 4.0.0 dev: false - /lucide-react@0.230.0(react@18.2.0): - resolution: {integrity: sha512-/Cbul7Jfq6aZ2RIsYZXH1jWkUVEP3lK8d5uBcggxf0u1oSkPcfKo/PIXhya5HEpmuA/RO6NmuNp3moOVloQEdA==} + /lucide-react@0.240.0(react@18.2.0): + resolution: {integrity: sha512-75lFCbrvSs1ixJUwDN2XLcUTMUIRV8bN/TrBjZdcGHIZNoczLQRnb7zJSvzZhCFyMymT6pXNBB61oaE1JerlrA==} peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 dependencies: