Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: added consistent styling for buttons and tags #1099

Merged
merged 6 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions library/src/components/Schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ export const Schema: React.FunctionComponent<Props> = ({
{schema.default() !== undefined && (
<div className="text-xs">
Default value:
<span className="border inline-block text-orange-600 rounded ml-1 py-0 px-2">
<span className="inline-block bg-orange-600 text-white rounded ml-1 py-0 px-2">
{SchemaHelpers.prettifyValue(schema.default())}
</span>
</div>
)}
{schema.const() !== undefined && (
<div className="text-xs">
Const:
<span className="border inline-block text-orange-600 rounded ml-1 py-0 px-2">
<span className="inline-block bg-orange-600 text-white rounded ml-1 py-0 px-2">
{SchemaHelpers.prettifyValue(schema.const())}
</span>
</div>
Expand All @@ -228,7 +228,7 @@ export const Schema: React.FunctionComponent<Props> = ({
{schema.enum()?.map((e, idx) => (
<li
key={idx}
className="border inline-block text-orange-600 rounded ml-1 py-0 px-2"
className="inline-block bg-orange-600 text-white rounded ml-1 py-0 px-2"
>
<span>{SchemaHelpers.prettifyValue(e)}</span>
</li>
Expand Down Expand Up @@ -259,7 +259,7 @@ export const Schema: React.FunctionComponent<Props> = ({
{schema.examples()?.map((e, idx) => (
<li
key={idx}
className="border inline-block text-orange-600 rounded ml-1 py-0 px-2 break-all"
className="inline-block bg-orange-600 text-white rounded ml-1 py-0 px-2 break-all"
>
<span>{SchemaHelpers.prettifyValue(e)}</span>
</li>
Expand Down
4 changes: 2 additions & 2 deletions library/src/containers/Messages/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const Message: React.FunctionComponent<Props> = ({
<div className="border bg-gray-100 rounded px-4 py-2 mt-2">
<div className="text-sm text-gray-700">
Message ID
<span className="border text-orange-600 rounded text-xs ml-2 py-0 px-2">
<span className="bg-orange-600 text-white rounded text-xs ml-2 py-0 px-2">
{messageId}
</span>
</div>
Expand All @@ -102,7 +102,7 @@ export const Message: React.FunctionComponent<Props> = ({
<div className="border bg-gray-100 rounded px-4 py-2 mt-2">
<div className="text-sm text-gray-700">
Correlation ID
<span className="border text-orange-600 rounded text-xs ml-2 py-0 px-2">
<span className="bg-orange-600 text-white rounded text-xs ml-2 py-0 px-2 bg-orange-300">
{correlationId.location()}
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion library/src/containers/Messages/MessageExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const Example: React.FunctionComponent<ExampleProps> = ({
className: 'fill-current text-gray-200',
}}
>
<span className="inline-block w-20 py-0.5 mr-1 text-gray-200 text-sm border text-center rounded focus:outline-none">
<span className="inline-block w-20 py-0.5 mr-1 bg-gray-200 text-sm text-center rounded focus:outline-none">
{type}
</span>
</CollapseButton>
Expand Down
6 changes: 3 additions & 3 deletions library/src/containers/Operations/Operation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const OperationInfo: React.FunctionComponent<Props> = (props) => {
const specV = useSpec().version();
const version = specV.localeCompare('2.6.0', undefined, { numeric: true });
const isAsyncAPIv2 = version === 0;
const { borderColor, typeLabel } =
const { backgroundColor, typeLabel } =
CommonHelpers.getOperationDesignInformation({
type,
config,
Expand All @@ -181,7 +181,7 @@ export const OperationInfo: React.FunctionComponent<Props> = (props) => {
<div className="mb-4">
<h3>
<span
className={`font-mono border uppercase p-1 rounded mr-2 ${borderColor}`}
className={`font-mono text-white uppercase p-1 rounded mr-2 ${backgroundColor}`}
title={type}
>
{typeLabel}
Expand Down Expand Up @@ -223,7 +223,7 @@ export const OperationInfo: React.FunctionComponent<Props> = (props) => {
<div className="border bg-gray-100 rounded px-4 py-2 mt-2">
<div className="text-sm text-gray-700">
Operation ID
<span className="border text-orange-600 rounded text-xs ml-2 py-0 px-2">
<span className="bg-orange-600 text-white rounded text-xs ml-2 py-0 px-2">
{operationId}
</span>
</div>
Expand Down
Loading