forked from opencollective/opencollective-frontend-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from opencollective/style/apply-design
Apply latest design
- Loading branch information
Showing
18 changed files
with
883 additions
and
521 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
public/* | ||
.next/* | ||
lib/graphql/types/* |
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,44 +1,41 @@ | ||
import React from 'react'; | ||
import Image from 'next/image'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import styled from 'styled-components'; | ||
|
||
import packageJSON from '../package.json'; | ||
import Container from '@opencollective/frontend-components/components/Container'; | ||
import { P } from '@opencollective/frontend-components/components/Text'; | ||
|
||
const StyledFooter = styled.footer` | ||
margin-top: 2rem; | ||
font-size: 13px; | ||
ul { | ||
margin-bottom: 1rem; | ||
padding: 0; | ||
list-style: none; | ||
} | ||
li { | ||
margin-right: 1rem; | ||
display: inline-block; | ||
} | ||
padding: 36px 40px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
max-width: 1280px; | ||
margin: 0 auto; | ||
`; | ||
|
||
export default function Footer() { | ||
return ( | ||
<StyledFooter> | ||
<hr /> | ||
<ul> | ||
<li> | ||
<em> | ||
<strong> | ||
{packageJSON.name}@{packageJSON.version} | ||
</strong> | ||
</em> | ||
</li> | ||
<li> | ||
<em> | ||
<strong> | ||
opencollective/frontend-components@{packageJSON.dependencies['@opencollective/frontend-components']} | ||
</strong> | ||
</em> | ||
</li> | ||
</ul> | ||
<P fontSize="18px" fontWeight="800"> | ||
<FormattedMessage defaultMessage="Contributor's dashboard" /> | ||
</P> | ||
<Container | ||
display="flex" | ||
flexDirection="column" | ||
fontSize="14px" | ||
fontWeight="400" | ||
justifyContent="center" | ||
alignItems="center" | ||
> | ||
<Container mb="13px"> | ||
<FormattedMessage defaultMessage="Contributors dashboard is an initiative by" /> | ||
</Container> | ||
<a href="https://opencollective.com" target="_blank" rel="noopener noreferrer"> | ||
<Image src="/images/logo-greyscale.png" alt="by Open Collective" width="151" height="29" /> | ||
</a> | ||
</Container> | ||
</StyledFooter> | ||
); | ||
} |
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,26 @@ | ||
import React from 'react'; | ||
|
||
import { Span } from '@opencollective/frontend-components/components/Text'; | ||
|
||
export const PercentageDiff = ({ previousValue, newValue }) => { | ||
if (newValue === 0 || previousValue === 0 || newValue === previousValue) { | ||
return null; | ||
} | ||
|
||
const percentage = Math.round(((newValue - previousValue) / previousValue) * 100); | ||
if (!percentage) { | ||
return null; | ||
} else if (percentage > 0) { | ||
return ( | ||
<Span color="green.700"> | ||
<Span color="green.500">↑</Span> {percentage}% | ||
</Span> | ||
); | ||
} else { | ||
return ( | ||
<Span color="red.700"> | ||
<Span color="red.500">↓</Span> {percentage}% | ||
</Span> | ||
); | ||
} | ||
}; |
Oops, something went wrong.
6d8a0d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
funders-dashboard – ./
funders-dashboard-opencollective.vercel.app
funders-dashboard.vercel.app
funders-dashboard-git-main-opencollective.vercel.app