forked from microsoft/accessibility-insights-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from microsoft/master
merge with master
- Loading branch information
Showing
54 changed files
with
554 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 21 additions & 10 deletions
31
src/DetailsView/components/details-view-content-with-local-state.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { NamedFC } from 'common/react/named-fc'; | ||
import { DetailsViewContent } from 'DetailsView/components/details-view-content'; | ||
import { DetailsViewContainerProps } from 'DetailsView/details-view-container'; | ||
import * as React from 'react'; | ||
|
||
export type DetailsViewContentWithLocalStateProps = DetailsViewContainerProps; | ||
export type DetailsViewContentState = { | ||
isSideNavOpen: boolean; | ||
}; | ||
|
||
export const DetailsViewContentWithLocalState = NamedFC<DetailsViewContentWithLocalStateProps>( | ||
'DetailsViewContentWithLocalState', | ||
props => { | ||
const [isSideNavOpen, setSideNavOpen] = React.useState(false); | ||
export class DetailsViewContentWithLocalState extends React.Component< | ||
DetailsViewContentWithLocalStateProps, | ||
DetailsViewContentState | ||
> { | ||
constructor(props: DetailsViewContentWithLocalStateProps) { | ||
super(props); | ||
this.state = { isSideNavOpen: false }; | ||
} | ||
|
||
private setSideNavOpen(isOpen: boolean): void { | ||
this.setState({ isSideNavOpen: isOpen }); | ||
} | ||
|
||
public render(): JSX.Element { | ||
return ( | ||
<DetailsViewContent | ||
{...props} | ||
isSideNavOpen={isSideNavOpen} | ||
setSideNavOpen={setSideNavOpen} | ||
{...this.props} | ||
isSideNavOpen={this.state.isSideNavOpen} | ||
setSideNavOpen={(isOpen: boolean) => this.setSideNavOpen(isOpen)} | ||
/> | ||
); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.