Skip to content

Commit

Permalink
style: lint and prettify code
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Nov 17, 2023
1 parent a230f7c commit 5a8e7f0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/components/PageHeading.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const margins = (iconSize) => {
} else {
return MEDIUM;
}
}
};

export const PageHeading = (props) => {
const { id, title, description, imgSrc, color, iconSize, descriptionStyle } = props;
Expand Down Expand Up @@ -75,6 +75,6 @@ export const PageHeading = (props) => {
</div>
</div>
);
}
};

export default PageHeading;
30 changes: 15 additions & 15 deletions src/components/PaginationBar.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import { useRef, useEffect } from 'react';
import { toNumber } from 'lodash';
import {Styles, Theme} from '../libs/theme';
import { Styles, Theme } from '../libs/theme';

//NOTE: This is a new pagination made to fit with the updated table look
//Component does not use third-party libraries for pagination, whereas the old version relies on 'react-pagination'
//Style works with Current Dar Table, but allows for modification with styles passed as a prop (though I expect to do some more fine-tuning with future implementations)
export default function PaginationBar(props) {
const {pageCount, goToPage, changeTableSize} = props;
const { pageCount, goToPage, changeTableSize } = props;
const currentPage = useRef(props.currentPage);
const tableSize = useRef(props.tableSize);
const applyTextHover = (e) => {
Expand All @@ -30,35 +30,35 @@ export default function PaginationBar(props) {
<div style={Styles.TABLE.PAGINATION_BUTTON_SECTION}>
<div style={Styles.TABLE.PAGINATION_BUTTON}>
<span onClick={() => goToPage(toNumber(currentPage.current.value) - 1)}
onMouseEnter={applyTextHover}
onMouseLeave={(e) => removeTextHover(e, Theme.palette.primary)}>
onMouseEnter={applyTextHover}
onMouseLeave={(e) => removeTextHover(e, Theme.palette.primary)}>
Prev
</span>
</div>
<div style={Styles.TABLE.PAGINATION_CURRENT_PAGE}>
<span>Page </span>
<input onChange={() => goToPage(toNumber(currentPage.current.value))}
type="text"
ref={currentPage}
defaultValue={props.currentPage}
style={Styles.TABLE.PAGINATION_INPUT} />
type="text"
ref={currentPage}
defaultValue={props.currentPage}
style={Styles.TABLE.PAGINATION_INPUT} />
<span> of {pageCount}</span>
</div>
<div style={Styles.TABLE.PAGINATION_BUTTON}>
<span onClick={() => goToPage(toNumber(currentPage.current.value) + 1)}
onMouseEnter={applyTextHover}
onMouseLeave={(e) => removeTextHover(e, '#1f3b50')}>
onMouseEnter={applyTextHover}
onMouseLeave={(e) => removeTextHover(e, '#1f3b50')}>
Next
</span>
</div>
</div>
<div style={Styles.TABLE.PAGINATION_TABLE_SIZE_SECTION}>
<span style={{marginRight: '2%'}}>Rows per page: </span>
<span style={{ marginRight: '2%' }}>Rows per page: </span>
<input onChange={() => changeTableSize(tableSize.current.value)}
type="text"
ref={tableSize}
defaultValue={props.tableSize}
style={Styles.TABLE.PAGINATION_INPUT} />
type="text"
ref={tableSize}
defaultValue={props.tableSize}
style={Styles.TABLE.PAGINATION_INPUT} />
</div>
</div>
);
Expand Down
12 changes: 6 additions & 6 deletions src/components/ReadMore.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ReadMore = ({

const getUnderLimit = () => {
return !content || content.length <= charLimit;
}
};

const getInlineContent = () => {
const content = expanded
Expand All @@ -35,23 +35,23 @@ export const ReadMore = ({
{content}
</span>
);
}
};

const getFormattedContent = () => {
return expanded ? [...content, ...moreContent] : content;
}
};

const getContent = () => {
return inline ? getInlineContent() : getFormattedContent();
}
};

const readMore = () => {
setExpanded(true);
}
};

const readLess = () => {
setExpanded(false);
}
};

const getReadLink = (fun, text, classes) => {
const { linkElements, linkElementsStyle } = inline
Expand Down
4 changes: 2 additions & 2 deletions src/components/SignIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const SignIn = (props) => {
/>
}
<ReactTooltip id="tip_google-help" place="top" effect="solid" multiline={true} className="tooltip-wrapper" />
</div>
</div>;
};

return (
Expand All @@ -188,6 +188,6 @@ export const SignIn = (props) => {
}
</div>
);
}
};

export default SignIn;

0 comments on commit 5a8e7f0

Please sign in to comment.