-
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.
- Loading branch information
leonwgc
committed
Apr 22, 2024
1 parent
11002ca
commit b2cc135
Showing
4 changed files
with
88 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,20 @@ | ||
import React, { useState } from 'react'; | ||
import Popover from '../src/Popover'; | ||
import DemoBlock from './DemoBlock'; | ||
import PageWrap from './PageWrap'; | ||
|
||
export default function App() { | ||
const [visible, setVisible] = useState(true); | ||
const [visible, setVisible] = useState(false); | ||
|
||
return ( | ||
<PageWrap> | ||
<DemoBlock title="Simple usage"> | ||
<div> | ||
<Popover | ||
placement="bottom-right" | ||
visible={visible} | ||
content="I'm here" | ||
style={{ padding: 6, width: 150, height: 44, background: '#999', color: '#fff' }} // popover container style | ||
> | ||
<div | ||
role="button" | ||
style={{ | ||
padding: '6px 12px', | ||
display: 'inline-flex', | ||
alignItems: 'center', | ||
height: 30, | ||
border: '1px dashed', | ||
}} | ||
onClick={() => setVisible(true)} | ||
> | ||
This is anchor button to trigger Popover to showup | ||
</div> | ||
</Popover> | ||
</div> | ||
</DemoBlock> | ||
</PageWrap> | ||
<div> | ||
<Popover | ||
placement="bottom-right" | ||
visible={visible} | ||
onClose={() => setVisible(false)} | ||
closeOnClickOutside | ||
content="This is ReactNode content." | ||
> | ||
<button onClick={() => setVisible(true)}>Anchor to trigger Popover to showup</button> | ||
</Popover> | ||
</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