-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from City-of-Turku/develop
Release v1.0.0
- Loading branch information
Showing
22 changed files
with
390 additions
and
200 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 |
---|---|---|
@@ -1,12 +1,28 @@ | ||
import React from 'react'; | ||
import { useAppSelector } from '../../hooks/reduxHooks'; | ||
import HomeButton from '../Buttons/HomeButton/HomeButton'; | ||
import ErrorComponent from '../Errors/ErrorComponent/ErrorComponent'; | ||
import Loading from '../Loading/Loading'; | ||
import QuestionForm from '../QuestionForm/QuestionForm'; | ||
|
||
const Content = () => { | ||
const { isLoggedIn } = useAppSelector((state) => state.user); | ||
const { isLoggedIn, isError } = useAppSelector((state) => state.user); | ||
|
||
return <div className="content-inner">{isLoggedIn ? <QuestionForm /> : <Loading />}</div>; | ||
const renderSecondaryContent = () => { | ||
if (isError) { | ||
return ( | ||
<ErrorComponent translationId="app.result.error"> | ||
<HomeButton /> | ||
</ErrorComponent> | ||
); | ||
} else { | ||
return <Loading />; | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="content-inner">{isLoggedIn ? <QuestionForm /> : renderSecondaryContent()}</div> | ||
); | ||
}; | ||
|
||
export default Content; |
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
Oops, something went wrong.