diff --git a/src/common/routes/preferences.ts b/src/common/routes/preferences.ts index 1dfd2279d4..882a8a10f0 100644 --- a/src/common/routes/preferences.ts +++ b/src/common/routes/preferences.ts @@ -42,6 +42,10 @@ export const installRoute: RouteProps = { path: `${preferencesRoute.path}/install`, }; +export const extensionPageRoute: RouteProps = { + path: `${preferencesRoute.path}/extension/:extensionId?`, +}; + export const preferencesURL = buildURL(preferencesRoute.path); export const appURL = buildURL(appRoute.path); export const proxyURL = buildURL(proxyRoute.path); @@ -51,3 +55,4 @@ export const telemetryURL = buildURL(telemetryRoute.path); export const extensionURL = buildURL(extensionRoute.path); export const terminalURL = buildURL(terminalRoute.path); export const installURL = buildURL(installRoute.path); +export const extensionPageURL = buildURL<{ extensionId?: string }>(extensionPageRoute.path); diff --git a/src/renderer/components/+preferences/extension-page.module.scss b/src/renderer/components/+preferences/extension-page.module.scss new file mode 100644 index 0000000000..361532b3fa --- /dev/null +++ b/src/renderer/components/+preferences/extension-page.module.scss @@ -0,0 +1,32 @@ +.contents { + display: grid; + grid-template-columns: 1fr 30%; +} + +.metadata { + h3 { + font-size: 1.5rem; + margin: 0; + padding: 0; + } + + .links { + display: flex; + gap: 8px; + flex-wrap: wrap; + + a { + border: 1px solid rgb(72, 72, 72); + padding: 4px 6px; + border-radius: 3px; + font-size: 13px; + color: #333; + margin: 0 6px 4px 0; + display: inline-block; + + &:hover { + background-color: var(--blue); + } + } + } +} \ No newline at end of file diff --git a/src/renderer/components/+preferences/extension-page.tsx b/src/renderer/components/+preferences/extension-page.tsx new file mode 100644 index 0000000000..a54ec874b3 --- /dev/null +++ b/src/renderer/components/+preferences/extension-page.tsx @@ -0,0 +1,63 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ + +import styles from "./extension-page.module.scss"; + +import React, { useEffect, useState } from "react"; +import { Extension, getExtensionById } from "./extension-list"; +import { Spinner } from "../spinner"; +import { ExtensionCard } from "./extension-card"; +import { useParams } from "react-router"; + +export function ExtensionPage() { + const [extension, setExtension] = useState(null); + const { id } = useParams<{ id?: string }>(); + + useEffect(() => { + async function fetchExtension() { + try { + const response = await getExtensionById(id); + + setExtension(response); + } catch (error) { + console.error(error); + } + } + + fetchExtension(); + }, []); + + if (!extension) { + return ; + } + + return ( +
+ +
+
+
+ GitHub description +
+
+

Categories

+
+ {extension.category.map(category => ( + {category.name} + ))} +
+

Tags

+
+ {extension.tags.map(tag => ( + {tag.name} + ))} +
+

More Info

+
+
+
+
+ ); +}