Skip to content

Commit

Permalink
refactor: Add UserProfile.jsx #52
Browse files Browse the repository at this point in the history
  • Loading branch information
Han-Joon-Hyeok committed Nov 30, 2022
1 parent 97cec98 commit c10e1e0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
17 changes: 17 additions & 0 deletions src/Pages/HomePage/UserProfile.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Avatar from "@mui/material/Avatar";
import Typography from "@mui/material/Typography";

function UserProfile(props) {
const { intraId } = props;
return (
<>
<Avatar
sx={{ width: 100, height: 100, mb: 3 }}
src="https://i.ytimg.com/vi/AwrFPJk_BGU/maxresdefault.jpg"
/>
<Typography variant="body1">{intraId}</Typography>
</>
);
}

export default UserProfile;
11 changes: 4 additions & 7 deletions src/Pages/HomePage/index.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, { useState, useEffect } from "react";
import React, { useState, useEffect, Profiler } from "react";
import axios from "axios";
import { Avatar, Typography } from "@mui/material";
import Typography from "@mui/material/Typography";
import AttendanceTable from "./AttendanceTable";
import AttendanceButton from "./AttendanceButton";
import TodayWordButton from "./TodayWordButton";
import TestButtons from "./TestButtons";
import useStore from "../../store.js";
import { format } from "date-fns";
import { ko } from "date-fns/locale";
import UserProfile from "./UserProfile";

// 오늘 날짜를 "yyyy년 MM월 dd일 e요일" 형식으로 변환
const getTodayDate = () => {
Expand Down Expand Up @@ -53,11 +54,7 @@ const Home = () => {

return (
<>
<Avatar
sx={{ width: 100, height: 100, mb: 3 }}
src="https://i.ytimg.com/vi/AwrFPJk_BGU/maxresdefault.jpg"
/>
<Typography variant="body1">{_intraId}</Typography>
<UserProfile intraId={_intraId} imageUrl />
<Typography variant="subtitle1" sx={{ mt: 1, fontWeight: "bold" }}>
{getTodayDate()}
</Typography>
Expand Down

0 comments on commit c10e1e0

Please sign in to comment.