Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
VREMSoftwareDevelopment committed Oct 14, 2024
1 parent 234e899 commit 903200c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
7 changes: 7 additions & 0 deletions react/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import React from 'react';
import PropTypes from 'prop-types';
import { HashRouter } from 'react-router-dom';
import { DateTime } from 'luxon';
import theme from './theme';
Expand Down Expand Up @@ -55,4 +56,10 @@ App.defaultProps = {
currentTime: DateTime.local().toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS),
};

App.propTypes = {
name: PropTypes.string,
version: PropTypes.string,
currentTime: PropTypes.string,
};

export default App;
4 changes: 2 additions & 2 deletions react/src/services/Usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import Data from './Data';

const process = (response) =>
response
.replace(/\r/g, '')
.replaceAll('\r', '')
.split('\n')
.map((line, index) => {
const elements = line.replace(/\n/g, '').split(',');
const elements = line.replaceAll('\n', '').split(',');
if (elements.length < 8) {
return null;
}
Expand Down
12 changes: 10 additions & 2 deletions react/src/utils/SortUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@
*/

export const comparator = (isAscending, orderBy) => {
const ascending = (a, b, orderBy) => (a[orderBy] < b[orderBy] ? -1 : a[orderBy] > b[orderBy] ? 1 : 0);
const descending = (a, b, orderBy) => (a[orderBy] > b[orderBy] ? -1 : a[orderBy] < b[orderBy] ? 1 : 0);
const ascending = (a, b, orderBy) => {
if (a[orderBy] < b[orderBy]) return -1;
if (a[orderBy] > b[orderBy]) return 1;
return 0;
};
const descending = (a, b, orderBy) => {
if (a[orderBy] > b[orderBy]) return -1;
if (a[orderBy] < b[orderBy]) return 1;
return 0;
};
return isAscending ? (a, b) => ascending(a, b, orderBy) : (a, b) => descending(a, b, orderBy);
};

Expand Down

0 comments on commit 903200c

Please sign in to comment.