master
parent
517e099e63
commit
ac00013412
5 changed files with 63 additions and 2 deletions
@ -0,0 +1,21 @@ |
||||
import React from "react"; |
||||
|
||||
const CurrentDateShamsi = ({ color, fontSize }) => { |
||||
const date = new Date(); |
||||
const option = { |
||||
weekday: "long", |
||||
year: "numeric", |
||||
month: "long", |
||||
day: "numeric", |
||||
}; |
||||
const todayDate = date.toLocaleDateString("fa-IR", option); |
||||
|
||||
return <p className={`${color} ${fontSize}`}>{todayDate}</p>; |
||||
}; |
||||
|
||||
export default CurrentDateShamsi; |
||||
|
||||
CurrentDateShamsi.defaultProps = { |
||||
color: "text-red-600", |
||||
fontSize: "text-lg", |
||||
}; |
@ -0,0 +1,18 @@ |
||||
import React from "react"; |
||||
|
||||
const CurrentTime = ({ color, fontSize }) => { |
||||
const today = new Date(), |
||||
time = |
||||
today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); |
||||
{ |
||||
console.log(time); |
||||
} |
||||
return <p className={`${color} ${fontSize}`}>{time}</p>; |
||||
}; |
||||
|
||||
export default CurrentTime; |
||||
|
||||
CurrentTime.defaultProps = { |
||||
color: "text-red-600", |
||||
fontSize: "text-lg", |
||||
}; |
@ -1,7 +1,24 @@ |
||||
import React from "react"; |
||||
import CurrentDateShamsi from "../CurrentDateShamsi"; |
||||
import CurrentTime from "../CurrentTime"; |
||||
import ProfileInfo from "../ProfileInfo"; |
||||
|
||||
const UserProfileInfo = () => { |
||||
return <div className="">UserProfil55eInfo</div>; |
||||
return ( |
||||
<div className="max-w-[380px] flex flex-row-reverse items-center justify-between divide-x bg-blue-200"> |
||||
{/* ? date && time */} |
||||
<div className=""> |
||||
{/* ? time */} |
||||
<div className="flex flex-row items-center mb-2"> |
||||
<span className="text-xs ml-2 text-[#0F0543] ">ساعت</span> |
||||
<CurrentTime color={"text-[#2A527A]"} fontSize={"text-xs"} /> |
||||
</div> |
||||
{/* ? date */} |
||||
<CurrentDateShamsi color={"text-[#2A527A]"} fontSize={"text-xs"} /> |
||||
</div> |
||||
<ProfileInfo /> |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
export default UserProfileInfo; |
||||
|
Loading…
Reference in new issue