Skip to content

Commit ea130e8

Browse files
authored
Merge pull request #1335 from thunderstore-io/02-21-fix_horizontal_overflow_with_stalenessindicator
Fix horizontal overflow with StalenessIndicator
2 parents 57e0fb4 + c367cce commit ea130e8

File tree

5 files changed

+69
-70
lines changed

5 files changed

+69
-70
lines changed

apps/cyberstorm-remix/app/commonComponents/PackageSearch/PackageSearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
useNavigationType,
2323
useSearchParams,
2424
} from "@remix-run/react";
25-
import { StalenessIndicator } from "@thunderstore/cyberstorm/src/components/StalenessIndicator/StalenessIndicator";
2625
import { PackageCount } from "./components/PackageCount/PackageCount";
2726
import {
2827
isPackageOrderOptions,
@@ -34,6 +33,7 @@ import { RadioGroup } from "../RadioGroup/RadioGroup";
3433
import { CategoryTagCloud } from "./components/CategoryTagCloud/CategoryTagCloud";
3534
import { CollapsibleMenu } from "../Collapsible/Collapsible";
3635
import { CheckboxList } from "../CheckboxList/CheckboxList";
36+
import { StalenessIndicator } from "../StalenessIndicator/StalenessIndicator";
3737

3838
const PER_PAGE = 20;
3939

@@ -417,7 +417,7 @@ export function PackageSearch(props: Props) {
417417
</div>
418418
<StalenessIndicator
419419
isStale={navigation.state === "loading" ? true : false}
420-
className="package-search__packages"
420+
rootClasses="package-search__packages"
421421
>
422422
{listings.results.length > 0 ? (
423423
<div className="package-search__grid">
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@layer nimbus-components {
2+
.staleness-indicator__wrapper {
3+
opacity: 0.5;
4+
}
5+
6+
.staleness-indicator {
7+
position: absolute;
8+
z-index: 3;
9+
display: flex;
10+
align-items: flex-start;
11+
padding: 5rem 0 10rem;
12+
13+
> svg {
14+
position: sticky;
15+
top: 40vh;
16+
width: 5rem;
17+
height: 5rem;
18+
animation: rotation 1s linear infinite;
19+
min-inline-size: auto;
20+
}
21+
}
22+
23+
@keyframes rotation {
24+
0% {
25+
transform: rotate(0deg);
26+
}
27+
28+
100% {
29+
transform: rotate(360deg);
30+
}
31+
}
32+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import "./StalenessIndicator.css";
2+
import { ReactNode } from "react";
3+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
4+
import { faSpinnerThird } from "@fortawesome/pro-solid-svg-icons";
5+
import { classnames } from "@thunderstore/cyberstorm/src/utils/utils";
6+
import { NewIcon } from "@thunderstore/cyberstorm";
7+
8+
interface Props {
9+
children: ReactNode;
10+
rootClasses?: string;
11+
isStale: boolean;
12+
}
13+
14+
export function StalenessIndicator(props: Props) {
15+
const { children, rootClasses, isStale = false } = props;
16+
return (
17+
<>
18+
<div
19+
className={classnames(
20+
isStale ? "staleness-indicator__wrapper" : null,
21+
rootClasses
22+
)}
23+
>
24+
{isStale ? (
25+
<NewIcon wrapperClasses="staleness-indicator">
26+
<FontAwesomeIcon icon={faSpinnerThird} />
27+
</NewIcon>
28+
) : undefined}
29+
{children}
30+
</div>
31+
</>
32+
);
33+
}
34+
35+
StalenessIndicator.displayName = "StalenessIndicator";

packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.module.css

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/cyberstorm/src/components/StalenessIndicator/StalenessIndicator.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)