make buttons less wonky — cheap, fast substitute for a selector

This commit is contained in:
glosier 2020-12-28 08:43:51 -08:00
parent 2a6b40d2ed
commit a1ca495bda
2 changed files with 64 additions and 3 deletions

View File

@ -132,7 +132,62 @@ paths:
// Something wrong -- check response for errors
Console.WriteLine(response.getRawResponse());
}
- lang: PHP
- lang: Shell + curl
source: |
$form = new \PetStore\Entities\Pet();
$form->setPetType("Dog");
$form->setName("Rex");
// set other fields
try {
$pet = $client->pets()->create($form);
} catch (UnprocessableEntityException $e) {
var_dump($e->getErrors());
}
- lang: Node + native
source: |
$form = new \PetStore\Entities\Pet();
$form->setPetType("Dog");
$form->setName("Rex");
// set other fields
try {
$pet = $client->pets()->create($form);
} catch (UnprocessableEntityException $e) {
var_dump($e->getErrors());
}
- lang: Go + native
source: |
$form = new \PetStore\Entities\Pet();
$form->setPetType("Dog");
$form->setName("Rex");
// set other fields
try {
$pet = $client->pets()->create($form);
} catch (UnprocessableEntityException $e) {
var_dump($e->getErrors());
}
- lang: Ruby + native
source: |
$form = new \PetStore\Entities\Pet();
$form->setPetType("Dog");
$form->setName("Rex");
// set other fields
try {
$pet = $client->pets()->create($form);
} catch (UnprocessableEntityException $e) {
var_dump($e->getErrors());
}
- lang: Javascript + jquery
source: |
$form = new \PetStore\Entities\Pet();
$form->setPetType("Dog");
$form->setName("Rex");
// set other fields
try {
$pet = $client->pets()->create($form);
} catch (UnprocessableEntityException $e) {
var_dump($e->getErrors());
}
- lang: Python + python3
source: |
$form = new \PetStore\Entities\Pet();
$form->setPetType("Dog");

View File

@ -31,8 +31,14 @@ export class RequestSamples extends React.Component<RequestSamplesProps> {
<Tabs defaultIndex={0}>
<TabList hidden={hideTabList}>
{samples.map(sample => (
<Tab key={sample.lang + '_' + (sample.label || '')}>
{sample.label !== undefined ? sample.label : sample.lang}
<Tab className="exampleButton" key={sample.lang + '_' + (sample.label || '')}>
{sample.label !== undefined ? sample.label :
sample.lang === 'Shell + curl' ? sample.lang.slice(8) :
sample.lang === 'Node + native' ? sample.lang.slice(0, 4) :
sample.lang === 'Go + native' ? sample.lang.slice(0, 2) :
sample.lang === 'Ruby + native' ? sample.lang.slice(0, 4) :
sample.lang === 'Python + python3' ? sample.lang.slice(9) :
sample.lang === 'Javascript + jquery' ? sample.lang.slice(0, 10) : sample.lang}
</Tab>
))}
</TabList>