Migrate Buttons to @primer/react-brand (#62082) · github/docs@792ea00 · GitHub
Skip to content

Commit 792ea00

Browse files
EbonsignoriCopilotheiskr
authored
Migrate Buttons to @primer/react-brand (#62082)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: heiskr <1221423+heiskr@users.noreply.github.com>
1 parent 2c7d258 commit 792ea00

4 files changed

Lines changed: 41 additions & 16 deletions

File tree

‎src/frame/components/article/ViewMarkdownButton.module.scss‎

Lines changed: 21 additions & 0 deletions

‎src/frame/components/article/ViewMarkdownButton.tsx‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
LinkExternalIcon,
88
TriangleDownIcon,
99
} from '@primer/octicons-react'
10-
import { ActionList, ActionMenu, Button, ButtonGroup, VisuallyHidden } from '@primer/react'
10+
import { ActionList, ActionMenu, ButtonGroup, VisuallyHidden } from '@primer/react'
11+
import { Button } from '@primer/react-brand'
1112
import { announce } from '@primer/live-region-element'
1213
import { MARKDOWN_SOURCE_MENU_EVENT_GROUP } from '@/events/components/event-groups'
1314
import { sendEvent } from '@/events/components/events'
@@ -87,18 +88,14 @@ export const CopyMarkdownMenu = ({ currentPath }: CopyMarkdownMenuProps) => {
8788
<div className="mb-3 ml-3">
8889
<ButtonGroup>
8990
<Button
90-
variant="default"
91-
className={cx(
92-
'd-inline-flex flex-items-center text-decoration-none color-fg-default',
93-
styles.button,
94-
)}
91+
variant="secondary"
92+
size="small"
93+
className={cx('text-decoration-none color-fg-default', styles.button, styles.copyButton)}
94+
leadingVisual={
95+
copied ? <CheckIcon aria-hidden="true" /> : <CopyIcon aria-hidden="true" />
96+
}
9597
onClick={handleCopyClick}
9698
>
97-
{copied ? (
98-
<CheckIcon size={12} className="mr-1" aria-hidden="true" />
99-
) : (
100-
<CopyIcon size={12} className="mr-1" aria-hidden="true" />
101-
)}
10299
{t('copy_as_markdown')}
103100
</Button>
104101
<ActionMenu>

‎src/landings/components/CookBookFilter.tsx‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { TextInput, ActionMenu, ActionList, Button } from '@primer/react'
1+
import { TextInput, ActionMenu, ActionList } from '@primer/react'
2+
import { Button } from '@primer/react-brand'
23
import { SearchIcon } from '@primer/octicons-react'
34
import { useRef, useEffect, useState, type ChangeEvent } from 'react'
45
import { ArticleCardItems } from '@/landings/types'
@@ -148,7 +149,13 @@ export const CookBookFilter = ({
148149
</ActionMenu>
149150
)}
150151

151-
<Button variant="invisible" className="col-md-1 col-sm-2 mt-1" onClick={onResetFilter}>
152+
<Button
153+
variant="subtle"
154+
size="small"
155+
className="m-1"
156+
style={{ whiteSpace: 'nowrap' }}
157+
onClick={onResetFilter}
158+
>
152159
{t('reset_filters')}
153160
</Button>
154161
</div>

‎src/secret-scanning/components/SecretScanningTable.tsx‎

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)