diff --git a/frontend/islands/CopyButton.tsx b/frontend/islands/CopyButton.tsx index cf701f97..c14331dc 100644 --- a/frontend/islands/CopyButton.tsx +++ b/frontend/islands/CopyButton.tsx @@ -6,6 +6,7 @@ import { TbCheck, TbCopy } from "tb-icons"; interface CopyButtonProps { title: string; text: string; + class?: string; } export function CopyButton(props: CopyButtonProps) { @@ -32,7 +33,9 @@ export function CopyButton(props: CopyButtonProps) { class={(copied.value ? "text-green-700 dark:text-green-500" : "text-jsr-gray-700 dark:text-gray-300") + - " hover:bg-jsr-gray-100/30 dark:hover:bg-jsr-gray-700/50 p-1.5 -mx-1.5 -my-1 rounded-full"} + ` hover:bg-jsr-gray-100/30 dark:hover:bg-jsr-gray-700/50 p-1.5 -mx-1.5 -my-1 rounded-full ${ + props.class ?? "" + }`} > {copied.value ? : } diff --git a/frontend/routes/package/publish.tsx b/frontend/routes/package/publish.tsx index a1a5518f..7b095273 100644 --- a/frontend/routes/package/publish.tsx +++ b/frontend/routes/package/publish.tsx @@ -1,4 +1,5 @@ // Copyright 2024 the JSR authors. All rights reserved. MIT license. +// deno-lint-ignore-file react-no-danger import { HttpError, RouteConfig } from "fresh"; import type { FullUser, Package } from "../../utils/api_types.ts"; import { define } from "../../util.ts"; @@ -160,6 +161,25 @@ export default define.page(function PackagePage({ ); }); +const WORKFLOW_CODE = `\ +name: Publish +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Publish package + run: npx jsr publish +`; + function GitHubActions({ pkg, canEdit, user }: { pkg: Package; canEdit: boolean; @@ -244,27 +264,15 @@ function GitHubActions({ pkg, canEdit, user }: { title="Copy workflow path" /> -
-        
-          {`\
-name: Publish
-on:
-  push:
-    branches:
-      - main
-
-jobs:
-  publish:
-    runs-on: ubuntu-latest
-\n`}
-          {`    permissions:\n`}
-          {`      contents: read\n`}
-          {`      id-token: write\n`}
-          {`
-    steps:
-      - uses: actions/checkout@v4\n\n`}
-          {`      - name: Publish package\n`}
-          {`        run: npx jsr publish\n`}
+      
+      	
+ ]+>/g, '')} + title="Copy workflow code" + /> +
+