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

fix: more cases for react18 and cli integration #2416

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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 demo/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import * as React from 'react';
import styled from '../src/styled-components';

const DropDownItem = styled.li<{ active?: boolean }>`
${(props: any) => (props.active ? 'background-color: #eee' : '')};
const DropDownItem = styled.li<{ $active?: boolean }>`
${(props: any) => (props.$active ? 'background-color: #eee' : '')};
padding: 13px 16px;
&:hover {
background-color: #eee;
Expand All @@ -31,7 +31,7 @@ const DropDownList = styled.ul`
list-style: none;
margin: 4px 0 0 0;
padding: 5px 0;
font-family: Roboto,sans-serif;
font-family: Roboto, sans-serif;
overflow: hidden;
`;

Expand Down Expand Up @@ -183,7 +183,7 @@ export default class ComboBox extends React.Component<ComboBoxProps, ComboBoxSta
renderOption = (option: { value: string; label: string }, idx: number) => {
return (
<DropDownItem
active={idx === this.state.activeItemIdx}
$active={idx === this.state.activeItemIdx}
key={option.value}
// tslint:disable-next-line
onMouseDown={() => {
Expand Down
6 changes: 3 additions & 3 deletions src/common-elements/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
margin-right: 10px;
margin-bottom: 5px;
Expand All @@ -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};
}

${({ deprecated }) => (deprecated && deprecatedCss) || ''};
${({ $deprecated }) => ($deprecated && deprecatedCss) || ''};

${props => {
if (props.active) {
if (props.$active) {
return `
color: white;
background-color: ${props.theme.colors.primary.main};
Expand Down
4 changes: 2 additions & 2 deletions src/components/Schema/OneOfSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export class OneOfButton extends React.Component<OneOfButtonProps> {
const { idx, schema, subSchema } = this.props;
return (
<StyledOneOfButton
deprecated={subSchema.deprecated}
active={idx === schema.activeOneOf}
$deprecated={subSchema.deprecated}
$active={idx === schema.activeOneOf}
onClick={this.activateOneOf}
>
{subSchema.title || subSchema.typePrefix + subSchema.displayType}
Expand Down
6 changes: 3 additions & 3 deletions src/components/StickySidebar/StickyResponsiveSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface StickySidebarState {

const stickyfill = Stickyfill && Stickyfill();

const StyledStickySidebar = styled.div<{ open?: boolean }>`
const StyledStickySidebar = styled.div<{ $open?: boolean }>`
width: ${props => props.theme.sidebar.width};
background-color: ${props => props.theme.sidebar.backgroundColor};
overflow: hidden;
Expand All @@ -45,7 +45,7 @@ const StyledStickySidebar = styled.div<{ open?: boolean }>`
z-index: 20;
width: 100%;
background: ${({ theme }) => theme.sidebar.backgroundColor};
display: ${props => (props.open ? 'flex' : 'none')};
display: ${props => (props.$open ? 'flex' : 'none')};
`};

@media print {
Expand Down Expand Up @@ -130,7 +130,7 @@ export class StickyResponsiveSidebar extends React.Component<
return (
<>
<StyledStickySidebar
open={open}
$open={open}
className={this.props.className}
style={{
top,
Expand Down
Loading