Skip to content

Commit 82a58e2

Browse files
Resolved conflicts
1 parent 27a3bdb commit 82a58e2

4 files changed

Lines changed: 25 additions & 103 deletions

File tree

src/components/HGNHelpSkillsDashboard/CommunityMembersPage.jsx

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,10 @@
11
import React, { useState, useMemo } from 'react';
2-
import RankedUserList from './RankedUserList'; // wherever your RankedUserList is
2+
import RankedUserList from './RankedUserList';
33

44
const availableSkills = ['React', 'Redux', 'HTML', 'CSS', 'MongoDB', 'Database', 'Agile'];
5-
const RANKED_USERS_ENDPOINT = 'http://localhost:4500/api/hgnform/ranked';
65

76
function CommunityMembersPage() {
87
const [selectedSkills, setSelectedSkills] = useState([]);
9-
const [searchTerm, setSearchTerm] = useState('');
10-
const [sortOrder, setSortOrder] = useState('asc');
11-
const [showFilters, setShowFilters] = useState(false);
12-
const [rankedUsers, setRankedUsers] = useState([]);
13-
const [loading, setLoading] = useState(true);
14-
const [error, setError] = useState(null);
15-
16-
useEffect(() => {
17-
const fetchRankedUsers = async () => {
18-
setLoading(true);
19-
try {
20-
const params = {
21-
skills: (selectedSkills.length ? selectedSkills : availableSkills).join(','),
22-
};
23-
const response = await axios.get(RANKED_USERS_ENDPOINT, { params });
24-
setRankedUsers(response.data);
25-
setError(null);
26-
} catch (err) {
27-
setError('Unable to load community members right now. Please try again later.');
28-
} finally {
29-
setLoading(false);
30-
}
31-
};
32-
33-
fetchRankedUsers();
34-
}, [selectedSkills]);
358

369
const handleCheckboxChange = skill => {
3710
setSelectedSkills(prev =>

src/components/HGNHelpSkillsDashboard/RankedUserList.jsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import PropTypes from 'prop-types';
1+
import { useEffect, useState } from 'react';
2+
import axios from 'axios';
23
import UserCard from './UserCard';
3-
import styles from './style/UserCard.module.css';
4+
import './style/UserCard.module.css';
45

56
function RankedUserList({ selectedSkills = [] }) {
67
const [rankedUsers, setRankedUsers] = useState([]);
@@ -57,15 +58,4 @@ function RankedUserList({ selectedSkills = [] }) {
5758
);
5859
}
5960

60-
RankedUserList.propTypes = {
61-
users: PropTypes.arrayOf(PropTypes.object).isRequired,
62-
loading: PropTypes.bool.isRequired,
63-
error: PropTypes.string,
64-
emptyMessage: PropTypes.string.isRequired,
65-
};
66-
67-
RankedUserList.defaultProps = {
68-
error: null,
69-
};
70-
7161
export default RankedUserList;

src/components/HGNHelpSkillsDashboard/UserCard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function UserCard({ user }) {
1616
};
1717

1818
return (
19-
<div className={`${styles.userCard} ${darkMode ? styles.darkMode : ''}`}>
19+
<div className={`${styles.userCard} ${darkMode ? styles.dark : ''}`}>
2020
<img src={avatar} alt="Avatar" className={`${styles.avatar}`} />
2121
<div className={`${styles.info}`}>
2222
<div className={`${styles.userName}`} title={name}>

src/components/HGNHelpSkillsDashboard/style/UserCard.module.css

Lines changed: 20 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
flex-direction: column;
1313
align-items: center;
1414
gap: 16px;
15-
margin: 0 auto;
1615
}
1716

1817
.avatar {
@@ -39,9 +38,8 @@
3938
}
4039

4140
.userName {
42-
width: 100%;
43-
font-size: 24px;
44-
font-weight: 500;
41+
font-size: 30px;
42+
font-weight: 400;
4543
color: black;
4644
margin-bottom: 8px;
4745
white-space: nowrap;
@@ -51,11 +49,10 @@
5149
}
5250

5351
.contactLine {
54-
width: 100%;
5552
display: flex;
5653
align-items: center;
5754
gap: 8px;
58-
font-size: 13px;
55+
font-size: 16px;
5956
color: #616161;
6057
margin-bottom: 6px;
6158
justify-content: center;
@@ -67,10 +64,6 @@
6764
margin-top: 1px;
6865
}
6966

70-
.contactLine span {
71-
word-break: break-all;
72-
}
73-
7467
.scoreSkillsWrapper {
7568
width: 100%;
7669
display: flex;
@@ -82,7 +75,7 @@
8275
.scoreLine {
8376
font-size: 22px;
8477
text-align: left;
85-
padding: 0 16px;
78+
margin-left: 4px;
8679
}
8780

8881
.scoreLabel {
@@ -102,75 +95,41 @@
10295
.skillsSection {
10396
width: 100%;
10497
text-align: left;
105-
padding: 0 16px 0 16px;
98+
padding: 0 4px;
10699
}
107100

108101
.skillsLabel {
109-
font-size: 18px;
102+
font-size: 20px;
110103
font-weight: 400;
111104
text-decoration: underline;
112105
margin-bottom: 4px;
113106
}
114107

115108
.skillsText {
116-
font-size: 15px;
109+
font-size: 16px;
117110
font-weight: 400;
118111
color: #616161;
119-
line-height: 21px;
112+
line-height: 22px;
120113
word-wrap: break-word;
121114
overflow-wrap: break-word;
122115
}
123116

124-
.userCard.darkMode {
117+
.userCard.dark {
125118
background: #2f4157;
126-
border-color: #444;
119+
border-color: #333;
127120
box-shadow: none;
121+
color: #ffffff;
128122
}
129123

130-
.userCard.darkMode .contactLine {
131-
color: #ccc;
132-
}
133-
134-
.darkMode .skillsText {
135-
color: #ffffff !important;
136-
}
137-
138-
.darkMode .userName {
139-
color: #ffffff !important;
140-
}
141-
142-
.darkMode .scoreLine,
143-
.darkMode .scoreLabel,
144-
.darkMode .scoreValue,
145-
.darkMode .scoreMax {
146-
color: #ffffff !important;
147-
}
148-
149-
.containerGrid {
150-
display: grid;
151-
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
152-
gap: 32px;
153-
padding: 24px 0 32px;
154-
justify-items: center;
155-
}
156-
157-
.darkMode {
158-
color: #111 !important;
159-
-webkit-text-fill-color: #111 !important;
160-
}
161-
162-
.darkMode .contactLine,
163-
.darkMode .skillsText {
164-
color: #616161 !important;
165-
}
166-
167-
.darkMode .userName {
168-
color: black !important;
124+
.userCard.dark .userName,
125+
.userCard.dark .scoreLine,
126+
.userCard.dark .scoreLabel,
127+
.userCard.dark .scoreValue,
128+
.userCard.dark .scoreMax {
129+
color: #ffffff;
169130
}
170131

171-
.darkMode .scoreLine,
172-
.darkMode .scoreLabel,
173-
.darkMode .scoreValue,
174-
.darkMode .scoreMax {
175-
color: #111 !important;
132+
.userCard.dark .contactLine,
133+
.userCard.dark .skillsText {
134+
color: #bbbbbb;
176135
}

0 commit comments

Comments
 (0)