mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-24 17:43:45 +03:00
fix: more cases for react18 and cli integration (#2416)
This commit is contained in:
parent
0e38089204
commit
26674e70c6
|
@ -6,8 +6,8 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import styled from '../src/styled-components';
|
import styled from '../src/styled-components';
|
||||||
|
|
||||||
const DropDownItem = styled.li<{ active?: boolean }>`
|
const DropDownItem = styled.li<{ $active?: boolean }>`
|
||||||
${(props: any) => (props.active ? 'background-color: #eee' : '')};
|
${(props: any) => (props.$active ? 'background-color: #eee' : '')};
|
||||||
padding: 13px 16px;
|
padding: 13px 16px;
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
|
@ -31,7 +31,7 @@ const DropDownList = styled.ul`
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 4px 0 0 0;
|
margin: 4px 0 0 0;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
font-family: Roboto,sans-serif;
|
font-family: Roboto, sans-serif;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ export default class ComboBox extends React.Component<ComboBoxProps, ComboBoxSta
|
||||||
renderOption = (option: { value: string; label: string }, idx: number) => {
|
renderOption = (option: { value: string; label: string }, idx: number) => {
|
||||||
return (
|
return (
|
||||||
<DropDownItem
|
<DropDownItem
|
||||||
active={idx === this.state.activeItemIdx}
|
$active={idx === this.state.activeItemIdx}
|
||||||
key={option.value}
|
key={option.value}
|
||||||
// tslint:disable-next-line
|
// tslint:disable-next-line
|
||||||
onMouseDown={() => {
|
onMouseDown={() => {
|
||||||
|
|
|
@ -15,7 +15,7 @@ export const OneOfLabel = styled.span`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const OneOfButton = styled.button<{ active: boolean; deprecated: boolean }>`
|
export const OneOfButton = styled.button<{ $active: boolean; $deprecated: boolean }>`
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
@ -29,10 +29,10 @@ export const OneOfButton = styled.button<{ active: boolean; deprecated: boolean
|
||||||
box-shadow: 0 0 0 1px ${props => props.theme.colors.primary.main};
|
box-shadow: 0 0 0 1px ${props => props.theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
${({ deprecated }) => (deprecated && deprecatedCss) || ''};
|
${({ $deprecated }) => ($deprecated && deprecatedCss) || ''};
|
||||||
|
|
||||||
${props => {
|
${props => {
|
||||||
if (props.active) {
|
if (props.$active) {
|
||||||
return `
|
return `
|
||||||
color: white;
|
color: white;
|
||||||
background-color: ${props.theme.colors.primary.main};
|
background-color: ${props.theme.colors.primary.main};
|
||||||
|
|
|
@ -23,8 +23,8 @@ export class OneOfButton extends React.Component<OneOfButtonProps> {
|
||||||
const { idx, schema, subSchema } = this.props;
|
const { idx, schema, subSchema } = this.props;
|
||||||
return (
|
return (
|
||||||
<StyledOneOfButton
|
<StyledOneOfButton
|
||||||
deprecated={subSchema.deprecated}
|
$deprecated={subSchema.deprecated}
|
||||||
active={idx === schema.activeOneOf}
|
$active={idx === schema.activeOneOf}
|
||||||
onClick={this.activateOneOf}
|
onClick={this.activateOneOf}
|
||||||
>
|
>
|
||||||
{subSchema.title || subSchema.typePrefix + subSchema.displayType}
|
{subSchema.title || subSchema.typePrefix + subSchema.displayType}
|
||||||
|
|
|
@ -25,7 +25,7 @@ export interface StickySidebarState {
|
||||||
|
|
||||||
const stickyfill = Stickyfill && Stickyfill();
|
const stickyfill = Stickyfill && Stickyfill();
|
||||||
|
|
||||||
const StyledStickySidebar = styled.div<{ open?: boolean }>`
|
const StyledStickySidebar = styled.div<{ $open?: boolean }>`
|
||||||
width: ${props => props.theme.sidebar.width};
|
width: ${props => props.theme.sidebar.width};
|
||||||
background-color: ${props => props.theme.sidebar.backgroundColor};
|
background-color: ${props => props.theme.sidebar.backgroundColor};
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -45,7 +45,7 @@ const StyledStickySidebar = styled.div<{ open?: boolean }>`
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: ${({ theme }) => theme.sidebar.backgroundColor};
|
background: ${({ theme }) => theme.sidebar.backgroundColor};
|
||||||
display: ${props => (props.open ? 'flex' : 'none')};
|
display: ${props => (props.$open ? 'flex' : 'none')};
|
||||||
`};
|
`};
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
|
@ -130,7 +130,7 @@ export class StickyResponsiveSidebar extends React.Component<
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StyledStickySidebar
|
<StyledStickySidebar
|
||||||
open={open}
|
$open={open}
|
||||||
className={this.props.className}
|
className={this.props.className}
|
||||||
style={{
|
style={{
|
||||||
top,
|
top,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user