From a60a222bfc40e97394ad8988f7dbbe6852389ba7 Mon Sep 17 00:00:00 2001 From: Ray Ventura Date: Tue, 25 Jun 2019 20:49:41 -0700 Subject: [PATCH] reskin documentation --- src/common-elements/fields-layout.ts | 15 ++++++++++----- src/common-elements/fields.ts | 2 ++ src/common-elements/panels.ts | 2 +- src/components/Endpoint/Endpoint.tsx | 10 +--------- src/components/Endpoint/styled.elements.ts | 8 +++----- src/components/RequestSamples/RequestSamples.tsx | 9 ++------- .../ResponseSamples/ResponseSamples.tsx | 4 +--- src/components/Responses/Response.tsx | 12 ++---------- src/components/Responses/ResponseTitle.tsx | 11 +---------- src/components/Responses/ResponsesList.tsx | 10 ---------- src/services/models/Response.ts | 2 +- src/theme.ts | 8 ++++---- 12 files changed, 28 insertions(+), 65 deletions(-) diff --git a/src/common-elements/fields-layout.ts b/src/common-elements/fields-layout.ts index 84a1787d..3cf568d2 100644 --- a/src/common-elements/fields-layout.ts +++ b/src/common-elements/fields-layout.ts @@ -12,7 +12,7 @@ export const PropertiesTableCaption = styled.caption` export const PropertyCell = styled.td<{ kind?: string }>` border-left: 1px solid ${props => props.theme.schema.linesColor}; - border-bottom: 1px solid #e3e8ee; + border-top: 1px solid #e3e8ee; box-sizing: border-box; position: relative; padding: 10px 10px 10px 0; @@ -55,7 +55,7 @@ export const PropertyCell = styled.td<{ kind?: string }>` } tr.expanded & { - border-bottom: none; + border-top: none; } `; @@ -68,7 +68,8 @@ export const PropertyNameCell = styled(PropertyCell)` line-height: 20px; white-space: nowrap; font-size: 0.929em; - font-family: ${props => props.theme.typography.headings.fontFamily}; + font-weight: bold; + font-family: Courier,monospace; &.deprecated { ${deprecatedCss}; @@ -80,13 +81,13 @@ export const PropertyNameCell = styled(PropertyCell)` `; export const PropertyDetailsCell = styled.td` - border-bottom: 1px solid #e3e8ee; + border-top: 1px solid #e3e8ee; padding: 10px 0; width: ${props => props.theme.schema.defaultDetailsWidth}; box-sizing: border-box; tr.expanded & { - border-bottom: none; + border-top: none; } `; @@ -126,6 +127,10 @@ export const PropertiesTable = styled.table` border-spacing: 0; width: 100%; + tr:first-child td { + border-top: none; + } + > tr { vertical-align: middle; } diff --git a/src/common-elements/fields.ts b/src/common-elements/fields.ts index 9ab3a929..933feb1b 100644 --- a/src/common-elements/fields.ts +++ b/src/common-elements/fields.ts @@ -18,6 +18,8 @@ export const ClickablePropertyNameCell = styled(PropertyNameCell)` export const FieldLabel = styled.span` vertical-align: middle; + text-transform: uppercase; + font-family: ${({ theme }) => theme.typography.headings.fontFamily}; font-size: ${({ theme }) => theme.typography.code.fontSize}; line-height: 20px; `; diff --git a/src/common-elements/panels.ts b/src/common-elements/panels.ts index 692d7d35..31b00350 100644 --- a/src/common-elements/panels.ts +++ b/src/common-elements/panels.ts @@ -15,7 +15,7 @@ export const MiddlePanel = styled.div` export const Section = styled.div.attrs(props => ({ [SECTION_ATTR]: props.id, })) <{ underlined?: boolean }>` - padding: 0 0 ${props => props.theme.spacing.sectionVertical}px 0; + padding: 20px 0 ${props => props.theme.spacing.sectionVertical}px 0; border-bottom: 1px solid #e3e8ee; &:last-child { min-height: calc(100vh + 1px); diff --git a/src/components/Endpoint/Endpoint.tsx b/src/components/Endpoint/Endpoint.tsx index 00d7bda0..d3c25cc6 100644 --- a/src/components/Endpoint/Endpoint.tsx +++ b/src/components/Endpoint/Endpoint.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import { ShelfIcon } from '../../common-elements'; import { OperationModel } from '../../services'; import { Markdown } from '../Markdown/Markdown'; import { OptionsContext } from '../OptionsProvider'; @@ -48,16 +47,9 @@ export class Endpoint extends React.Component { {options => ( - + {operation.httpVerb}{' '} {operation.path} - {operation.servers.map(server => ( diff --git a/src/components/Endpoint/styled.elements.ts b/src/components/Endpoint/styled.elements.ts index f00a032b..00253218 100644 --- a/src/components/Endpoint/styled.elements.ts +++ b/src/components/Endpoint/styled.elements.ts @@ -3,7 +3,7 @@ import styled from '../../styled-components'; export const OperationEndpointWrap = styled.div` cursor: pointer; position: relative; - margin-bottom: 5px; + margin: 60px 0px 0px 0px; `; export const ServerRelativeURL = styled.span` @@ -17,8 +17,7 @@ export const ServerRelativeURL = styled.span` export const EndpointInfo = styled.div<{ expanded?: boolean; inverted?: boolean }>` padding: 10px 30px 10px ${props => (props.inverted ? '10px' : '20px')}; border-radius: ${props => (props.inverted ? '0' : '4px 4px 0 0')}; - background-color: ${props => - props.inverted ? 'transparent' : props.theme.codeSample.backgroundColor}; + background-color: #3c4257; display: flex; white-space: nowrap; align-items: center; @@ -36,10 +35,9 @@ export const EndpointInfo = styled.div<{ expanded?: boolean; inverted?: boolean export const HttpVerb = styled.span.attrs((props: { type: string }) => ({ className: `http-verb ${props.type}`, -}))<{ type: string }>` +})) <{ type: string }>` font-size: 0.929em; line-height: 20px; - background-color: ${(props: any) => props.theme.colors.http[props.type] || '#999999'}; color: #ffffff; padding: 3px 10px; text-transform: uppercase; diff --git a/src/components/RequestSamples/RequestSamples.tsx b/src/components/RequestSamples/RequestSamples.tsx index 66a4db53..4bea8781 100644 --- a/src/components/RequestSamples/RequestSamples.tsx +++ b/src/components/RequestSamples/RequestSamples.tsx @@ -4,7 +4,7 @@ import { OperationModel, RedocNormalizedOptions } from '../../services'; import { PayloadSamples } from '../PayloadSamples/PayloadSamples'; import { SourceCodeWithCopy } from '../SourceCode/SourceCode'; -import { RightPanelHeader, Tab, TabList, TabPanel, Tabs } from '../../common-elements'; +import { Tab, TabList, TabPanel, Tabs } from '../../common-elements'; import { OptionsContext } from '../OptionsProvider'; export interface RequestSamplesProps { @@ -24,15 +24,10 @@ export class RequestSamples extends React.Component { const samples = operation.codeSamples; const hasSamples = hasBodySample || samples.length > 0; - const hideTabList = - samples.length + (hasBodySample ? 1 : 0) === 1 - ? this.context.hideSingleRequestSampleTab - : false; + const hideTabList = true; return ( (hasSamples && (
- Request samples -