Skip to content

Commit 7c77f12

Browse files
Fix: Scrollablity issue for discord users page
1 parent 1dc3328 commit 7c77f12

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

users/discord/App.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,20 @@ export const App = () => {
5656
if (users.length)
5757
return createElement('main', {}, [
5858
TabsSection({ tabs, activeTab, handleTabNavigation }),
59-
UsersSection({
60-
users,
61-
showUser,
62-
handleUserSelected,
63-
}),
64-
UserDetailsSection({ user: users[showUser] ?? {} }),
59+
60+
// Scrollable users section
61+
createElement('div', { class: 'users_section' }, [
62+
UsersSection({
63+
users,
64+
showUser,
65+
handleUserSelected,
66+
}),
67+
]),
68+
69+
// Fixed user details section
70+
createElement('div', { class: 'user_details_section' }, [
71+
UserDetailsSection({ user: users[showUser] ?? {} }),
72+
]),
6573
]);
6674

6775
return createElement('main', {}, [

users/discord/components/UserDetailsSection.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export const UserDetailsSection = ({
77
return createElement(
88
'section',
99
{
10-
class: 'user_details_section',
1110
'data-testid': 'user-details-section',
1211
},
1312
[

users/discord/style.css

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ main {
1616
grid-template-areas:
1717
'tab tab '
1818
'aside details';
19-
}
20-
21-
.users_section {
22-
grid-area: aside;
23-
overflow: scroll;
24-
padding-inline: 1rem;
19+
height: 100%; /* Ensure full page height */
2520
}
2621

2722
.tabs_section {
@@ -43,6 +38,13 @@ main {
4338
border: 2px solid gray;
4439
}
4540

41+
.users_section {
42+
grid-area: aside;
43+
overflow-y: auto;
44+
padding-inline: 1rem;
45+
max-height: 20rem;
46+
}
47+
4648
.user_card {
4749
padding: 1rem;
4850
display: flex;
@@ -62,15 +64,16 @@ main {
6264
}
6365

6466
.user_details_section {
65-
grid-area: details;
6667
padding: 1rem;
67-
margin: 0 1rem;
6868
background-color: var(--light-gray);
69+
position: sticky;
70+
height: 100%; /* Fill available space */
6971
}
7072

7173
.user_details_field {
7274
padding: 0.5rem;
7375
}
76+
7477
.no_user_found {
7578
width: 100vw;
7679
text-align: center;

0 commit comments

Comments
 (0)