Skip to content

Commit

Permalink
feat: Add photoUrl in UserProfile component #52
Browse files Browse the repository at this point in the history
  • Loading branch information
Han-Joon-Hyeok committed Nov 30, 2022
1 parent c10e1e0 commit ca17d01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/Pages/HomePage/UserProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ import Avatar from "@mui/material/Avatar";
import Typography from "@mui/material/Typography";

function UserProfile(props) {
const { intraId } = props;
const { intraId, photoUrl } = props;
return (
<>
<Avatar
sx={{ width: 100, height: 100, mb: 3 }}
src="https://i.ytimg.com/vi/AwrFPJk_BGU/maxresdefault.jpg"
/>
<Avatar sx={{ width: 100, height: 100, mb: 3 }} src={photoUrl} />
<Typography variant="body1">{intraId}</Typography>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/HomePage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getTodayDate = () => {
};

const Home = () => {
const { _intraId } = useStore((state) => state);
const { _intraId, _photoUrl } = useStore((state) => state);
console.log(_intraId);
const [summary, setSummary] = useState({});
const [isOperator, setIsOperator] = useState(false);
Expand Down Expand Up @@ -54,7 +54,7 @@ const Home = () => {

return (
<>
<UserProfile intraId={_intraId} imageUrl />
<UserProfile intraId={_intraId} photoUrl={_photoUrl} />
<Typography variant="subtitle1" sx={{ mt: 1, fontWeight: "bold" }}>
{getTodayDate()}
</Typography>
Expand Down
3 changes: 2 additions & 1 deletion src/Pages/SignupPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import PasswordField from "./PasswordField.jsx";
function Signup() {
const navigate = useNavigate();
const { state } = useLocation();
const { _intraId, _server } = useStore((state) => state);
const { _intraId, setPhotoUrl } = useStore((state) => state);
// 비밀번호 규칙 확인용 State (boolean)
const [isSamePassword, setIsSamePassword] = useState(true);
// 사용자 입력 비밀번호 저장 State (string)
Expand Down Expand Up @@ -90,6 +90,7 @@ function Signup() {
});
console.log(response);
if (response.status === 201) {
setPhotoUrl(state.photoUrl);
// TODO 회원가입 정상적으로 진행되면 login 페이지에서 회원가입 완료 안내 문구 띄워주기
navigate("/");
}
Expand Down

0 comments on commit ca17d01

Please sign in to comment.