1
0
mirror of synced 2025-12-22 11:26:57 -05:00
Files
docs/components/playground/editor/ActionBar.tsx
Kevin Heis 9f7c20dae8 Upgrade Primer CSS to version 17, removing marketing styles (#20965)
* Package updates

* Fix up things that look broken

* Add to utils

* Lead now just sets font size, just use f3 where needed

* Update package-lock.json

* Update index.tsx

* Delete bump-link.scss

* Update trigger-error.js

* Update components/GenericError.tsx

Co-authored-by: Ash Guillaume <10384315+ashygee@users.noreply.github.com>

* Update ArticlePage.tsx

* Update ActionBar.tsx

* Changes from meeting

* Found a few more monos

* Fix from a merge conflict

* Missed a few f3s

* Update SubLandingHero.tsx

* Bye gradients

* Match up breadcrumbs

* Update SubLandingHero.tsx

* Update lists.scss

Co-authored-by: Ash Guillaume <10384315+ashygee@users.noreply.github.com>
2021-08-31 14:49:39 -07:00

42 lines
1.2 KiB
TypeScript

import { CopyIcon, CheckIcon } from '@primer/octicons-react'
import { Tooltip } from '@primer/components'
import useClipboard from 'components/hooks/useClipboard'
interface Props {
code: string
}
export const ActionBar = ({ code }: Props) => {
const [isCopied, setCopied] = useClipboard(code, {
successDuration: 1400,
})
return (
<div className="d-flex flex-justify-between flex-items-center color-bg-primary border-left border-top border-right px-3 py-1">
<div />
<div className="d-flex">
{/* <Tooltip aria-label="View repository" className="mr-2">
<button className="btn-octicon ml-0">
<EyeIcon />
</button>
</Tooltip>
<Tooltip aria-label="Fork repository" className="mr-2">
<button className="btn-octicon ml-0">
<RepoForkedIcon />
</button>
</Tooltip> */}
<Tooltip
align="right"
direction="nw"
aria-label={isCopied ? 'Copied!' : 'Copy to clipboard'}
>
<button className="btn-octicon" onClick={() => setCopied()}>
{isCopied ? <CheckIcon /> : <CopyIcon />}
</button>
</Tooltip>
</div>
</div>
)
}