PR review cleanups

parent 30ade578
Pipeline #104178 passed with stages
in 5 minutes
......@@ -61,9 +61,9 @@ const ProteinsListItemInfo = (props: Props) => {
transcriptWithProteinDomains,
setTranscriptWithProteinDomains
] = useState<Transcript | null>(null);
const [proteinSummary, setProteinSummary] = useState<ProteinSummary | null>(
null
);
const [proteinSummary, setProteinSummary] = useState<
ProteinSummary | null | undefined
>();
const proteinId =
transcript.product_generating_contexts[0].product.unversioned_stable_id;
......@@ -80,14 +80,15 @@ const ProteinsListItemInfo = (props: Props) => {
}
);
fetchProteinSummary(
transcript.unversioned_stable_id,
abortController.signal
).then((proteinSummaryData) => {
if (!abortController.signal.aborted) {
proteinSummaryData && setProteinSummary(proteinSummaryData);
fetchProteinSummary(proteinId, abortController.signal).then(
(proteinSummaryData) => {
if (!abortController.signal.aborted) {
proteinSummaryData
? setProteinSummary(proteinSummaryData)
: setProteinSummary(null);
}
}
});
);
return function cleanup() {
abortController.abort();
......@@ -152,7 +153,7 @@ const ProteinsListItemInfo = (props: Props) => {
</>
)}
{(!product || !proteinSummary) && (
{(!product || proteinSummary === undefined) && (
<div className={styles.statsLoadingContainer}>
<CircleLoader />
</div>
......
@import 'src/styles/settings';
.proteinListItem{
scroll-margin-top: 55px
.scrollRef{
scroll-margin-top: 90px;
}
......@@ -21,10 +21,3 @@
.transcriptId {
font-weight: 400;
}
.scrollRef{
position: absolute;
top: -55px;
}
......@@ -90,7 +90,8 @@ const ProteinsListItem = (props: Props) => {
};
return (
<div className={styles.proteinListItem} ref={itemRef}>
<div className={styles.proteinListItem}>
<span className={styles.scrollRef} ref={itemRef}></span>
<div className={transcriptsListStyles.row}>
<div className={transcriptsListStyles.left}></div>
<div onClick={toggleListItemInfo} className={midStyles}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment