diff --git a/packages/core/admin/admin/src/pages/HomePage/index.js b/packages/core/admin/admin/src/pages/HomePage/index.js index 8d2f1891c6..5d546d99ba 100644 --- a/packages/core/admin/admin/src/pages/HomePage/index.js +++ b/packages/core/admin/admin/src/pages/HomePage/index.js @@ -5,10 +5,8 @@ */ /* eslint-disable */ import React, { memo, useMemo } from 'react'; -import { FormattedMessage } from 'react-intl'; +import { FormattedMessage, useIntl } from 'react-intl'; import { get, upperFirst } from 'lodash'; -import { auth, LoadingIndicatorPage } from '@strapi/helper-plugin'; -import PageTitle from '../../components/PageTitle'; import { useModels } from '../../hooks'; import useFetch from './hooks'; @@ -16,6 +14,11 @@ import { ALink, Block, Container, LinkWrapper, P, Wave, Separator } from './comp import BlogPost from './BlogPost'; import SocialLink from './SocialLink'; +import PageTitle from '../../components/PageTitle'; +import { auth, LoadingIndicatorPage, SettingsPageTitle } from '@strapi/helper-plugin'; +import { HeaderLayout, Layout, ContentLayout, ActionLayout } from '@strapi/parts/Layout'; +import { Main } from '@strapi/parts/Main'; + const FIRST_BLOCK_LINKS = [ { link: @@ -62,17 +65,18 @@ const SOCIAL_LINKS = [ ]; const HomePage = ({ history: { push } }) => { - const { error, isLoading, posts } = useFetch(); - // Temporary until we develop the menu API + const { formatMessage } = useIntl(); + // const { error, isLoading, posts } = useFetch(); + // // Temporary until we develop the menu API const { collectionTypes, singleTypes, isLoading: isLoadingForModels } = useModels(); - const handleClick = e => { - e.preventDefault(); + // const handleClick = e => { + // e.preventDefault(); - push( - '/plugins/content-type-builder/content-types/plugins::users-permissions.user?modalType=contentType&kind=collectionType&actionType=create&settingType=base&forTarget=contentType&headerId=content-type-builder.modalForm.contentType.header-create&header_icon_isCustom_1=false&header_icon_name_1=contentType&header_label_1=null' - ); - }; + // push( + // '/plugins/content-type-builder/content-types/plugins::users-permissions.user?modalType=contentType&kind=collectionType&actionType=create&settingType=base&forTarget=contentType&headerId=content-type-builder.modalForm.contentType.header-create&header_icon_isCustom_1=false&header_icon_name_1=contentType&header_label_1=null' + // ); + // }; const hasAlreadyCreatedContentTypes = useMemo(() => { const filterContentTypes = contentTypes => contentTypes.filter(c => c.isDisplayed); @@ -86,153 +90,168 @@ const HomePage = ({ history: { push } }) => { return ; } - const headerId = hasAlreadyCreatedContentTypes - ? 'HomePage.greetings' - : 'app.components.HomePage.welcome'; - const username = get(auth.getUserInfo(), 'firstname', ''); - const linkProps = hasAlreadyCreatedContentTypes - ? { - id: 'app.components.HomePage.button.blog', - href: 'https://strapi.io/blog/', - onClick: () => {}, - type: 'blog', - target: '_blank', - } - : { - id: 'app.components.HomePage.create', - href: '', - onClick: handleClick, - type: 'documentation', - }; + // const headerId = hasAlreadyCreatedContentTypes + // ? 'HomePage.greetings' + // : 'app.components.HomePage.welcome'; + // const username = get(auth.getUserInfo(), 'firstname', ''); + // const linkProps = hasAlreadyCreatedContentTypes + // ? { + // id: 'app.components.HomePage.button.blog', + // href: 'https://strapi.io/blog/', + // onClick: () => {}, + // type: 'blog', + // target: '_blank', + // } + // : { + // id: 'app.components.HomePage.create', + // href: '', + // onClick: handleClick, + // type: 'documentation', + // }; return ( - <> + {title => } - -
-
- - - - {msg =>

{msg}

} -
- {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}

} -
-
- ); - })} -
-
-
+ // {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'; -
- - {msg =>

{msg}

}
- - {content =>

{content}

} -
- - {msg => ( - - {msg} - - )} - + // return ( + // + // + // {title =>

{title}

} + //
+ // + // {content =>

{content}

} + //
+ //
+ // ); + // })} + //
+ // + //
- -
- {SOCIAL_LINKS.map((value, key) => ( - - ))} -
- -
- -
- + //
+ // + // {msg =>

{msg}

}
+ // + // {content =>

{content}

} + //
+ // + // {msg => ( + // + // {msg} + // + // )} + // + + // + //
+ // {SOCIAL_LINKS.map((value, key) => ( + // + // ))} + //
+ //
+ //
+ // + // + // ); }; diff --git a/packages/core/admin/admin/src/translations/en.json b/packages/core/admin/admin/src/translations/en.json index 929fa64fae..ba4aeca0b6 100644 --- a/packages/core/admin/admin/src/translations/en.json +++ b/packages/core/admin/admin/src/translations/en.json @@ -220,10 +220,10 @@ "app.components.HomePage.community": "Find the community on the web", "app.components.HomePage.community.content": "Discuss with team members, contributors and developers on different channels.", "app.components.HomePage.create": "Create your first Content-Type", - "app.components.HomePage.welcome": "Welcome on board!", - "app.components.HomePage.welcome.again": "Welcome ", + "app.components.HomePage.welcome": "Welcome on board 👋", + "app.components.HomePage.welcome.again": "Welcome 👋", "app.components.HomePage.welcomeBlock.content": "We are happy to have you as part of the community. We are constantly looking for feedback so feel free to send us DM on ", - "app.components.HomePage.welcomeBlock.content.again": "We hope you are making progress on your project... Feel free to read the latest news about Strapi. We are giving our best to improve the product based on your feedback.", + "app.components.HomePage.welcomeBlock.content.again": "We hope you are making progress on your project! Feel free to read the latest news about Strapi. We are giving our best to improve the product based on your feedback.", "app.components.HomePage.welcomeBlock.content.issues": "issues.", "app.components.HomePage.welcomeBlock.content.raise": " or raise ", "app.components.ImgPreview.hint": "Drag & drop your file into this area or {browse} for a file to upload",