Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init #1

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"@material-ui/core": "^4.12.4",
"@reduxjs/toolkit": "^1.9.3",
"@sentry/react": "^7.62.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -20,10 +21,8 @@
"chartjs-plugin-zoom": "^2.0.1",
"date-fns": "^2.29.3",
"date-fns-tz": "^2.0.0",
"formik": "^2.2.9",
"leaflet": "^1.9.4",
"lodash": "^4.17.21",
"lt-codes": "ambrazasp/lt-codes",
"moment": "^2.29.4",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
Expand All @@ -34,12 +33,12 @@
"react-icons": "^4.8.0",
"react-leaflet": "^4.2.1",
"react-paginate": "^8.2.0",
"react-query": "^3.39.3",
"react-redux": "^8.0.5",
"react-resize-detector": "^8.0.4",
"react-router": "^6.10.0",
"react-router-dom": "^6.10.0",
"react-scripts": "5.0.1",
"react-signature-canvas": "^1.0.6",
"react-toastify": "^9.1.2",
"redux-persist": "^6.0.0",
"styled-components": "^5.3.9",
Expand Down Expand Up @@ -87,10 +86,10 @@
]
},
"devDependencies": {
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@types/lodash": "^4.14.192",
"@types/react-datepicker": "^4.10.0",
"@types/styled-components": "^5.1.26",
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Interaction.modes.interpolate = Interpolate;

moment.locale("lt");

function App() {
const App = () => {
useEffect(() => {
initGA();
logPageView();
Expand All @@ -39,6 +39,6 @@ function App() {
<ToastContainer />
</>
);
}
};

export default App;
2 changes: 1 addition & 1 deletion src/components/buttons/ButtonsGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ButtonsGroup = ({
<StyledButton
type="button"
disabled={disabled || option?.disabled}
key={`group-button${index}`}
key={`group-button-${index}`}
selected={isSelected(option)}
error={!!error}
onClick={() => (disabled ? {} : onChange(option))}
Expand Down
1 change: 0 additions & 1 deletion src/components/buttons/IconLink.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { eachYearOfInterval } from "date-fns/esm";
import styled from "styled-components";
import Icon from "../other/Icon";

Expand Down
34 changes: 34 additions & 0 deletions src/components/containers/EventsTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useEffect, useState } from "react";
import { useSearchParams } from "react-router-dom";
import { handlePagination, mapEvents } from "../../utils/functions";
import { eventLabels } from "../../utils/texts";
import Table, { TableData } from "../other/Table";

const EventTable = ({ events, hydroPowerPlant, loading }) => {
const [tableData, setTableData] = useState<TableData>({ data: [] });
const [searchParams] = useSearchParams();
const { page } = Object.fromEntries([...Array.from(searchParams)]);

useEffect(() => {
const pageData = handlePagination({
data: events,
page: page,
pageSize: 40
});
setTableData({
data: mapEvents({ ...hydroPowerPlant!, events: pageData.slicedData }),
totalPages: pageData.totalPages
});
}, [page, loading, events, hydroPowerPlant]);

return (
<Table
loading={loading}
tableDataInfo={tableData}
labels={eventLabels}
isFilterApplied={false}
/>
);
};

export default EventTable;
113 changes: 0 additions & 113 deletions src/components/fields/AsyncMultiSelect.tsx

This file was deleted.

137 changes: 0 additions & 137 deletions src/components/fields/AsyncSelect.tsx

This file was deleted.

Loading
Loading