-
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 help component * use display instead of visibility * version bump * remove bug fix that is fixed in different PR * move helpContent to fixture and button to shared * improved window styling * combine common theming * v bump
- Loading branch information
1 parent
f135152
commit 9d07e4f
Showing
8 changed files
with
114 additions
and
22 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
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,71 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
import { IconButton } from './Buttons' | ||
|
||
const Wrapper = styled.div` | ||
position: absolute; | ||
top: 200px; | ||
left: 50px; | ||
` | ||
|
||
const ContentWrapper = styled.div` | ||
max-width: 500px; | ||
max-height: 400px; | ||
padding: 10px; | ||
background: ${(props) => props.background}; | ||
display: ${(props) => props.display}; | ||
box-shadow: ${(props) => props.boxShadow}; | ||
border-radius: ${(props) => props.borderRadius}; | ||
border: ${(props) => props.border}; | ||
` | ||
|
||
const ButtonText = styled.p` | ||
font-family: ${(props) => props.fontFamily}; | ||
color: ${(props) => props.color}; | ||
font-size: 24px; | ||
` | ||
|
||
const ContentText = styled.p` | ||
font-family: ${(props) => props.fontFamily}; | ||
color: ${(props) => props.color}; | ||
font-size: 16px; | ||
white-space: pre-line; | ||
text-align: left; | ||
margin: 0; | ||
` | ||
|
||
export default function Help({ | ||
theme, | ||
content, | ||
showContentState, | ||
setShowContentState, | ||
}) { | ||
const toggle = () => { | ||
setShowContentState(!showContentState) | ||
} | ||
|
||
return ( | ||
<Wrapper> | ||
<IconButton | ||
background={theme.primary.window.background} | ||
boxShadow={theme.primary.window.boxShadow} | ||
borderRadius={theme.primary.window.borderRadius} | ||
border={theme.primary.window.border} | ||
onClick={toggle} | ||
> | ||
<ButtonText {...theme.font}>?</ButtonText> | ||
</IconButton> | ||
|
||
<ContentWrapper | ||
display={showContentState ? 'flex' : 'none'} | ||
background={theme.primary.window.background} | ||
boxShadow={theme.primary.window.boxShadow} | ||
borderRadius={theme.primary.window.borderRadius} | ||
border={theme.primary.window.border} | ||
> | ||
<ContentText {...theme.font}>{content}</ContentText> | ||
</ContentWrapper> | ||
</Wrapper> | ||
) | ||
} |
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