forked from opensearch-project/oui
-
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.
Add functionality to OuiBottomBar to have the same width as the conta…
…iner element (opensearch-project#707) Co-authored-by: Andrey Myssak <[email protected]> Signed-off-by: Sergey Myssak <[email protected]>
- Loading branch information
1 parent
e9a63af
commit 45df6f6
Showing
15 changed files
with
271 additions
and
128 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
44 changes: 44 additions & 0 deletions
44
src-docs/src/views/bottom_bar/bottom_bar_container_width.js
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { useState } from 'react'; | ||
|
||
import { | ||
OuiBottomBar, | ||
OuiButton, | ||
OuiFlexGroup, | ||
OuiFlexItem, | ||
} from '../../../../src/components'; | ||
|
||
export default () => { | ||
const [isBottomBarVisible, setBottomBarVisibility] = useState(null); | ||
|
||
return ( | ||
<div> | ||
<OuiButton | ||
buttonSize="m" | ||
color="primary" | ||
onClick={() => setBottomBarVisibility((prevVal) => !prevVal)}> | ||
{isBottomBarVisible ? 'Hide' : 'Show'} bottom bar | ||
</OuiButton> | ||
|
||
{isBottomBarVisible && ( | ||
<OuiBottomBar left="unset" containerElementId="page-main-section"> | ||
<OuiFlexGroup justifyContent="flexEnd"> | ||
<OuiFlexItem grow={false}> | ||
<OuiButton | ||
onClick={() => setBottomBarVisibility(false)} | ||
color="ghost" | ||
size="s" | ||
iconType="cross"> | ||
Close | ||
</OuiButton> | ||
</OuiFlexItem> | ||
</OuiFlexGroup> | ||
</OuiBottomBar> | ||
)} | ||
</div> | ||
); | ||
}; |
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.