Skip to content

Commit 7e886e0

Browse files
authored
Merge pull request #23 from Seol-JY/feat/medal-design
[FEAT] 3등 이내 UI 변경
2 parents 78bf068 + b399f3f commit 7e886e0

File tree

6 files changed

+43
-10
lines changed

6 files changed

+43
-10
lines changed

client/public/img/bronze-medal.png

27.1 KB
Loading

client/public/img/gold-medal.png

26.1 KB
Loading

client/public/img/silver-medal.png

26.7 KB
Loading

client/src/App.css

+4
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,10 @@ ul {
634634
transition: all 0.3s;
635635
}
636636

637+
.sidebarsection-rank-items-high {
638+
height: 60px;
639+
}
640+
637641
.sidebarsection-rank p {
638642
margin: 0;
639643
padding: 0;

client/src/components/Editor.jsx

+6-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ export default function Editor({
2121

2222
useEffect(() => {
2323
setTextSplit(getFilecontents(file).content);
24+
if (fileForCompare !== file) {
25+
// 파일 변경 시 내용 초기화
26+
setFileForCompare(file);
27+
setUserInput("");
28+
}
29+
// eslint-disable-next-line
2430
}, [file]);
2531

2632
useEffect(() => {
@@ -92,15 +98,6 @@ export default function Editor({
9298
setUserInput(event.currentTarget.value); // replace(/[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/g,'')
9399
};
94100

95-
useEffect(() => {
96-
if (fileForCompare !== file) {
97-
// 파일 변경 시 내용 초기화
98-
setFileForCompare(file);
99-
setUserInput("");
100-
}
101-
// eslint-disable-next-line
102-
}, [file]);
103-
104101
useEffect(() => {
105102
if (sectionForCompare !== section) {
106103
// Section 변경 시 내용 초기화

client/src/components/LeaderBoardContents.jsx

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
export default function LeaderBoard({ s }) {
2-
return (
2+
return s.rank >= 1 && s.rank <= 3 ? (
3+
<div className="sidebarsection-rank-items sidebarsection-rank-items-high">
4+
<ul>
5+
{s.rank === 1 && (
6+
<img
7+
style={{ objectFit: "cover", height: "40px" }}
8+
src="/img/gold-medal.png"
9+
alt="Gold Medal"
10+
/>
11+
)}
12+
{s.rank === 2 && (
13+
<img
14+
style={{ objectFit: "cover", height: "40px" }}
15+
src="/img/silver-medal.png"
16+
alt="Silver Medal"
17+
/>
18+
)}
19+
{s.rank === 3 && (
20+
<img
21+
style={{ objectFit: "cover", height: "40px" }}
22+
src="/img/bronze-medal.png"
23+
alt="Bronze Medal"
24+
/>
25+
)}
26+
<p>CPM:{s.cpm}</p>
27+
</ul>
28+
<ul>
29+
<p>{s.name}</p>
30+
<p>{s.message}</p>
31+
<p>{s.file}</p>
32+
</ul>
33+
</div>
34+
) : (
335
<div className="sidebarsection-rank-items">
436
<ul>
537
<p>

0 commit comments

Comments
 (0)