Commit 535ba139 authored by BsmhDev's avatar BsmhDev

change no more quizzes to display message

parent 0a9f8a2a
......@@ -20,6 +20,8 @@
@import "{}/imports/ui/stylesheets/history.less";
@import "{}/imports/ui/stylesheets/snackbar.less";
@import "{}/imports/ui/stylesheets/game-close.less";
@import "{}/imports/ui/stylesheets/search.less";
.classic-padding-top {
padding-top: 15px;
......
......@@ -27,10 +27,7 @@ const LoaderAndUI = ({ results, loading, query, state, actions, actionsForUI })
: <div id="search">
<h1>תוצאות חיפוש עבור <strong>{query}</strong></h1>
<InfiniteScroll
loadMore={() => {
actionsForUI.MoreQuizzesToDisplay();
actionsForUI.CheckResults(results.length);
}}
loadMore={actionsForUI.MoreQuizzesToDisplay}
hasMore={!(results.length < state.quizzesToDisplay)}
loader={<Loading />}
>
......@@ -53,14 +50,11 @@ const LoaderAndUI = ({ results, loading, query, state, actions, actionsForUI })
: 'השאלון הועתק בהצלחה'}
</div>
<div
id="snackbar"
className={
state.noMoreQuizzes ? 'show' : ''
results.length < state.quizzesToDisplay ? 'show infinite-scroll-text' : ''
}
>
{state.noMoreQuizzes
? 'אין עוד שאלונים להצגה'
: null}
{ 'אין עוד שאלונים להצגה' }
</div>
<SweetAlert
show={state.showDeleteQuizAlert}
......@@ -134,14 +128,6 @@ export default class Search extends React.Component {
const showDeleteAlert = (quiz) => {
this.setState({ quizToDelete: quiz, showDeleteQuizAlert: true });
};
const CheckResults = (results) => {
const notifyUser = () => {
this.setState({ noMoreQuizzes: true });
setTimeout(() => this.setState({ noMoreQuizzes: false }), 2000);
};
if (results < this.state.quizzesToDisplay) notifyUser();
};
const deleteQuiz = () => {
this.state.quizToDelete.applyMethod('delete', []);
const notifyUser = () => {
......@@ -184,7 +170,6 @@ export default class Search extends React.Component {
MoreQuizzesToDisplay,
RemoveQuizAlert,
ConfirmOrCancel,
CheckResults,
};
return <DBProvider query={query} state={this.state} actions={actions} actionsForUI={actionsForUI} />;
......
.infinite-scroll-text {
display: none;
padding-top: 20px;
border-top: 1px solid #DDD;
text-align: center;
color: #777;
font-size: 200%;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment