Skip to content

Commit

Permalink
🐛 (share) Fix clipboard for updated typebot ID
Browse files Browse the repository at this point in the history
Closes #215
  • Loading branch information
baptisteArno committed Jan 6, 2023
1 parent 6cc3cbf commit fadf34a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "next start",
"lint": "next lint",
"test": "pnpm playwright test",
"test:report": "pnpm playwright show-report"
"test:show-report": "pnpm playwright show-report src/test/reporters"
},
"dependencies": {
"@chakra-ui/anatomy": "^2.1.1",
Expand Down
8 changes: 6 additions & 2 deletions apps/builder/src/components/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useEffect } from 'react'
import { ButtonProps, Button, useClipboard } from '@chakra-ui/react'

interface CopyButtonProps extends ButtonProps {
Expand All @@ -8,7 +8,11 @@ interface CopyButtonProps extends ButtonProps {

export const CopyButton = (props: CopyButtonProps) => {
const { textToCopy, onCopied, ...buttonProps } = props
const { hasCopied, onCopy } = useClipboard(textToCopy)
const { hasCopied, onCopy, setValue } = useClipboard(textToCopy)

useEffect(() => {
setValue(textToCopy)
}, [setValue, textToCopy])

return (
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const EditableUrl = ({

<HStack>
<EditButton size="xs" />
<CopyButton size="xs" textToCopy={`${hostname}/${pathname ?? ''}`} />
<CopyButton size="xs" textToCopy={`${hostname}/${value ?? ''}`} />
</HStack>
</Editable>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/playwright/baseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (fs.existsSync(localViewerEnvPath))

export const playwrightBaseConfig: PlaywrightTestConfig = {
globalSetup: require.resolve(path.join(__dirname, 'globalSetup')),
timeout: process.env.CI ? 50 * 1000 : 20 * 1000,
timeout: process.env.CI ? 50 * 1000 : 40 * 1000,
expect: {
timeout: process.env.CI ? 10 * 1000 : 5 * 1000,
},
Expand Down

0 comments on commit fadf34a

Please sign in to comment.