-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial announcement card * Added animation * Added query for blog post, need to update with title * minor naming changes * Added pulse on click * query for new blog post * Changed colors
- Loading branch information
1 parent
349b842
commit 5ecef04
Showing
2 changed files
with
113 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import { Card, CardActionArea, CardContent, Grid, Typography } from '@material-ui/core'; | ||
import ArrowForwardIcon from '@material-ui/icons/ArrowForwardIos'; | ||
|
||
import LinkNoStyle from '../LinkNoStyle/LinkNoStyle'; | ||
import { graphql, useStaticQuery } from 'gatsby'; | ||
|
||
const styles = theme => ({ | ||
container: { | ||
backgroundColor: '#FFFFFF', | ||
padding: theme.spacing(3), | ||
justifyContent: 'center' | ||
}, | ||
card: { | ||
width: '100%', | ||
borderRadius: '20px', | ||
borderColor: 'rgba(201, 96, 255, 0.3)', | ||
boxShadow: '0 1px 20px rgba(201, 96, 255, 0.6)', | ||
background: 'linear-gradient(90deg, #CA32FF, #FF5F96, #CA32FF, #FF5F96)', | ||
position: 'relative', | ||
animation: `$swipe 3s linear infinite` | ||
}, | ||
'@keyframes swipe': { | ||
'0%': { | ||
backgroundSize: '300%', | ||
backgroundPosition: '100% 0' | ||
}, | ||
'100%': { | ||
backgroundSize: '300%', | ||
backgroundPosition: '0 0' | ||
} | ||
}, | ||
content: { | ||
textAlign: 'center', | ||
color: 'white', | ||
paddingTop: theme.spacing(2.5), | ||
'&:last-child': { | ||
paddingBottom: theme.spacing(2.5) | ||
} | ||
}, | ||
forwardArrow: { | ||
fontSize: theme.typography.fontSize, | ||
marginLeft: theme.spacing(2), | ||
marginTop: theme.spacing(0.5), | ||
fontWeight: 700 | ||
}, | ||
grid: { | ||
direction: 'row', | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
}, | ||
item: { | ||
[theme.breakpoints.down('xs')]: { | ||
width: '75%' | ||
} | ||
}, | ||
text: { | ||
fontWeight: 700 | ||
} | ||
}); | ||
|
||
|
||
function Announcement({ classes }) { | ||
const data = useStaticQuery(graphql` | ||
query getInternBlogPost { | ||
allMarkdownRemark( | ||
filter: {fields: {slug: {regex: "/.*hey-future-interns.*/"}}} | ||
) { | ||
nodes { | ||
fields { | ||
slug | ||
} | ||
id | ||
} | ||
} | ||
} | ||
`); | ||
|
||
const url = data.allMarkdownRemark.nodes[0].fields.slug; | ||
|
||
return ( | ||
<Grid container className={classes.container}> | ||
<Card className={classes.card} variant='outlined'> | ||
<CardActionArea> | ||
<LinkNoStyle to={url}> | ||
<CardContent className={classes.content}> | ||
<Grid container className={classes.grid}> | ||
<Grid item className={classes.item}> | ||
<Typography variant='body1' className={classes.text}> | ||
Want to learn more about our internship program? Check out this blog post! | ||
</Typography> | ||
</Grid> | ||
<Grid item justifyContent='center'> | ||
<ArrowForwardIcon className={classes.forwardArrow}/> | ||
</Grid> | ||
</Grid> | ||
</CardContent> | ||
</LinkNoStyle> | ||
</CardActionArea> | ||
</Card> | ||
</Grid> | ||
); | ||
} | ||
|
||
Announcement.propTypes = { | ||
classes: PropTypes.object.isRequired | ||
}; | ||
|
||
export default withStyles(styles)(Announcement); |
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