-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
1 parent
6d6c30e
commit 548c972
Showing
13 changed files
with
179 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,8 @@ export class App extends Component { | |
</> | ||
</ThemeProvider> | ||
</Provider> | ||
|
||
|
||
</> | ||
) | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { | ||
Story, | ||
Meta, | ||
Preview, | ||
Props, | ||
Description, | ||
} from '@storybook/addon-docs/blocks' | ||
import DiscordLink from './DiscordLink' | ||
|
||
<Meta title="Components|DiscordLink" component={DiscordLink} /> | ||
|
||
# Discord Link | ||
|
||
<Story name="Default"> | ||
<DiscordLink /> | ||
</Story> |
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,30 @@ | ||
import { Link, Button } from 'rebass/styled-components' | ||
import styled, { useTheme } from 'styled-components' | ||
|
||
export const DiscordLink = () => { | ||
const theme = useTheme() as any | ||
const OptionalText = styled(`span`)` | ||
display: inline-block; | ||
margin-right: ${theme.space[1]}px; | ||
@media screen and (max-width: ${theme.breakpoints[1]}) { | ||
display: none; | ||
} | ||
` | ||
return ( | ||
<Link | ||
target="_blank" | ||
href="https://discordapp.com/invite/cGZ5hKP" | ||
data-cy="feedback" | ||
> | ||
<Button variant="primary"> | ||
<OptionalText>#Feedback?</OptionalText> | ||
Join our chat{' '} | ||
<span role="img" aria-label="talk-bubble"> | ||
💬 | ||
</span> | ||
</Button> | ||
</Link> | ||
) | ||
} | ||
|
||
export default DiscordLink |
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,16 +1,17 @@ | ||
import loadingSVG from '../../assets/images/loading.svg' | ||
import starSVG from '../../assets/icons/icon-star-default.svg' | ||
import starActiveSVG from '../../assets/icons/icon-star-active.svg' | ||
import githubSVG from '../../assets/icons/icon-github.svg' | ||
|
||
const imgStyle = { | ||
maxWidth: '100%', | ||
} | ||
const loading = <img alt="icon" style={imgStyle} src={loadingSVG} /> | ||
const star = <img alt="icon" style={imgStyle} src={starSVG} /> | ||
const starActive = <img alt="icon" style={imgStyle} src={starActiveSVG} /> | ||
|
||
export default { | ||
loading, | ||
star, | ||
starActive, | ||
const iconMap = { | ||
loading: <img alt="icon" style={imgStyle} src={loadingSVG} />, | ||
star: <img alt="icon" style={imgStyle} src={starSVG} />, | ||
starActive: <img alt="icon" style={imgStyle} src={starActiveSVG} />, | ||
github: <img alt="icon" style={imgStyle} src={githubSVG} />, | ||
} | ||
|
||
export default iconMap |
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,16 @@ | ||
import { | ||
Story, | ||
Meta, | ||
Preview, | ||
Props, | ||
Description, | ||
} from '@storybook/addon-docs/blocks' | ||
import SiteFooter from './SiteFooter' | ||
|
||
<Meta title="Components|SiteFooter" component={SiteFooter} /> | ||
|
||
# Site Footer | ||
|
||
<Story name="Default"> | ||
<SiteFooter /> | ||
</Story> |
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,65 @@ | ||
import { Flex, Link, Text } from 'rebass/styled-components' | ||
import styled, { useTheme } from 'styled-components' | ||
import { Icon } from 'src/components/Icons' | ||
|
||
const SiteFooter = () => { | ||
const theme = useTheme() as any | ||
const discordButtonWidth = 310 | ||
|
||
const Anchor = styled('a')` | ||
color: #fff; | ||
text-decoration: underline; | ||
` | ||
|
||
const IconGlyph = styled(Icon)` | ||
transform: translateY(2px); | ||
` | ||
|
||
const FooterContainer = styled(Flex)` | ||
color: #fff; | ||
margin-top: 45px; | ||
padding: 45px ${theme.space[4]}px; | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
line-heigh: 1.5; | ||
@media only screen and (min-width: ${theme.breakpoints[1]}) { | ||
flex-direction: row; | ||
padding-right: ${discordButtonWidth}px; | ||
text-align: left; | ||
} | ||
` | ||
|
||
return ( | ||
<FooterContainer | ||
bg="#27272c" | ||
alignItems="center" | ||
style={{ | ||
marginTop: '45px', | ||
}} | ||
> | ||
<Icon glyph={'star-active'} mb={[3, 3, 0]} /> | ||
<Text ml={3} mr={1}> | ||
{theme.name} is a project by{' '} | ||
<Anchor href="https://platform.onearmy.earth/" target="_blank"> | ||
One Army | ||
</Anchor> | ||
. | ||
</Text> | ||
|
||
<Text mt={[2, 2, 0]}> | ||
Running on our Platform software,{' '} | ||
<Anchor | ||
href="https://github.com/onearmy/community-platform/" | ||
target="_blank" | ||
> | ||
help us build it | ||
<IconGlyph glyph={'github'} ml={1} /> | ||
</Anchor> | ||
</Text> | ||
</FooterContainer> | ||
) | ||
} | ||
|
||
export default SiteFooter |
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,28 @@ | ||
import { useEffect, useState } from 'react' | ||
import { useHistory } from 'react-router' | ||
import SiteFooter from 'src/components/SiteFooter/SiteFooter' | ||
|
||
const isFooterVisible = path => { | ||
return ( | ||
!path.startsWith('/map') && !path.startsWith('/academy') && path !== '/' | ||
) | ||
} | ||
|
||
const GlobalSiteFooter = () => { | ||
const history = useHistory() | ||
const [showFooter, setShowFooter] = useState( | ||
isFooterVisible(window.location.pathname), | ||
) | ||
|
||
useEffect( | ||
() => | ||
history.listen(location => { | ||
setShowFooter(isFooterVisible(location?.pathname)) | ||
}), | ||
[history], | ||
) | ||
|
||
return showFooter ? <SiteFooter /> : null | ||
} | ||
|
||
export default GlobalSiteFooter |
This file was deleted.
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