Skip to content

Commit d65de63

Browse files
committed
/communities second QA fixes
1 parent a14c9e2 commit d65de63

File tree

25 files changed

+615
-285
lines changed

25 files changed

+615
-285
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
/node_modules/
33
**/yarn-error.log
4+
.npmrc

apps/cyberstorm-remix/app/communities/SearchAndOrder.module.css

+5-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77

88
.searchTextInput {
99
display: flex;
10+
flex: 1;
1011
flex-direction: column;
1112
gap: var(--space--8);
12-
width: 50%;
13-
}
14-
15-
.searchInput {
16-
max-width: 26.25rem;
1713
}
1814

1915
.searchFilters {
@@ -43,8 +39,10 @@
4339
.searchFilters > span {
4440
display: none;
4541
}
42+
}
4643

47-
.searchInput {
48-
max-width: 100%;
44+
@media (width > 40rem) {
45+
.searchTextInput {
46+
max-width: 26.25rem;
4947
}
5048
}

apps/cyberstorm-remix/app/communities/communities.tsx

-30
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ export default function CommunitiesPage() {
145145
clearValue={() => setSearchValue("")}
146146
leftIcon={<FontAwesomeIcon icon={faSearch} />}
147147
csColor="cyber-green"
148-
rootClasses={searchAndOrderStyles.searchInput}
149148
id="communitiesSearchInput"
150149
/>
151150
</div>
@@ -171,38 +170,9 @@ export default function CommunitiesPage() {
171170
);
172171
}
173172

174-
function comparePackageCount(a: Community, b: Community) {
175-
if (a.total_package_count < b.total_package_count) {
176-
return 1;
177-
}
178-
if (a.total_package_count > b.total_package_count) {
179-
return -1;
180-
}
181-
return 0;
182-
}
183-
184173
function CommunitiesList(props: { communitiesData: Communities }) {
185174
const { communitiesData } = props;
186175

187-
const topDogs: Community[] = [];
188-
communitiesData.results.reduce((prevCommunity, currentCommunity) => {
189-
if (topDogs.length > 4) {
190-
topDogs.sort(comparePackageCount);
191-
const lastDog = topDogs.at(-1);
192-
if (
193-
(lastDog ? lastDog.total_package_count : 0) <
194-
currentCommunity.total_package_count
195-
) {
196-
topDogs.pop();
197-
topDogs.push(currentCommunity);
198-
}
199-
} else {
200-
topDogs.push(currentCommunity);
201-
}
202-
return topDogs;
203-
}, topDogs);
204-
const flatDogs = topDogs.map((community) => community.identifier);
205-
206176
if (communitiesData.results.length > 0) {
207177
return (
208178
<div className={communitiesListStyles.root}>

apps/cyberstorm-remix/cyberstorm/navigation/DesktopLoginPopover.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ import { classnames } from "@thunderstore/cyberstorm/src/utils/utils";
1414
import { buildAuthLoginUrl } from "cyberstorm/utils/ThunderstoreAuth";
1515
import { faDiscord, faGithub } from "@fortawesome/free-brands-svg-icons";
1616

17-
import styles from "./Navigation.module.css";
18-
import { Modal, NewButton, NewIcon } from "@thunderstore/cyberstorm";
19-
import { LoginList } from "./LoginList";
20-
import { faArrowRightToBracket } from "@fortawesome/free-solid-svg-icons";
21-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
22-
2317
export function DesktopLoginPopover() {
2418
return (
2519
<Modal

apps/cyberstorm-remix/cyberstorm/navigation/DevelopersDropDown.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function DevelopersDropDown() {
2424
</NewButton>
2525
}
2626
csVariant="default"
27-
csColor="surface-alpha"
27+
csColor="surface"
2828
rootClasses={styles.root}
2929
>
3030
<NewDropDownItem>

apps/cyberstorm-remix/cyberstorm/navigation/MobileUserPopoverContent.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import styles from "./Navigation.module.css";
55
import {
66
Avatar,
77
Menu,
8+
NewButton,
89
NewIcon,
910
NewLink,
1011
NewText,
@@ -36,17 +37,17 @@ export function MobileUserPopoverContent(props: { user: CurrentUser }) {
3637
</div>
3738
}
3839
controls={
39-
<button
40+
<NewButton
4041
{...{
4142
popovertarget: "mobileNavAccount",
4243
popovertargetaction: "close",
4344
}}
44-
className={styles.popoverCloseButton}
45-
>
46-
<NewIcon csMode="inline" csVariant="tertiary" noWrapper>
47-
<FontAwesomeIcon icon={faLongArrowLeft} />
48-
</NewIcon>
49-
</button>
45+
aria-label="Back"
46+
mode="iconButton"
47+
csSize="m"
48+
csVariant="tertiaryDimmed"
49+
icon={faLongArrowLeft}
50+
/>
5051
}
5152
>
5253
{user.username ? (

apps/cyberstorm-remix/cyberstorm/navigation/Navigation.module.css

+28-10
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@
6868

6969
.mobileNavMenuDevelopersButton {
7070
display: flex;
71-
gap: 1rem;
7271
align-items: center;
7372
align-self: stretch;
7473
justify-content: space-between;
75-
padding: 1rem;
7674
color: var(--color-primary);
7775
background: transparent;
7876
}
@@ -96,6 +94,14 @@ button.mobileNavItem {
9694
background: transparent;
9795
}
9896

97+
.mobileNavItem:active {
98+
color: var(--color-cyber-green--5);
99+
}
100+
101+
.mobileNavItem:hover {
102+
color: var(--color-secondary);
103+
}
104+
99105
.mobileNavItemIcon {
100106
height: 1.375rem;
101107
}
@@ -123,14 +129,6 @@ button.mobileNavItem {
123129
width: 100%;
124130
}
125131

126-
.mobileNavPopoverListLink {
127-
display: flex;
128-
gap: 1rem;
129-
align-items: center;
130-
align-self: stretch;
131-
padding: 1rem;
132-
}
133-
134132
.popoverCloseButton {
135133
width: 2.75rem;
136134
height: 2.875rem;
@@ -252,3 +250,23 @@ button.mobileNavItem {
252250
display: flex;
253251
gap: 1rem;
254252
}
253+
254+
.divider {
255+
align-self: stretch;
256+
height: 1px;
257+
margin: var(--space--16) var(--space--8);
258+
background: var(--color-surface--7);
259+
}
260+
261+
.navMenuItem {
262+
display: flex;
263+
gap: var(--gap--16);
264+
align-items: center;
265+
align-self: stretch;
266+
padding: var(--space--16);
267+
border-radius: var(--border-radius--8);
268+
}
269+
270+
.navMenuItem:hover {
271+
background: var(--color-surface--9);
272+
}

0 commit comments

Comments
 (0)