- Shows content and pictures of Wikipedia page about one person
- currently "Sheryl Sandberg", can be changed to "Albert Einstein" in src/App.js
- User can switch between 10 languages
- First loaded language is based on user's location/language settings
High dependency on output of Wikipedia Parse API
- Images are automatically inserted
- If css class names in html change layout might be broken
- Css fixes could not take effect anymore
- Current css stylesheet (general and german) are copied: if classnames change in html, css will not be updated automatically. Alternatively I could have linked to their stylesheets, creating a dependency on wikipedia stylesheet's url
- A different approach would have been to use the Revisions API, and get the text and pictures individually. This would have caused more initial effort but might have made it possible to create a self-made styling of the page without relying on the classes of Wikipedia. On the other hand, the texts of the different language Wikipeda pages are all different in length and structure and a one-fits-all styling might not have been ideal.
- The usage of "dangerouslySetInnerHtml" is clearly not recommended, because script tags could be inserted through it
- Tests for the asynchronous data retrieval with useAsync are still missing, in order to ensure that loading, error and result state are correctly handled.
- Currently a lot of code is in the App.js file, which would not happen in a real project where router and components would be handled in there. But due to this projects' limited scope I kept it there. Also the button section, the loader and error message would be (reusable) react components in a real project and not just direct html in one file.
Clone the repo and open terminal in the newly created folder, then:
npm start
Runs the app in the development mode.
npm test
Launches the test runner in the interactive watch mode.
npm run build
Builds the app for production to the build
folder.
This project was bootstrapped with Create React App.