-
- {SOCIAL_LINKS.map((value, key) => (
-
+
+
+ {hasAlreadyCreatedContentTypes ? (
+
+ {msg => {msg}
}
+
+ ) : (
+
+ {congrats => {
+ return (
+
+ {content => {
+ return (
+
+ {boldContent => {
+ return (
+
+ {congrats}
+ {content}
+ {boldContent}
+
+ );
+ }}
+
+ );
+ }}
+
+ );
+ }}
+
+ )}
+ {hasAlreadyCreatedContentTypes && (
+
+ {posts.map((post, index) => (
+
))}
-
+ )}
+
+ {msg => (
+
+ {msg}
+
+ )}
+
+
+
+ {FIRST_BLOCK_LINKS.map((data, index) => {
+ const type = index === 0 ? 'doc' : 'code';
+
+ return (
+
+
+ {title => {title}
}
+
+
+ {content => {content}
}
+
+
+ );
+ })}
-
-
-
-
-
- {message => {message}
}
-
-
+
+
+
+
+
+
+ {msg => (
+
+ {msg}
+
+ )}
+
+
+ {SOCIAL_LINKS.map((value, key) => (
+
+ ))}
-
- );
- }
-}
-
-HomePage.contextTypes = {
- plugins: PropTypes.object,
-};
-
-HomePage.propTypes = {
- getArticles: PropTypes.func.isRequired,
- homePage: PropTypes.object.isRequired,
- onChange: PropTypes.func.isRequired,
- submit: PropTypes.func.isRequired,
-};
-
-const mapStateToProps = createStructuredSelector({
- homePage: makeSelectHomePage(),
- plugins: selectPlugins(),
-});
-
-function mapDispatchToProps(dispatch) {
- return bindActionCreators(
- {
- getArticles,
- onChange,
- submit,
- },
- dispatch
+
+ >
);
-}
+};
-const withConnect = connect(
- mapStateToProps,
- mapDispatchToProps
-);
-
-const withReducer = injectReducer({ key: 'homePage', reducer });
-const withSaga = injectSaga({ key: 'homePage', saga });
-
-// export default connect(mapDispatchToProps)(HomePage);
-export default compose(
- withReducer,
- withSaga,
- withConnect
-)(HomePage);
+export default memo(HomePage);
diff --git a/packages/strapi-admin/admin/src/containers/HomePage/messages.json b/packages/strapi-admin/admin/src/containers/HomePage/messages.json
deleted file mode 100644
index 18d78e2878..0000000000
--- a/packages/strapi-admin/admin/src/containers/HomePage/messages.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "welcome": {
- "id": "app.components.HomePage.welcome",
- "defaultMessage": "Welcome on board!"
- }
-}
diff --git a/packages/strapi-admin/admin/src/containers/HomePage/reducer.js b/packages/strapi-admin/admin/src/containers/HomePage/reducer.js
deleted file mode 100644
index 3f3a086ca8..0000000000
--- a/packages/strapi-admin/admin/src/containers/HomePage/reducer.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- *
- * HomePage reducer
- */
-
-import { fromJS, List, Map } from 'immutable';
-
-import { GET_ARTICLES_SUCCEEDED, ON_CHANGE, SUBMIT_SUCCEEDED } from './constants';
-
-const initialState = fromJS({
- articles: List([
- {content: '', title: '', link: ''},
- {content: '', title: '', link: ''},
- ]),
- body: Map({
- email: '',
- }),
-});
-
-function homePageReducer(state = initialState, action) {
- switch (action.type) {
- case GET_ARTICLES_SUCCEEDED:
- return state.update('articles', () => List(action.articles));
- case ON_CHANGE:
- return state.updateIn(['body', 'email'], () => action.value);
- case SUBMIT_SUCCEEDED:
- return state.updateIn(['body', 'email'], () => '');
- default:
- return state;
- }
-}
-
-export default homePageReducer;
diff --git a/packages/strapi-admin/admin/src/containers/HomePage/saga.js b/packages/strapi-admin/admin/src/containers/HomePage/saga.js
deleted file mode 100644
index c302653dd4..0000000000
--- a/packages/strapi-admin/admin/src/containers/HomePage/saga.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* eslint-disable */
-import 'whatwg-fetch';
-import { dropRight, take } from 'lodash';
-import removeMd from 'remove-markdown';
-import { all, call, fork, put, select, takeLatest } from 'redux-saga/effects';
-import { request } from 'strapi-helper-plugin';
-import { getArticlesSucceeded, submitSucceeded } from './actions';
-import { GET_ARTICLES, SUBMIT } from './constants';
-import { makeSelectBody } from './selectors';
-
-function* getArticles() {
- try {
- const articles = yield call(fetchArticles);
- const posts = articles.posts.reduce((acc, curr) => {
- // Limit to 200 characters and remove last word.
- const content = dropRight(
- take(removeMd(curr.markdown), 250)
- .join('')
- .split(' ')
- ).join(' ');
-
- acc.push({
- title: curr.title,
- link: curr.slug,
- content: `${content} [...]`,
- });
-
- return acc;
- }, []);
-
- yield put(getArticlesSucceeded(posts));
- } catch (err) {
- // Silent
- }
-}
-
-function* submit() {
- try {
- const body = yield select(makeSelectBody());
- yield call(request, 'https://analytics.strapi.io/register', {
- method: 'POST',
- body,
- });
- } catch (err) {
- // silent
- } finally {
- strapi.notification.success('HomePage.notification.newsLetter.success');
- yield put(submitSucceeded());
- }
-}
-
-function* defaultSaga() {
- yield all([
- fork(takeLatest, SUBMIT, submit),
- fork(takeLatest, GET_ARTICLES, getArticles),
- ]);
-}
-
-function fetchArticles() {
- return fetch(
- 'https://blog.strapi.io/ghost/api/v0.1/posts/?client_id=ghost-frontend&client_secret=1f260788b4ec&limit=2',
- {}
- ).then(resp => {
- return resp.json ? resp.json() : resp;
- });
-}
-export default defaultSaga;
diff --git a/packages/strapi-admin/admin/src/containers/HomePage/selectors.js b/packages/strapi-admin/admin/src/containers/HomePage/selectors.js
deleted file mode 100644
index 46699dab14..0000000000
--- a/packages/strapi-admin/admin/src/containers/HomePage/selectors.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import { createSelector } from 'reselect';
-
-/**
- * Direct selector to the homePage state domain
- */
-const selectHomePageDomain = () => (state) => state.get('homePage');
-
-/**
- * Other specific selectors
- */
-
-
-/**
- * Default selector used by HomePage
- */
-
-const makeSelectHomePage = () => createSelector(
- selectHomePageDomain(),
- (substate) => substate.toJS(),
-);
-
-const makeSelectBody = () => createSelector(
- selectHomePageDomain(),
- (substate) => substate.get('body').toJS(),
-);
-
-
-export default makeSelectHomePage;
-export {
- makeSelectBody,
- selectHomePageDomain,
-};
diff --git a/packages/strapi-admin/admin/src/containers/HomePage/styles.scss b/packages/strapi-admin/admin/src/containers/HomePage/styles.scss
deleted file mode 100644
index 6c8c72d2fd..0000000000
--- a/packages/strapi-admin/admin/src/containers/HomePage/styles.scss
+++ /dev/null
@@ -1,289 +0,0 @@
-.blockLink {
- position: relative;
- width: calc(50% - 6px);
- height: auto;
- margin-top: 41px;
- padding: 22px 25px 19px 96px;
- background: #F7F8F8;
- border-radius: 3px;
- line-height: 18px;
- text-decoration: none;
- > span {
- font-family: Lato-Bold;
- font-size: 16px;
- color: #333740;
- letter-spacing: 0;
- }
- > p {
- font-family: Lato-Regular;
- font-size: 13px;
- color: #919BAE;
- letter-spacing: 0;
- line-height: 18px;
- margin: 0;
- }
- &:hover {
- text-decoration: none;
- }
-}
-
-.blockLinkDocumentation {
- &:before {
- content: '\f02d';
- position: absolute;
- left: 3rem;
- top: 4rem;
- color: #42B88E;
- font-family: 'FontAwesome';
- font-size: 38px;
- }
-}
-
-.blockLinkCode {
- &:before {
- content: '\f121';
- position: absolute;
- left: 3rem;
- top: 4rem;
- color: #F0811E;
- font-family: 'FontAwesome';
- font-size: 38px;
- }
-}
-
-.blockShirt {
- position: relative;
- min-height: 34rem;
- margin-bottom: 20px;
- background-image: linear-gradient(45deg, #1A67DA 0%, #0097F6 100%) !important;
- line-height: 18px;
- > div {
- position: absolute;
- padding: 38px 0 62px 25px;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- color: #FFFFFF;
-
- > p {
- max-width: 400px;
- margin-top: 18px;
- margin-bottom: 125px;
- padding-right: 35px;
- font-size: 13px;
- font-weight: 400;
- }
- }
- &:before {
- opacity: 0.7;
- content: '';
- background-image: url('../../assets/images/bg_hp_tee_shirt.png') !important;
- background-size: contain;
- background-repeat: no-repeat;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- }
-}
-.communityContentP {
- display: block;
- max-width: 49rem !important;
- margin-top: 0 !important;
- margin-bottom: 51px;
- color: #919BAE !important;
-}
-
-.containerFluid {
- padding: 47px 13px 0 13px;
- > div {
- margin: 0;
- }
-}
-
-.homePageFlex {
- display: flex;
- width: 100%;
- justify-content: space-between;
-}
-
-.homePageForm {
- padding-top: 19px;
- padding-left: 15px;
-
- div {
- padding: 0;
- }
-
- input {
- float: left;
- width: calc(100% - 120px);
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-
- &:focus {
- border-color: #E3E9F3;
- }
-
- &::-webkit-input-placeholder {
- font-style: italic;
- }
- }
-
- button {
- float: left;
- min-width: 100px;
- height: 3.4rem;
- margin-top: .9rem;
- padding-left: 20px;
- padding-right: 20px;
- text-align: center;
- background: #333740;
- color: #FFFFFF;
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
- font-size: 12px;
- font-weight: 800;
- letter-spacing: 0.5px;
- }
-}
-
-.homePageTutorialButton {
- position: relative;
- height: 34px;
- margin-top: 17px;
- margin-bottom: 1px;
- padding-left: 40px;
- padding-right: 20px;
- font-size: 13px;
- font-weight: 800;
- line-height: 33px;
- letter-spacing: 0.46px;
- text-align: left;
- &:before {
- content: '\f105';
- position: absolute;
- top: 0;
- bottom: 0;
- left: 20px;
- font-size: 22px;
- margin-right: 10px;
- font-family: 'FontAwesome';
- }
-}
-
-.homePageBlogButton {
- position: relative;
- height: 34px;
- margin-top: 17px;
- margin-bottom: 1px;
- padding-left: 40px;
- padding-right: 20px;
- background: #333740;
- color: white;
- font-size: 13px;
- font-weight: 800;
- line-height: 33px;
- letter-spacing: 0.46px;
- text-align: left;
- &:before {
- content: '\f105';
- position: absolute;
- top: 0;
- bottom: 0;
- left: 20px;
- font-size: 22px;
- margin-right: 10px;
- font-family: 'FontAwesome';
- }
-}
-
-.iconWave {
- position: absolute;
- top: 24px;
- right: 0px;
- font-size: 50px;
-}
-
-.newsLetterWrapper {
- height: auto;
- min-width: 50%;
- padding: 20px 20px;
- background: #F7F8F8;
- border-radius: 3px;
- line-height: 18px;
- > div {
- padding-right: 50px;
- > span {
- font-weight: 500;
- font-size: 14px;
- }
- }
-}
-
-.socialLink {
- height: 54px;
- font-size: 14px;
- font-weight: 500;
- position: relative;
- a {
- color: #333740 !important;
- text-decoration: none;
- line-height: 18px;
-
- div {
- display: inline-block;
- height: 25px;
- width: 25px;
- text-align: center;
- vertical-align: top;
- }
-
- img {
- max-height: 25px;
- max-width: 25px;
- }
- span {
- margin-left: 11px;
- }
- &:hover {
- text-decoration: none;
- }
- }
-}
-
-.welcomeContentA {
- color: #005FEA;
- text-decoration: none;
- &:hover {
- text-decoration: none;
- }
-}
-
-.welcomeContentP {
- display: block;
- max-width: 55rem !important;
- margin-bottom: 31px;
-}
-
-.spinner {
- display: flex;
- justify-content: space-around;
- width: 100%;
- margin: auto;
- > div {
- border: 2px solid #f3f3f3; /* Light grey */
- border-top: 2px solid #3498db; /* Blue */
- border-radius: 50%;
- width: 10px;
- height: 10px;
- animation: spin 2s linear infinite;
- }
-}
-
-@keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
-}
diff --git a/packages/strapi-admin/admin/src/translations/en.json b/packages/strapi-admin/admin/src/translations/en.json
index 7b0e5111ef..adc2d02ccf 100644
--- a/packages/strapi-admin/admin/src/translations/en.json
+++ b/packages/strapi-admin/admin/src/translations/en.json
@@ -154,5 +154,12 @@
"notification.error": "An error occurred",
"notification.error.layout": "Couldn't retrieve the layout",
"request.error.model.unknown": "This model doesn't exist",
- "app.utils.delete": "Delete"
+ "app.utils.delete": "Delete",
+ "HomePage.helmet.title": "Homepage",
+ "HomePage.welcome.congrats": "Congrats!",
+ "HomePage.welcome.congrats.content": "You are logged as the first administrator. To discover the powerful features provided by Strapi,",
+ "HomePage.welcome.congrats.content.bold": "we recommend you to create your first Content-Type.",
+ "HomePage.community": "Join the Community",
+ "HomePage.roadmap": "See our roadmap",
+ "HomePage.greetings": "Hi {name}!"
}
diff --git a/packages/strapi-admin/admin/src/translations/fr.json b/packages/strapi-admin/admin/src/translations/fr.json
index c8d78af213..4b26880309 100644
--- a/packages/strapi-admin/admin/src/translations/fr.json
+++ b/packages/strapi-admin/admin/src/translations/fr.json
@@ -154,5 +154,12 @@
"notification.error": "Une erreur est survenue",
"notification.error.layout": "Impossible de récupérer le layout de l'admin",
"request.error.model.unknown": "Le model n'existe pas",
- "app.utils.delete": "Supprimer"
+ "app.utils.delete": "Supprimer",
+ "HomePage.helmet.title": "Accueil",
+ "HomePage.welcome.congrats": "Bravo!",
+ "HomePage.welcome.congrats.content": "Vous êtes connecté en tant que premier Administrateur. Afin de découvrir les fonctionnalités proposées par Strapi,",
+ "HomePage.welcome.congrats.content.bold": "nous vous conseillons de créer votre premier Type de Contenu.",
+ "HomePage.community": "Rejoignez la Communauté",
+ "HomePage.roadmap": "Regardez notre roadmap",
+ "HomePage.greetings": "Bonjour {name}!"
}