diff --git a/locales/en.json b/locales/en.json index 5b7c8a6..58a55b2 100644 --- a/locales/en.json +++ b/locales/en.json @@ -95,6 +95,7 @@ }, "home": { "title": "Campus", + "feedTitle": "Amicale's News", "feed": "Details", "dashboard": { "seeMore": "Click to see more", diff --git a/locales/fr.json b/locales/fr.json index 33ccc4e..5244157 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -95,6 +95,7 @@ }, "home": { "title": "Campus", + "feedTitle": "News de l'Amicale", "feed": "Détails", "dashboard": { "seeMore": "Clique pour plus d'infos", diff --git a/src/screens/Home/HomeScreen.js b/src/screens/Home/HomeScreen.js index a699fa0..54fb956 100644 --- a/src/screens/Home/HomeScreen.js +++ b/src/screens/Home/HomeScreen.js @@ -5,7 +5,7 @@ import {FlatList} from 'react-native'; import i18n from "i18n-js"; import DashboardItem from "../../components/Home/EventDashboardItem"; import WebSectionList from "../../components/Screens/WebSectionList"; -import {withTheme} from 'react-native-paper'; +import {Headline, withTheme} from 'react-native-paper'; import FeedItem from "../../components/Home/FeedItem"; import SmallDashboardItem from "../../components/Home/SmallDashboardItem"; import PreviewEventDashboardItem from "../../components/Home/PreviewEventDashboardItem"; @@ -228,7 +228,7 @@ class HomeScreen extends React.Component { id: SECTIONS_ID[0] }, { - title: '', + title: i18n.t("screens.home.feedTitle"), data: this.currentNewFeed, id: SECTIONS_ID[1] } @@ -511,6 +511,21 @@ class HomeScreen extends React.Component { this.fabRef.current.onScroll(event); }; + renderSectionHeader = (data: { [key: string]: any }) => { + if (data.section.title !== "") + return ( + + {data.section.title} + + ) + else + return null; + } + /** * Callback when pressing the login button on the banner. * This hides the banner and takes the user to the login page. @@ -540,6 +555,7 @@ class HomeScreen extends React.Component { itemHeight={FEED_ITEM_HEIGHT} onScroll={this.onScroll} showError={false} + renderSectionHeader={this.renderSectionHeader} />