Skip to content

Commit 276c2a2

Browse files
authored
Merge pull request #169 from FandomJingyu/feature/fix-chart-ui
Feature/fix chart UI
2 parents 543829e + 2d3c69a commit 276c2a2

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

src/pages/List/Chart/index.jsx

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,18 @@ const Chart = () => {
151151
<ChartIdol style={{ marginBottom: "20px" }}>
152152
<ChartIdolLeft
153153
onClick={() => {
154-
setActiveTab("female");
155-
if (window.matchMedia("(max-width: 425px)").matches) {
156-
setVisibleCount(5);
157-
} else if (
158-
window.matchMedia("(min-width: 426px) and (max-width: 768px)")
159-
.matches
160-
) {
161-
setVisibleCount(5);
162-
} else {
163-
setVisibleCount(10);
154+
if (!isFemale) {
155+
setActiveTab("female");
156+
if (window.matchMedia("(max-width: 425px)").matches) {
157+
setVisibleCount(5);
158+
} else if (
159+
window.matchMedia("(min-width: 426px) and (max-width: 768px)")
160+
.matches
161+
) {
162+
setVisibleCount(5);
163+
} else {
164+
setVisibleCount(10);
165+
}
164166
}
165167
}}
166168
style={{
@@ -173,18 +175,21 @@ const Chart = () => {
173175
>
174176
이달의 여자 아이돌
175177
</ChartIdolLeft>
178+
176179
<ChartIdolRight
177180
onClick={() => {
178-
setActiveTab("male");
179-
if (window.matchMedia("(max-width: 425px)").matches) {
180-
setVisibleCount(5);
181-
} else if (
182-
window.matchMedia("(min-width: 426px) and (max-width: 768px)")
183-
.matches
184-
) {
185-
setVisibleCount(5);
186-
} else {
187-
setVisibleCount(10);
181+
if (isFemale) {
182+
setActiveTab("male");
183+
if (window.matchMedia("(max-width: 425px)").matches) {
184+
setVisibleCount(5);
185+
} else if (
186+
window.matchMedia("(min-width: 426px) and (max-width: 768px)")
187+
.matches
188+
) {
189+
setVisibleCount(5);
190+
} else {
191+
setVisibleCount(10);
192+
}
188193
}
189194
}}
190195
style={{

0 commit comments

Comments
 (0)