mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 14:14:56 +03:00
update theme and add placeholder for server stub
This commit is contained in:
parent
d472dff9a8
commit
5f93f43675
|
@ -1,5 +1,6 @@
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
import { LinkWrap } from '../../../src/components/SearchBox/styled.elements';
|
||||||
|
|
||||||
import { AppStore } from '../../services/AppStore';
|
import { AppStore } from '../../services/AppStore';
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
|
||||||
const license =
|
const license =
|
||||||
(info.license && (
|
(info.license && (
|
||||||
<InfoSpan>
|
<InfoSpan>
|
||||||
License: <a href={info.license.url}>{info.license.name}</a>
|
License: <LinkWrap href={info.license.url}>{info.license.name}</LinkWrap>
|
||||||
</InfoSpan>
|
</InfoSpan>
|
||||||
)) ||
|
)) ||
|
||||||
null;
|
null;
|
||||||
|
@ -47,7 +48,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
|
||||||
(info.contact &&
|
(info.contact &&
|
||||||
info.contact.url && (
|
info.contact.url && (
|
||||||
<InfoSpan>
|
<InfoSpan>
|
||||||
URL: <a href={info.contact.url}>{info.contact.url}</a>
|
URL: <LinkWrap href={info.contact.url}>{info.contact.url}</LinkWrap>
|
||||||
</InfoSpan>
|
</InfoSpan>
|
||||||
)) ||
|
)) ||
|
||||||
null;
|
null;
|
||||||
|
@ -57,7 +58,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
|
||||||
info.contact.email && (
|
info.contact.email && (
|
||||||
<InfoSpan>
|
<InfoSpan>
|
||||||
{info.contact.name || 'E-mail'}:{' '}
|
{info.contact.name || 'E-mail'}:{' '}
|
||||||
<a href={'mailto:' + info.contact.email}>{info.contact.email}</a>
|
<LinkWrap href={'mailto:' + info.contact.email}>{info.contact.email}</LinkWrap>
|
||||||
</InfoSpan>
|
</InfoSpan>
|
||||||
)) ||
|
)) ||
|
||||||
null;
|
null;
|
||||||
|
@ -65,7 +66,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
|
||||||
const terms =
|
const terms =
|
||||||
(info.termsOfService && (
|
(info.termsOfService && (
|
||||||
<InfoSpan>
|
<InfoSpan>
|
||||||
<a href={info.termsOfService}>Terms of Service</a>
|
<LinkWrap href={info.termsOfService}>Terms of Service</LinkWrap>
|
||||||
</InfoSpan>
|
</InfoSpan>
|
||||||
)) ||
|
)) ||
|
||||||
null;
|
null;
|
||||||
|
|
|
@ -58,7 +58,7 @@ export const ServersOverlay = styled.div<{ expanded: boolean }>`
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
transition: all 0.25s ease;
|
transition: all 0s ease;
|
||||||
|
|
||||||
${props => (props.expanded ? '' : 'transform: translateY(-50%) scaleY(0);')}
|
${props => (props.expanded ? '' : 'transform: translateY(-50%) scaleY(0);')}
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import * as React from 'react';
|
|
||||||
|
|
||||||
import { darken } from 'polished';
|
import { darken } from 'polished';
|
||||||
|
import * as React from 'react';
|
||||||
import styled from '../../styled-components';
|
import styled from '../../styled-components';
|
||||||
import { MenuItemLabel } from '../SideMenu/styled.elements';
|
import { MenuItemLabel } from '../SideMenu/styled.elements';
|
||||||
|
|
||||||
|
@ -8,6 +7,10 @@ export const SearchWrap = styled.div`
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const LinkWrap = styled.a`
|
||||||
|
text-decoration: none;
|
||||||
|
`;
|
||||||
|
|
||||||
export const SearchInput = styled.input.attrs(() => ({
|
export const SearchInput = styled.input.attrs(() => ({
|
||||||
className: 'search-input',
|
className: 'search-input',
|
||||||
}))`
|
}))`
|
||||||
|
@ -17,10 +20,9 @@ export const SearchInput = styled.input.attrs(() => ({
|
||||||
padding: 5px ${props => props.theme.spacing.unit * 2}px 5px
|
padding: 5px ${props => props.theme.spacing.unit * 2}px 5px
|
||||||
${props => props.theme.spacing.unit * 4}px;
|
${props => props.theme.spacing.unit * 4}px;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-bottom: 1px solid ${({ theme }) => darken(0.1, theme.menu.backgroundColor)};
|
border-bottom: 1px solid ${({theme}) => darken(0.1, theme.menu.backgroundColor)};
|
||||||
font-family: ${({ theme }) => theme.typography.fontFamily};
|
font-family: ${({theme}) => theme.typography.fontFamily};
|
||||||
font-weight: bold;
|
font-size: 1em;
|
||||||
font-size: 13px;
|
|
||||||
color: ${props => props.theme.menu.textColor};
|
color: ${props => props.theme.menu.textColor};
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
@ -28,14 +30,23 @@ export const SearchInput = styled.input.attrs(() => ({
|
||||||
|
|
||||||
export const SearchIcon = styled((props: { className?: string }) => (
|
export const SearchIcon = styled((props: { className?: string }) => (
|
||||||
<svg
|
<svg
|
||||||
className={props.className}
|
|
||||||
version="1.1"
|
version="1.1"
|
||||||
viewBox="0 0 1000 1000"
|
id="Layer_1"
|
||||||
x="0px"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
x="0px"
|
||||||
y="0px"
|
y="0px"
|
||||||
|
className={props.className}
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlSpace="preserve"
|
||||||
>
|
>
|
||||||
<path d="M968.2,849.4L667.3,549c83.9-136.5,66.7-317.4-51.7-435.6C477.1-25,252.5-25,113.9,113.4c-138.5,138.3-138.5,362.6,0,501C219.2,730.1,413.2,743,547.6,666.5l301.9,301.4c43.6,43.6,76.9,14.9,104.2-12.4C981,928.3,1011.8,893,968.2,849.4z M524.5,522c-88.9,88.7-233,88.7-321.8,0c-88.9-88.7-88.9-232.6,0-321.3c88.9-88.7,233-88.7,321.8,0C613.4,289.4,613.4,433.3,524.5,522z" />
|
<g>
|
||||||
|
<path
|
||||||
|
className="st0"
|
||||||
|
d="M22.7,21.5l-5.1-5c1.5-1.7,2.4-4,2.4-6.5c0-5.5-4.5-10-10-10S0,4.5,0,10s4.5,10,10,10c2.3,0,4.4-0.8,6.1-2.1
|
||||||
|
l5.2,5.1c0.2,0.2,0.4,0.3,0.7,0.3c0.3,0,0.5-0.1,0.7-0.3C23.1,22.5,23.1,21.9,22.7,21.5z M10,18c-4.4,0-8-3.6-8-8s3.6-8,8-8
|
||||||
|
s8,3.6,8,8S14.4,18,10,18z"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
)).attrs({
|
)).attrs({
|
||||||
className: 'search-icon',
|
className: 'search-icon',
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
import { LinkWrap } from '../../../src/components/SearchBox/styled.elements';
|
||||||
|
|
||||||
import { PerfectScrollbarWrap } from '../../common-elements/perfect-scrollbar';
|
import { PerfectScrollbarWrap } from '../../common-elements/perfect-scrollbar';
|
||||||
|
|
||||||
|
@ -23,9 +24,9 @@ export class SideMenu extends React.Component<{ menu: MenuStore; className?: str
|
||||||
>
|
>
|
||||||
<MenuItems items={store.items} onActivate={this.activate} root={true}/>
|
<MenuItems items={store.items} onActivate={this.activate} root={true}/>
|
||||||
<RedocAttribution>
|
<RedocAttribution>
|
||||||
<a target="_blank" href="https://www.opentext.com/">
|
<LinkWrap href="https://www.opentext.com/" target={'_blank'}>
|
||||||
© Copyright 2019 OpenText Corp
|
© Copyright 2019 OpenText Corp
|
||||||
</a>
|
</LinkWrap>
|
||||||
</RedocAttribution>
|
</RedocAttribution>
|
||||||
</PerfectScrollbarWrap>
|
</PerfectScrollbarWrap>
|
||||||
);
|
);
|
||||||
|
|
10
src/services/ServerStub.ts
Normal file
10
src/services/ServerStub.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
interface ServerStub {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class produces canned responses for a given OpenAPI spec
|
||||||
|
*/
|
||||||
|
export class OpenApiServerStub implements ServerStub {
|
||||||
|
|
||||||
|
}
|
6
src/services/__tests__/ServerStub.test.ts
Normal file
6
src/services/__tests__/ServerStub.test.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
describe('ServerStub', () => {
|
||||||
|
test('TODO IMPLEMENT ME', () => {
|
||||||
|
const fn = jest.fn();
|
||||||
|
expect(fn).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
14
src/theme.ts
14
src/theme.ts
|
@ -64,15 +64,15 @@ const defaultTheme: ThemeInterface = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
http: {
|
http: {
|
||||||
get: '#6bbd5b',
|
get: '#078db3',
|
||||||
post: '#248fb2',
|
post: '#006353',
|
||||||
put: '#9b708b',
|
put: '#eeb111',
|
||||||
options: '#d3ca12',
|
options: '#7e929f',
|
||||||
patch: '#e09d43',
|
patch: '#8cc53e',
|
||||||
delete: '#e27a7a',
|
delete: '#f05822',
|
||||||
basic: '#999',
|
basic: '#999',
|
||||||
link: '#31bbb6',
|
link: '#31bbb6',
|
||||||
head: '#c167e4',
|
head: '#725ea6',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
schema: {
|
schema: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user