Skip to content

Commit

Permalink
feat: profile match history에서 상대 nick 클릭시 해당 user의 profile 창으로 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
seonjo1 committed Aug 26, 2024
1 parent 12bb599 commit 0ed162b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion frontend/src/components/Profile-Info.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export class ProfileInfo extends Component {
.then(data => {
this.state.games = data.games;
this.state.user = data.user;

this.state.rate = data.user.lose == 0 ? (data.user.win == 0 ? 0 : 100) :
Math.round((data.user.win / (data.user.lose + data.user.win)) * 100);
})
Expand Down Expand Up @@ -128,6 +127,10 @@ export class ProfileInfo extends Component {
window.history.back();
});

this.addEvent('click', '.opNick', (event) => {
changeUrl(`/main/profile/${event.target.id}`);
});

this.addEvent('click', '#profile-edit', () => {
changeUrl(`/main/profile/${this.props.uid}/edit`);
});
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/Profile-List.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export class MatchList extends Component {
${matches.map(element => {
// Date 객체로 변환
const date = new Date(element.start_timestamp);
// 월, 일, 시, 분 추출
const month = date.getMonth() + 1; // getMonth()는 0부터 시작하므로 1을 더해줍니다.
const day = date.getDate();
Expand All @@ -27,7 +26,7 @@ export class MatchList extends Component {
<span id="vs">VS</span>
</div>
<div id="opImg">
<span id="opNick">${element.op_user.nickname}</span>
<span class="opNick" id="${element.op_user.user_id}">${element.op_user.nickname}</span>
<img id="opImg" src=${element.op_user.img_url}></img>
</div>
<div id="matchScore">
Expand Down
8 changes: 7 additions & 1 deletion frontend/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -956,10 +956,16 @@ img#opImg {
height: 100%;
}

span#opNick{
span.opNick{
margin-right: 30px;
font-size: 20px;
font-weight: 700;
color: #31363F;
cursor: pointer;
}

span.opNick:hover {
color: #f10000; /* 마우스를 올렸을 때 변경될 글자 색 */
}

div#matchScore {
Expand Down

0 comments on commit 0ed162b

Please sign in to comment.