Skip to content

Commit

Permalink
Merge pull request #34566 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Sep 12, 2024
2 parents 968d026 + 02473b8 commit b7902e6
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions src/rest/components/RestCodeSamples.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState, useEffect, useRef, FormEvent } from 'react'
import { FormControl, Select, TabNav } from '@primer/react'
import { Tooltip } from '@primer/react/next'
import { FormControl, IconButton, Select, TabNav } from '@primer/react'
import { CheckIcon, CopyIcon } from '@primer/octicons-react'
import { announce } from '@primer/live-region-element'
import Cookies from 'src/frame/components/lib/cookies'
Expand Down Expand Up @@ -282,22 +281,15 @@ export function RestCodeSamples({ operation, slug, heading }: Props) {
</TabNav>
</div>
<div className="mr-2">
<Tooltip
className="mr-2"
direction="w"
text={isCopied ? t('button_text.copied') : t('button_text.copy_to_clipboard')}
>
<button
className="js-btn-copy btn-octicon"
aria-label={`${t('button_text.copy_to_clipboard')} ${selectedLanguage} request example`}
onClick={() => {
setCopied()
announce('Copied!')
}}
>
{isCopied ? <CheckIcon /> : <CopyIcon />}
</button>
</Tooltip>
<IconButton
icon={isCopied ? CheckIcon : CopyIcon}
className="js-btn-copy btn-octicon"
aria-label={`${t('button_text.copy_to_clipboard')} ${selectedLanguage} request example`}
onClick={() => {
setCopied()
announce('Copied!')
}}
></IconButton>
</div>
</div>

Expand Down

0 comments on commit b7902e6

Please sign in to comment.