Skip to content

Commit

Permalink
Remove svg code and Edit profile name length.
Browse files Browse the repository at this point in the history
Signed-off-by: June Saehwan <[email protected]>
Co-authored-by: Han Kyuhyun <[email protected]>
Co-authored-by: ByunJeongHeum <[email protected]>
Co-authored-by: Jongmin Lee <[email protected]>
  • Loading branch information
4 people committed Sep 12, 2023
1 parent 728a525 commit 811c534
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/css/Home_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
width: 71px;
}

.login .LPVS {
.home .LPVS {
height: 96px;
left: 0;
object-fit: cover;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/css/Login_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
}

.login .line {
background-color: #000000;
height: 1px;
left: 0;
object-fit: cover;
Expand Down
17 changes: 15 additions & 2 deletions frontend/src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ export const Home = () => {
});
}, []);

function truncateName(name) {
if (/[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/g.test(name)) {
return name.length > 3 ? `${name.substring(0, 3)}.` : name;
} else {
return name.length > 5 ? `${name.substring(0, 5)}.` : name;
}
}


return (
<div className="home">
<div className="div">
Expand Down Expand Up @@ -82,10 +91,14 @@ export const Home = () => {
{isLoggedIn ? (
<span style={{ color: "black", textDecoration: "none" }}>
<Link
to={"/home"}
to={"/user/info"}
style={{ color: "black", textDecoration: "none" }}
>
{username.name}
{username?.name ? (
<div>{truncateName(username.name)}</div>
) : (
<div>Loading...</div>
)}
</Link>
</span>
) : (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Login = () => {
<div className="overlap">
<div className="login-header">
<div className="overlap-group">
<img className="line" alt="Line" src="/image/svg/Line_2.svg" />
<div className="line" alt="Line" />
<div className="text-wrapper">SNS Login</div>
</div>
</div>
Expand Down

0 comments on commit 811c534

Please sign in to comment.