diff --git a/src/rest/components/RestCodeSamples.tsx b/src/rest/components/RestCodeSamples.tsx index c85c972aa011..238642ce2601 100644 --- a/src/rest/components/RestCodeSamples.tsx +++ b/src/rest/components/RestCodeSamples.tsx @@ -1,5 +1,5 @@ import { useState, useEffect, useRef, FormEvent } from 'react' -import { FormControl, Select, Tooltip, UnderlineNav } from '@primer/react' +import { FormControl, Select, Tooltip, TabNav } from '@primer/react' import { CheckIcon, CopyIcon } from '@primer/octicons-react' import Cookies from 'components/lib/cookies' import cx from 'classnames' @@ -246,13 +246,15 @@ export function RestCodeSamples({ operation, slug, heading }: Props) {
-
+
- + {languageSelectOptions.map((optionKey) => ( - { + selected={optionKey === selectedLanguage} + onClick={(e) => { + e.preventDefault() handleLanguageSelection(optionKey) }} onKeyDown={(event) => { @@ -260,17 +262,12 @@ export function RestCodeSamples({ operation, slug, heading }: Props) { handleLanguageSelection(optionKey) } }} - tabIndex={0} - aria-current={optionKey === selectedLanguage} - className={cx('pr-3 mr-0', optionKey === selectedLanguage && 'PRC-selected')} - sx={{ - cursor: 'pointer', - }} + href="#" > {t(`rest.reference.code_sample_options.${optionKey}`)} - + ))} - +
-
{displayedExample.response.schema ? ( - - {responseSelectOptions.map((optionKey) => { - if (!displayedExample.response.schema) return null - - return ( - { + + {responseSelectOptions.map((optionKey) => ( + { + e.preventDefault() + handleResponseSelection(optionKey) + }} + onKeyDown={(event) => { + if (event.key === 'Enter') { handleResponseSelection(optionKey) - }} - onKeyDown={(event) => { - if (event.key === 'Enter') { - handleResponseSelection(optionKey) - } - }} - tabIndex={0} - aria-current={optionKey === selectedResponse} - className={cx('pr-3 mr-0 ml-2', optionKey === selectedResponse && 'PRC-selected')} - sx={{ - cursor: 'pointer', - }} - > - {t(`rest.reference.response_options.${optionKey}`)} - - ) - })} - + } + }} + href="#" + > + {t(`rest.reference.response_options.${optionKey}`)} + + ))} + ) : null}
{/* Status code */}