update theme and add placeholder for server stub

This commit is contained in:
Jason Ibrahim 2019-03-08 14:40:25 -08:00 committed by Jason Ibrahim
parent d472dff9a8
commit 5f93f43675
7 changed files with 53 additions and 24 deletions

View File

@ -1,5 +1,6 @@
import { observer } from 'mobx-react';
import * as React from 'react';
import { LinkWrap } from '../../../src/components/SearchBox/styled.elements';
import { AppStore } from '../../services/AppStore';
@ -38,7 +39,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
const license =
(info.license && (
<InfoSpan>
License: <a href={info.license.url}>{info.license.name}</a>
License: <LinkWrap href={info.license.url}>{info.license.name}</LinkWrap>
</InfoSpan>
)) ||
null;
@ -47,7 +48,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
(info.contact &&
info.contact.url && (
<InfoSpan>
URL: <a href={info.contact.url}>{info.contact.url}</a>
URL: <LinkWrap href={info.contact.url}>{info.contact.url}</LinkWrap>
</InfoSpan>
)) ||
null;
@ -57,7 +58,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
info.contact.email && (
<InfoSpan>
{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>
)) ||
null;
@ -65,7 +66,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
const terms =
(info.termsOfService && (
<InfoSpan>
<a href={info.termsOfService}>Terms of Service</a>
<LinkWrap href={info.termsOfService}>Terms of Service</LinkWrap>
</InfoSpan>
)) ||
null;

View File

@ -58,7 +58,7 @@ export const ServersOverlay = styled.div<{ expanded: boolean }>`
overflow: hidden;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
transition: all 0.25s ease;
transition: all 0s ease;
${props => (props.expanded ? '' : 'transform: translateY(-50%) scaleY(0);')}
`;

View File

@ -1,6 +1,5 @@
import * as React from 'react';
import { darken } from 'polished';
import * as React from 'react';
import styled from '../../styled-components';
import { MenuItemLabel } from '../SideMenu/styled.elements';
@ -8,6 +7,10 @@ export const SearchWrap = styled.div`
padding: 5px 0;
`;
export const LinkWrap = styled.a`
text-decoration: none;
`;
export const SearchInput = styled.input.attrs(() => ({
className: 'search-input',
}))`
@ -17,10 +20,9 @@ export const SearchInput = styled.input.attrs(() => ({
padding: 5px ${props => props.theme.spacing.unit * 2}px 5px
${props => props.theme.spacing.unit * 4}px;
border: 0;
border-bottom: 1px solid ${({ theme }) => darken(0.1, theme.menu.backgroundColor)};
font-family: ${({ theme }) => theme.typography.fontFamily};
font-weight: bold;
font-size: 13px;
border-bottom: 1px solid ${({theme}) => darken(0.1, theme.menu.backgroundColor)};
font-family: ${({theme}) => theme.typography.fontFamily};
font-size: 1em;
color: ${props => props.theme.menu.textColor};
background-color: transparent;
outline: none;
@ -28,14 +30,23 @@ export const SearchInput = styled.input.attrs(() => ({
export const SearchIcon = styled((props: { className?: string }) => (
<svg
className={props.className}
version="1.1"
viewBox="0 0 1000 1000"
x="0px"
id="Layer_1"
xmlns="http://www.w3.org/2000/svg"
x="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>
)).attrs({
className: 'search-icon',

View File

@ -1,5 +1,6 @@
import { observer } from 'mobx-react';
import * as React from 'react';
import { LinkWrap } from '../../../src/components/SearchBox/styled.elements';
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}/>
<RedocAttribution>
<a target="_blank" href="https://www.opentext.com/">
<LinkWrap href="https://www.opentext.com/" target={'_blank'}>
© Copyright 2019 OpenText Corp
</a>
</LinkWrap>
</RedocAttribution>
</PerfectScrollbarWrap>
);

View File

@ -0,0 +1,10 @@
interface ServerStub {
}
/**
* This class produces canned responses for a given OpenAPI spec
*/
export class OpenApiServerStub implements ServerStub {
}

View File

@ -0,0 +1,6 @@
describe('ServerStub', () => {
test('TODO IMPLEMENT ME', () => {
const fn = jest.fn();
expect(fn).toHaveBeenCalled();
});
});

View File

@ -64,15 +64,15 @@ const defaultTheme: ThemeInterface = {
},
},
http: {
get: '#6bbd5b',
post: '#248fb2',
put: '#9b708b',
options: '#d3ca12',
patch: '#e09d43',
delete: '#e27a7a',
get: '#078db3',
post: '#006353',
put: '#eeb111',
options: '#7e929f',
patch: '#8cc53e',
delete: '#f05822',
basic: '#999',
link: '#31bbb6',
head: '#c167e4',
head: '#725ea6',
},
},
schema: {