-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feat/upgrade-button
- Loading branch information
Showing
48 changed files
with
785 additions
and
535 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { useState } from 'react' | ||
import { Minus, Plus } from 'react-feather' | ||
import { Box, BoxProps, Text } from 'theme-ui' | ||
|
||
export interface ExpandableContentProps extends BoxProps { | ||
title: string | ||
content: React.ReactNode | ||
expanded?: boolean | ||
} | ||
|
||
const ExpandableContent = ({ | ||
title, | ||
content, | ||
expanded = false, | ||
...props | ||
}: ExpandableContentProps) => { | ||
const [isOpen, setOpen] = useState(expanded) | ||
|
||
return ( | ||
<Box {...props}> | ||
<Box | ||
py={2} | ||
variant="layout.verticalAlign" | ||
sx={{ cursor: 'pointer' }} | ||
onClick={() => setOpen(!isOpen)} | ||
> | ||
<Text variant="strong" mr="auto"> | ||
{title} | ||
</Text> | ||
{isOpen ? <Minus size={18} /> : <Plus size={18} />} | ||
</Box> | ||
{isOpen && ( | ||
<Box py={2} sx={{ color: 'secondaryText' }}> | ||
{content} | ||
</Box> | ||
)} | ||
</Box> | ||
) | ||
} | ||
|
||
export default ExpandableContent |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
import { Box } from 'theme-ui' | ||
import styled from '@emotion/styled' | ||
import Popover, { PopoverProps } from 'components/popover' | ||
|
||
const Container = styled(Box)` | ||
background-color: ${({ theme }: { theme: any }) => | ||
theme.colors.contentBackground}; | ||
border: 1px solid var(--theme-ui-colors-invertedText); | ||
border-radius: 14px; | ||
box-shadow: 0px 10px 25px rgba(0, 0, 0, 0.2); | ||
` | ||
|
||
const Popup = ({ content, ...props }: PopoverProps) => { | ||
return <Popover {...props} content={<Container>{content}</Container>} /> | ||
const Popup = ({ content, containerProps = {}, ...props }: PopoverProps) => { | ||
return ( | ||
<Popover | ||
{...props} | ||
content={ | ||
<Box | ||
{...containerProps} | ||
sx={{ | ||
backgroundCcolor: 'contentBackground', | ||
border: '1px solid', | ||
borderColor: 'invertedText', | ||
borderRadius: '14px', | ||
boxShadow: '0px 10px 25px rgba(0, 0, 0, 0.2)', | ||
...(containerProps.sx || {}), | ||
}} | ||
> | ||
{content} | ||
</Box> | ||
} | ||
/> | ||
) | ||
} | ||
|
||
export default Popup |
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.