Skip to content

Commit

Permalink
Share improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
wrenhawth committed Jul 15, 2024
1 parent b827284 commit 3e15e4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/ShareStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SlIcon from "@shoelace-style/shoelace/dist/react/icon/index.js"


import { WorkflowDispatchContext } from "./WorkflowContext";
import { useContext } from "react";
import { useContext, useState } from "react";
import { WorkflowStep } from "../utils/workflow";
import { PlayButton } from "./PlayButton";

Expand All @@ -14,6 +14,7 @@ type ShareStepProps = {

export const ShareStep = (props: ShareStepProps) => {
const { title, shareUrl } = props
const [shared, setShared] = useState(false)
const dispatch = useContext(WorkflowDispatchContext)

return (
Expand Down Expand Up @@ -62,8 +63,11 @@ export const ShareStep = (props: ShareStepProps) => {
} else {
navigator.clipboard.writeText(shareUrl)
}
navigator.clipboard.writeText(shareUrl)
setShared(true)
}}>
<SlIcon name="send" slot="prefix"></SlIcon>Share
<SlIcon name="send" slot="prefix"></SlIcon>
{shared ? "Copied to Clipboard" : "Share"}
</SlButton>
</div>
</div>
Expand Down

0 comments on commit 3e15e4d

Please sign in to comment.