├── src
├── Components
│ ├── List.jsx
│ ├── SearchBar.jsx
│ ├── Feed.jsx
│ ├── QuickList.jsx
│ ├── Home.jsx
│ ├── Login.jsx
│ └── Table.jsx
├── setupTests.js
├── index.js
├── assets
│ └── SSlogo.svg
├── Router.js
├── Theme.js
├── index.css
└── serviceWorker.js
├── .gitignore
├── public
├── manifest.json
└── index.html
├── package.json
└── README.md
/src/Components/List.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | export default function List() {
3 | return
Hello world!
;
4 | }
5 |
--------------------------------------------------------------------------------
/src/Components/SearchBar.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import { Button } from "@material-ui/core";
3 | import Home from "./Home";
4 | function SearchBar() {
5 | return;
6 | }
7 | export default SearchBar;
8 |
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
13 |
14 |
15 |
16 | Scientific Search
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import "./index.css";
4 | import { ThemeProvider } from "@material-ui/core/styles";
5 | import Theme from "./Theme";
6 | import * as serviceWorker from "./serviceWorker";
7 | import RouterApp from "./Router";
8 |
9 | ReactDOM.render(
10 |
11 |
12 |
13 |
14 | ,
15 | document.getElementById("root")
16 | );
17 |
18 | // If you want your app to work offline and load faster, you can change
19 | // unregister() to register() below. Note this comes with some pitfalls.
20 | // Learn more about service workers: https://bit.ly/CRA-PWA
21 | serviceWorker.unregister();
22 |
--------------------------------------------------------------------------------
/src/assets/SSlogo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
15 |
--------------------------------------------------------------------------------
/src/Router.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Home from "./Components/Home";
3 | import Login from "./Components/Login";
4 | import Feed from "./Components/Feed";
5 | import QuickList from "./Components/QuickList";
6 | import List from "./Components/List";
7 |
8 | import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
9 |
10 | function RouterApp() {
11 | return (
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | );
24 | }
25 |
26 | export default RouterApp;
27 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ss-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@material-ui/core": "^4.9.10",
7 | "@material-ui/icons": "^4.9.1",
8 | "@testing-library/jest-dom": "^4.2.4",
9 | "@testing-library/react": "^9.5.0",
10 | "@testing-library/user-event": "^7.2.1",
11 | "react": "^16.13.1",
12 | "react-dom": "^16.13.1",
13 | "react-responsive": "^8.0.3",
14 | "react-router-dom": "^5.1.2",
15 | "react-scripts": "3.4.1"
16 | },
17 | "scripts": {
18 | "start": "react-scripts start",
19 | "build": "react-scripts build",
20 | "test": "react-scripts test",
21 | "eject": "react-scripts eject"
22 | },
23 | "eslintConfig": {
24 | "extends": "react-app"
25 | },
26 | "browserslist": {
27 | "production": [
28 | ">0.2%",
29 | "not dead",
30 | "not op_mini all"
31 | ],
32 | "development": [
33 | "last 1 chrome version",
34 | "last 1 firefox version",
35 | "last 1 safari version"
36 | ]
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Theme.js:
--------------------------------------------------------------------------------
1 | import { createMuiTheme } from "@material-ui/core/styles";
2 |
3 | const theme = createMuiTheme({
4 | palette: {
5 | common: { black: "#000", white: "#fff" },
6 | background: { paper: "#fff", default: "rgba(244, 247, 252, 1)" },
7 | primary: {
8 | light: "rgba(244, 247, 252, 1)",
9 | main: "rgba(118, 160, 230, 1)",
10 | dark: "rgba(108, 143, 224, 1)",
11 | contrastText: "#fff",
12 | },
13 | secondary: {
14 | light: "rgba(173, 231, 240, 1)",
15 | main: "rgba(118, 215, 230, 1)",
16 | dark: "rgba(0, 187, 211, 1)",
17 | contrastText: "#fff",
18 | },
19 | error: {
20 | light: "#e57373",
21 | main: "#f44336",
22 | dark: "#d32f2f",
23 | contrastText: "#fff",
24 | },
25 | text: {
26 | primary: "rgba(134, 141, 149, 1)",
27 | secondary: "rgba(180, 185, 189, 1)",
28 | disabled: "rgba(0, 0, 0, 1)",
29 | hint: "rgba(180, 185, 189, 1)",
30 | },
31 | },
32 | shape: {
33 | borderRadius: "1em",
34 | },
35 | typography: {
36 | h1: {
37 | fontSize: "4rem",
38 | },
39 | h2: {
40 | fontSize: "3rem",
41 | },
42 | h3: {
43 | fontSize: "2em",
44 | },
45 | h4: {
46 | fontSize: "1.5em",
47 | },
48 | h5: {
49 | fontSize: "1em",
50 | fontWeight: "bold",
51 | },
52 | h6: {
53 | fontSize: ".7em",
54 | fontWeight: "bold",
55 | },
56 | },
57 | });
58 | export default theme;
59 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: Roboto;
4 | background-color: #f4f7fc;
5 | }
6 | a {
7 | color: #b4b9bd;
8 | text-decoration: none !important;
9 | cursor: pointer;
10 | }
11 | a:hover {
12 | color: #868d95;
13 | cursor: pointer;
14 | }
15 | .input-tag {
16 | margin-top: 2%;
17 | background: white;
18 | border-radius: 0.7em;
19 | padding: 1.7% 0 1.7% 3%;
20 | }
21 | .input-tag-txt {
22 | display: inline;
23 | }
24 | .input-tag-btn {
25 | display: inline;
26 | }
27 | ::placeholder {
28 | color: #b4b9bd;
29 | opacity: 1;
30 | }
31 | .input-tag input {
32 | color: #b4b9bd;
33 | font-size: 1em;
34 | border: none;
35 | width: 100%;
36 | }
37 | textarea:focus,
38 | input:focus {
39 | outline: none;
40 | }
41 | .input-tag__tags {
42 | display: inline-flex;
43 | flex-wrap: wrap;
44 | margin: 0;
45 | padding: 0;
46 | width: 100%;
47 | }
48 |
49 | .input-tag__tags li {
50 | align-items: center;
51 | background: #f4f7fc;
52 | border-radius: 0.3em;
53 | color: #868d95;
54 | font-size: 1em;
55 | display: flex;
56 | list-style: none;
57 | margin-right: 1%;
58 | padding: 1%;
59 | }
60 |
61 | .input-tag__tags li button {
62 | border: none;
63 | background: #f4f7fc;
64 | color: #868d95;
65 | cursor: pointer;
66 | font-size: 1em;
67 | display: inline-flex;
68 | justify-content: center;
69 | line-height: 0;
70 | margin-left: 9%;
71 | padding-right: 12%;
72 | }
73 | button:focus {
74 | outline: 0;
75 | }
76 |
77 | .input-tag__tags li.input-tag__tags__input {
78 | background: none;
79 | flex-grow: 1;
80 | padding: 0;
81 | }
82 |
83 | .box-cell {
84 | display: table-cell;
85 | width: 90%;
86 | }
87 | .box-cell.box1 {
88 | background: green;
89 | color: white;
90 | text-align: justify;
91 | }
92 | .box-cell.box2 {
93 | background: lightgreen;
94 | align-items: center;
95 | justify-content: center;
96 | }
97 |
--------------------------------------------------------------------------------
/src/Components/Feed.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Grid, Box, Avatar, Typography } from "@material-ui/core";
3 | import TableResults from "./Table";
4 | import logo from "../assets/SSlogo.svg";
5 | import { makeStyles } from "@material-ui/core/styles";
6 | import { Link } from "react-router-dom";
7 | import TemporaryDrawer from "./QuickList";
8 |
9 | const useStyles = makeStyles({
10 | container: {
11 | paddingBottom: "8%",
12 | },
13 | logo: {
14 | maxWidth: "4em",
15 | },
16 | header: {
17 | marginTop: "3%",
18 | padding: "0 5%",
19 | },
20 | });
21 |
22 | function Search() {
23 | const classes = useStyles();
24 |
25 | return (
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | {" "}
37 |
38 |
39 |
40 |
41 |
42 |
43 |
50 |
51 | Search bar
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | );
63 | }
64 | export default Search;
65 |
--------------------------------------------------------------------------------
/src/Components/QuickList.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import clsx from "clsx";
3 | import { makeStyles } from "@material-ui/core/styles";
4 | import { Drawer, Fab, Button } from "@material-ui/core";
5 | import ListIcon from "@material-ui/icons/List";
6 | import TableResults from "./Table";
7 | import { Link } from "react-router-dom";
8 |
9 | const useStyles = makeStyles((theme) => ({
10 | list: {
11 | width: 250,
12 | },
13 | fullList: {
14 | width: "auto",
15 | },
16 | absolute: {
17 | position: "fixed",
18 | bottom: theme.spacing(3),
19 | right: theme.spacing(4),
20 | zIndex: "10",
21 | },
22 | }));
23 |
24 | export default function TemporaryDrawer() {
25 | const classes = useStyles();
26 | const [state, setState] = React.useState({
27 | bottom: false,
28 | });
29 |
30 | const toggleDrawer = (anchor, open) => (event) => {
31 | if (
32 | event.type === "keydown" &&
33 | (event.key === "Tab" || event.key === "Shift")
34 | ) {
35 | return;
36 | }
37 |
38 | setState({ ...state, [anchor]: open });
39 | };
40 |
41 | const list = (anchor) => (
42 |
50 |
Go to list
51 |
52 |
53 | );
54 | const anchor = "bottom";
55 | return (
56 |
57 |
58 |
59 |
62 |
63 |
69 | {list(anchor)}
70 |
71 |
72 |
73 | );
74 | }
75 |
--------------------------------------------------------------------------------
/src/Components/Home.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Grid, Button, Typography, Box } from "@material-ui/core";
3 | import { makeStyles } from "@material-ui/core/styles";
4 | import { Link } from "react-router-dom";
5 |
6 | const useStyles = makeStyles({
7 | header: {
8 | justifyContent: "flex-end",
9 | marginTop: "3%",
10 | paddingRight: "5%",
11 | },
12 | headerText: {
13 | fontSize: "1.1rem",
14 | fontWeight: "bold",
15 | },
16 | body: {
17 | marginTop: "10%",
18 | },
19 | bodyCenter: {
20 | alignContent: "center",
21 | },
22 | bodyTextH1: {
23 | fontWeight: "bold",
24 | textAlign: "center",
25 | },
26 | bodyTextSb1: {
27 | fontWeight: "bold",
28 | textAlign: "center",
29 | },
30 | searchbarbtn: {
31 | width: "70%",
32 | },
33 | mobilediv: {
34 | textAlign: "-webkit-center",
35 | marginTop: "10%",
36 | },
37 | mobiletext: {
38 | marginBottom: "3%",
39 | },
40 | mobiletext1: {
41 | marginTop: "2%",
42 | fontWeight: "bold",
43 | },
44 | });
45 | function Home() {
46 | const classes = useStyles();
47 | return (
48 |
49 |
50 |
51 | Log in / sign up
52 |
53 |
54 |
55 |
62 |
67 | SCIENTIFIC SEARCH
68 |
69 |
74 | Reach all scientific articles in one plateforme & get insights about
75 | your searches.
76 |
77 |
78 |
79 |
82 |
83 |
84 |
85 |
86 |
87 | );
88 | }
89 | export default Home;
90 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2 |
3 | ## Available Scripts
4 |
5 | In the project directory, you can run:
6 |
7 | ### `npm start`
8 |
9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11 |
12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console.
14 |
15 | ### `npm test`
16 |
17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19 |
20 | ### `npm run build`
21 |
22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance.
24 |
25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed!
27 |
28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29 |
30 | ### `npm run eject`
31 |
32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33 |
34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35 |
36 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37 |
38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39 |
40 | ## Learn More
41 |
42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43 |
44 | To learn React, check out the [React documentation](https://reactjs.org/).
45 |
46 | ### Code Splitting
47 |
48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49 |
50 | ### Analyzing the Bundle Size
51 |
52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53 |
54 | ### Making a Progressive Web App
55 |
56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57 |
58 | ### Advanced Configuration
59 |
60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61 |
62 | ### Deployment
63 |
64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65 |
66 | ### `npm run build` fails to minify
67 |
68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
69 |
--------------------------------------------------------------------------------
/src/Components/Login.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {
3 | Paper,
4 | Box,
5 | Button,
6 | Typography,
7 | TextField,
8 | FormControl,
9 | InputLabel,
10 | Input,
11 | InputAdornment,
12 | IconButton,
13 | Link,
14 | } from "@material-ui/core";
15 | import { makeStyles } from "@material-ui/core/styles";
16 | import Visibility from "@material-ui/icons/Visibility";
17 | import VisibilityOff from "@material-ui/icons/VisibilityOff";
18 |
19 | const useStyles = makeStyles({
20 | loginSigninPaper: {
21 | display: "table",
22 | margin: "auto",
23 | marginTop: "10%",
24 | padding: "2% 5% 2% 5%",
25 | },
26 | loginSigninHeader: {
27 | textAlign: "center",
28 | fontWeight: "bold",
29 | paddingBottom: "10%",
30 | },
31 | loginSigninbtn: {
32 | marginTop: "15%",
33 | width: "70%",
34 | },
35 | loginSigninfooter: {
36 | textAlign: "center",
37 | marginTop: "30%",
38 | },
39 | });
40 | function Login() {
41 | const classes = useStyles();
42 | const [values, setValues] = React.useState({
43 | amount: "",
44 | password: "",
45 | weight: "",
46 | weightRange: "",
47 | showPassword: false,
48 | });
49 | const handleChange = (prop) => (event) => {
50 | setValues({ ...values, [prop]: event.target.value });
51 | };
52 |
53 | const handleClickShowPassword = () => {
54 | setValues({ ...values, showPassword: !values.showPassword });
55 | };
56 |
57 | const handleMouseDownPassword = (event) => {
58 | event.preventDefault();
59 | };
60 | return (
61 |
62 |
67 | Welcome
68 |
69 |
70 |
71 |
72 |
73 |
74 | Password
75 |
82 |
87 | {values.showPassword ? : }
88 |
89 |
90 | }
91 | />
92 |
93 | Don’t remember your password?
94 |
95 |
102 |
103 |
104 | Don’t have an account yet?{" "}
105 | Join the community
106 |
107 |
108 | );
109 | }
110 | export default Login;
111 |
--------------------------------------------------------------------------------
/src/serviceWorker.js:
--------------------------------------------------------------------------------
1 | // This optional code is used to register a service worker.
2 | // register() is not called by default.
3 |
4 | // This lets the app load faster on subsequent visits in production, and gives
5 | // it offline capabilities. However, it also means that developers (and users)
6 | // will only see deployed updates on subsequent visits to a page, after all the
7 | // existing tabs open on the page have been closed, since previously cached
8 | // resources are updated in the background.
9 |
10 | // To learn more about the benefits of this model and instructions on how to
11 | // opt-in, read https://bit.ly/CRA-PWA
12 |
13 | const isLocalhost = Boolean(
14 | window.location.hostname === 'localhost' ||
15 | // [::1] is the IPv6 localhost address.
16 | window.location.hostname === '[::1]' ||
17 | // 127.0.0.0/8 are considered localhost for IPv4.
18 | window.location.hostname.match(
19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
20 | )
21 | );
22 |
23 | export function register(config) {
24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
25 | // The URL constructor is available in all browsers that support SW.
26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
27 | if (publicUrl.origin !== window.location.origin) {
28 | // Our service worker won't work if PUBLIC_URL is on a different origin
29 | // from what our page is served on. This might happen if a CDN is used to
30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374
31 | return;
32 | }
33 |
34 | window.addEventListener('load', () => {
35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
36 |
37 | if (isLocalhost) {
38 | // This is running on localhost. Let's check if a service worker still exists or not.
39 | checkValidServiceWorker(swUrl, config);
40 |
41 | // Add some additional logging to localhost, pointing developers to the
42 | // service worker/PWA documentation.
43 | navigator.serviceWorker.ready.then(() => {
44 | console.log(
45 | 'This web app is being served cache-first by a service ' +
46 | 'worker. To learn more, visit https://bit.ly/CRA-PWA'
47 | );
48 | });
49 | } else {
50 | // Is not localhost. Just register service worker
51 | registerValidSW(swUrl, config);
52 | }
53 | });
54 | }
55 | }
56 |
57 | function registerValidSW(swUrl, config) {
58 | navigator.serviceWorker
59 | .register(swUrl)
60 | .then(registration => {
61 | registration.onupdatefound = () => {
62 | const installingWorker = registration.installing;
63 | if (installingWorker == null) {
64 | return;
65 | }
66 | installingWorker.onstatechange = () => {
67 | if (installingWorker.state === 'installed') {
68 | if (navigator.serviceWorker.controller) {
69 | // At this point, the updated precached content has been fetched,
70 | // but the previous service worker will still serve the older
71 | // content until all client tabs are closed.
72 | console.log(
73 | 'New content is available and will be used when all ' +
74 | 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
75 | );
76 |
77 | // Execute callback
78 | if (config && config.onUpdate) {
79 | config.onUpdate(registration);
80 | }
81 | } else {
82 | // At this point, everything has been precached.
83 | // It's the perfect time to display a
84 | // "Content is cached for offline use." message.
85 | console.log('Content is cached for offline use.');
86 |
87 | // Execute callback
88 | if (config && config.onSuccess) {
89 | config.onSuccess(registration);
90 | }
91 | }
92 | }
93 | };
94 | };
95 | })
96 | .catch(error => {
97 | console.error('Error during service worker registration:', error);
98 | });
99 | }
100 |
101 | function checkValidServiceWorker(swUrl, config) {
102 | // Check if the service worker can be found. If it can't reload the page.
103 | fetch(swUrl, {
104 | headers: { 'Service-Worker': 'script' },
105 | })
106 | .then(response => {
107 | // Ensure service worker exists, and that we really are getting a JS file.
108 | const contentType = response.headers.get('content-type');
109 | if (
110 | response.status === 404 ||
111 | (contentType != null && contentType.indexOf('javascript') === -1)
112 | ) {
113 | // No service worker found. Probably a different app. Reload the page.
114 | navigator.serviceWorker.ready.then(registration => {
115 | registration.unregister().then(() => {
116 | window.location.reload();
117 | });
118 | });
119 | } else {
120 | // Service worker found. Proceed as normal.
121 | registerValidSW(swUrl, config);
122 | }
123 | })
124 | .catch(() => {
125 | console.log(
126 | 'No internet connection found. App is running in offline mode.'
127 | );
128 | });
129 | }
130 |
131 | export function unregister() {
132 | if ('serviceWorker' in navigator) {
133 | navigator.serviceWorker.ready
134 | .then(registration => {
135 | registration.unregister();
136 | })
137 | .catch(error => {
138 | console.error(error.message);
139 | });
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/src/Components/Table.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { makeStyles } from "@material-ui/core/styles";
3 | import {
4 | Typography,
5 | Grid,
6 | Paper,
7 | Table,
8 | TableBody,
9 | TableCell,
10 | TableContainer,
11 | TableHead,
12 | TablePagination,
13 | TableRow,
14 | } from "@material-ui/core";
15 |
16 | const columns = [
17 | { id: "title", label: "Title", minWidth: 170 },
18 | { id: "author", label: "Author", minWidth: 100 },
19 | {
20 | id: "date",
21 | label: "Date",
22 | minWidth: 170,
23 | format: (value) => value.toLocaleString(),
24 | },
25 | {
26 | id: "keywords",
27 | label: "Keywords",
28 | minWidth: 170,
29 | format: (value) => value.toLocaleString(),
30 | },
31 | ];
32 |
33 | function createData(title, author, date, keywords) {
34 | return { title, author, date, keywords };
35 | }
36 |
37 | const rows = [
38 | createData(
39 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
40 | "Rachida F. Parks",
41 | "November 2017",
42 | "Business, analytics, Success factors, Grounded Theory"
43 | ),
44 | createData(
45 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
46 | "Rachida F. Parks",
47 | "November 2017",
48 | "Business, analytics, Success factors, Grounded Theory"
49 | ),
50 | createData(
51 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
52 | "Rachida F. Parks",
53 | "November 2017",
54 | "Business, analytics, Success factors, Grounded Theory"
55 | ),
56 | createData(
57 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
58 | "Rachida F. Parks",
59 | "November 2017",
60 | "Business, analytics, Success factors, Grounded Theory"
61 | ),
62 | createData(
63 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
64 | "Rachida F. Parks",
65 | "November 2017",
66 | "Business, analytics, Success factors, Grounded Theory"
67 | ),
68 | createData(
69 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
70 | "Rachida F. Parks",
71 | "November 2017",
72 | "Business, analytics, Success factors, Grounded Theory"
73 | ),
74 | createData(
75 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
76 | "Rachida F. Parks",
77 | "November 2017",
78 | "Business, analytics, Success factors, Grounded Theory"
79 | ),
80 | createData(
81 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
82 | "Rachida F. Parks",
83 | "November 2017",
84 | "Business, analytics, Success factors, Grounded Theory"
85 | ),
86 | createData(
87 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
88 | "Rachida F. Parks",
89 | "November 2017",
90 | "Business, analytics, Success factors, Grounded Theory"
91 | ),
92 | createData(
93 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
94 | "Rachida F. Parks",
95 | "November 2017",
96 | "Business, analytics, Success factors, Grounded Theory"
97 | ),
98 | createData(
99 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
100 | "Rachida F. Parks",
101 | "November 2017",
102 | "Business, analytics, Success factors, Grounded Theory"
103 | ),
104 | createData(
105 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
106 | "Rachida F. Parks",
107 | "November 2017",
108 | "Business, analytics, Success factors, Grounded Theory"
109 | ),
110 | createData(
111 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
112 | "Rachida F. Parks",
113 | "November 2017",
114 | "Business, analytics, Success factors, Grounded Theory"
115 | ),
116 | createData(
117 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
118 | "Rachida F. Parks",
119 | "November 2017",
120 | "Business, analytics, Success factors, Grounded Theory"
121 | ),
122 | createData(
123 | "Understanding Business Analytics Success and Impact: A Qualitative Study",
124 | "Rachida F. Parks",
125 | "November 2017",
126 | "Business, analytics, Success factors, Grounded Theory"
127 | ),
128 | ];
129 |
130 | const useStyles = makeStyles({
131 | root: {
132 | width: "100%",
133 | },
134 | container: {
135 | maxHeight: 440,
136 | },
137 | block: {
138 | marginTop: "5%",
139 | padding: "0 5%",
140 | },
141 | title: {
142 | marginLeft: "1%",
143 | paddingBottom: "1%",
144 | fontWeight: "bold",
145 | },
146 | head: {
147 | backgroundColor: "primary",
148 | },
149 | body: {
150 | fontSize: "1.1em ",
151 | maxWidth: "300px",
152 | },
153 | });
154 |
155 | export default function TableResults() {
156 | const classes = useStyles();
157 | const [page, setPage] = React.useState(0);
158 | const [rowsPerPage, setRowsPerPage] = React.useState(10);
159 |
160 | const handleChangePage = (event, newPage) => {
161 | setPage(newPage);
162 | };
163 |
164 | const handleChangeRowsPerPage = (event) => {
165 | setRowsPerPage(+event.target.value);
166 | setPage(0);
167 | };
168 |
169 | return (
170 |
171 |
172 | Results from Scopus
173 |
174 |
175 |
176 |
177 |
178 |
179 | {columns.map((column) => (
180 |
185 | {column.label}
186 |
187 | ))}
188 |
189 |
190 |
191 | {rows
192 | .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
193 | .map((row) => {
194 | return (
195 |
201 | {columns.map((column) => {
202 | const value = row[column.id];
203 | return (
204 |
209 | {column.format && typeof value === "number"
210 | ? column.format(value)
211 | : value}
212 |
213 | );
214 | })}
215 |
216 | );
217 | })}
218 |
219 |
220 |
221 |
230 |
231 |
232 | );
233 | }
234 |
--------------------------------------------------------------------------------