-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Featured projects: welcome banner (#5650)
* Projects welcome banner Add a featured projects banner to the projects page. Add some projects page styles. Add projects page text to the English locale file. * Remove constraint from admin interface. Remove line for prototyping now the API supports multiple Co-authored-by: Sarah Allen <[email protected]>
- Loading branch information
1 parent
7221e48
commit f483263
Showing
6 changed files
with
73 additions
and
23 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
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,40 @@ | ||
import counterpart from 'counterpart'; | ||
import { Markdown } from 'markdownz'; | ||
import apiClient from 'panoptes-client/lib/api-client'; | ||
import React, { Component } from 'react'; | ||
import Translate from 'react-translate-component'; | ||
import ProjectCardList from './project-card-list'; | ||
|
||
class ProjectsWelcome extends Component { | ||
constructor() { | ||
super(); | ||
this.state = { | ||
featuredProjects: [] | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
this.getFeaturedProjects(); | ||
} | ||
|
||
getFeaturedProjects() { | ||
const query = { featured: true, launch_approved: true, cards: true }; | ||
return apiClient.type('projects').get(query) | ||
.then((featuredProjects) => { | ||
this.setState({ featuredProjects }); | ||
}); | ||
} | ||
render() { | ||
return ( | ||
<div className="resources-container welcome-banner"> | ||
<Translate content="projects.welcome.heading" component="h2" /> | ||
<Translate content="projects.welcome.thanks" component="p" /> | ||
<Markdown>{counterpart('projects.welcome.talk')}</Markdown> | ||
<ProjectCardList projects={this.state.featuredProjects} /> | ||
<p><Translate content="projects.welcome.scrollDown" component="em" /></p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default ProjectsWelcome; |
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,19 @@ | ||
|
||
.resources-container .welcome-banner | ||
background: #fff | ||
padding: 2em 4em | ||
|
||
h2 | ||
font-size: 1.1em | ||
text-transform: uppercase | ||
|
||
p | ||
margin: 1.4em auto 0 | ||
text-align: center | ||
max-width: 50em | ||
|
||
em | ||
color: COPY | ||
font-style: normal | ||
font-weight: normal | ||
text-transform: uppercase |