-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove the Trigger and Close from the Popover because of gesture…
… conflict (#3683)
- Loading branch information
1 parent
128a880
commit bfefba4
Showing
2 changed files
with
53 additions
and
37 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,35 +1,45 @@ | ||
import { useState } from 'react'; | ||
|
||
import { Button, Popover, Stack, Text } from '@onekeyhq/components'; | ||
|
||
import { Layout } from './utils/Layout'; | ||
|
||
const PopoverGallery = () => ( | ||
<Layout | ||
description=".." | ||
suggestions={['...']} | ||
boundaryConditions={['...']} | ||
elements={[ | ||
{ | ||
title: 'Default', | ||
element: ( | ||
<Popover | ||
title="Popover Demo" | ||
renderTrigger={<Button>Open</Button>} | ||
renderContent={ | ||
<Stack space="$4" p="$5"> | ||
<Text> | ||
Non exercitation ea laborum cupidatat sunt amet aute | ||
exercitation occaecat minim incididunt non est est voluptate. | ||
</Text> | ||
<Popover.Close> | ||
<Button variant="primary">Button</Button> | ||
</Popover.Close> | ||
</Stack> | ||
} | ||
/> | ||
), | ||
}, | ||
]} | ||
/> | ||
); | ||
const PopoverGallery = () => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
return ( | ||
<Layout | ||
description=".." | ||
suggestions={['...']} | ||
boundaryConditions={['...']} | ||
elements={[ | ||
{ | ||
title: 'Default', | ||
element: ( | ||
<Popover | ||
title="Popover Demo" | ||
open={isOpen} | ||
onOpenChange={setIsOpen} | ||
renderTrigger={ | ||
<Button onPress={() => setIsOpen(true)}>Open</Button> | ||
} | ||
renderContent={ | ||
<Stack space="$4" p="$5"> | ||
<Text> | ||
Non exercitation ea laborum cupidatat sunt amet aute | ||
exercitation occaecat minim incididunt non est est | ||
voluptate. | ||
</Text> | ||
<Button variant="primary" onPress={() => setIsOpen(false)}> | ||
Button | ||
</Button> | ||
</Stack> | ||
} | ||
/> | ||
), | ||
}, | ||
]} | ||
/> | ||
); | ||
}; | ||
|
||
export default PopoverGallery; |