-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
056f990
commit e61251d
Showing
9 changed files
with
114 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,45 @@ | ||
import Header from './component/Header'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const MyPage = () => { | ||
export default function MyPage() { | ||
return ( | ||
<div className="h-screen"> | ||
<Header text="마이페이지" setting /> | ||
<div className="m-5"> | ||
<div className="flex items-center"> | ||
<div className="w-[80px] bg-gray-300 h-[80px] overflow-hidden rounded-[100px]"> | ||
<img src="./" alt="" /> | ||
</div> | ||
<div className="pl-5 h-[80px] flex flex-col justify-between"> | ||
<div className="flex items-center "> | ||
<h3 className="text-xl">와유</h3> | ||
<Link to={`/profileChange`} className="w-6 h-6 rotate-180"> | ||
<img className="w-6 h-6" src="/assets/back.png" alt="" /> | ||
</Link> | ||
</div> | ||
<div className="flex items-center h-3"> | ||
<p className="text-xs">팔로워 999</p> | ||
<div className="w-[1px] h-3 bg-slate-300 mx-3"></div> | ||
<p className="text-xs">팔로잉 2999</p> | ||
</div> | ||
<div className="flex items-center"> | ||
<span className="text-sm py-[1px] px-2 m-1 rounded-xl border border-primary text-primary"> | ||
#맛집 | ||
</span> | ||
<span className="text-sm py-[1px] px-2 m-1 rounded-xl border border-primary text-primary"> | ||
#디자인 | ||
</span> | ||
<span className="text-sm py-[1px] px-2 m-1 rounded-xl border border-primary text-primary"> | ||
#과학 | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<p className="text-sm mt-3"> | ||
한줄소개입니다한줄소개입니다한줄소개입니다한줄소개입니다 | ||
</p> | ||
</div> | ||
. | ||
</div> | ||
); | ||
}; | ||
|
||
export default MyPage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React, { useState } from 'react'; | ||
import GStar from '../../assets/GStar.png'; | ||
import YStar from '../../assets/YStar.png'; | ||
import HalfStar from '../../assets/HalfStar.png'; | ||
|
||
type GradeProps = { | ||
grade?: number; | ||
className?: string; | ||
className2?: string; | ||
}; | ||
|
||
const Grade: React.FC<GradeProps> = ({ | ||
grade = 3.5, | ||
className, | ||
className2, | ||
}) => { | ||
const integerPart = Math.floor(grade); | ||
const restPart = grade % 1; | ||
|
||
const renderInteger = () => { | ||
const integerElements = []; | ||
for (let i = 0; i < integerPart; i++) { | ||
integerElements.push( | ||
<div className={`w-[6%] mr-1 ${className}`}> | ||
<img className="w-full object-cover" src={YStar} alt="" /> | ||
</div>, | ||
); | ||
} | ||
return integerElements; | ||
}; | ||
|
||
const renderRest = () => { | ||
const restElements = []; | ||
if (restPart >= 0.5) { | ||
restElements.push( | ||
<div className={`w-[6%] mr-1 ${className}`}> | ||
<img className="w-full object-cover" src={HalfStar} alt="" /> | ||
</div>, | ||
); | ||
} else { | ||
restElements.push( | ||
<div className={`w-[6%] mr-1 ${className}`}> | ||
<img className="w-full object-cover" src={GStar} alt="" /> | ||
</div>, | ||
); | ||
} | ||
for (let i = 0; i < 4 - integerPart; i++) { | ||
restElements.push( | ||
<div className={`w-[6%] mr-1 ${className}`}> | ||
<img className="w-full object-cover" src={GStar} alt="" /> | ||
</div>, | ||
); | ||
} | ||
return restElements; | ||
}; | ||
|
||
return ( | ||
<div className="flex items-center mb-[10px]"> | ||
{renderInteger()} | ||
{renderRest()} | ||
<p className={`pl-2 text-2xl font-bold leading-[100%] ${className2}`}> | ||
{grade} | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Grade; |