Skip to content

Commit 5425084

Browse files
committed
[final] good bye css edit
1 parent c52077e commit 5425084

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

client/src/components/Portfolio/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect, useRef } from 'react';
1+
import React, { useState, useEffect } from 'react';
22
import { useSelector } from 'react-redux';
33
import * as S from './style';
44
import StyledLink from '../../basics/StyledLink';
@@ -20,7 +20,7 @@ const unfollow = (id:string) => {
2020
});
2121
};
2222
const Portfolio:React.FC<portfolioProp> = ({
23-
introSimple, introDetail, activeFields, isMyPortfolio, PortfolioOwnerId, PortfolioOwnerName, isLogin, LoginedId, portfolioFollower,
23+
thumbnailUrl, introSimple, introDetail, activeFields, isMyPortfolio, PortfolioOwnerId, PortfolioOwnerName, isLogin, LoginedId, portfolioFollower,
2424
}) => {
2525
const [showFollowers, setShowFollowers] = useState(false);
2626
const [showFollowings, setShowFollowings] = useState(false);
@@ -30,7 +30,6 @@ const Portfolio:React.FC<portfolioProp> = ({
3030
const showFollowersPopup = () => { setShowFollowers(true); };
3131
const closeFollowingsPopup = () => { setShowFollowings(false); };
3232
const showFollowingsPopup = () => { setShowFollowings(true); };
33-
const thumbnailUrl = useRef('');
3433

3534
const onClickFollow = () => {
3635
if (followable) {
@@ -67,7 +66,6 @@ const Portfolio:React.FC<portfolioProp> = ({
6766
} else {
6867
setFollowable(true);
6968
}
70-
thumbnailUrl.current = data.thumbnailUrl;
7169
}
7270
});
7371
}
@@ -89,7 +87,7 @@ const Portfolio:React.FC<portfolioProp> = ({
8987
</S.FollowLine>
9088

9189
</S.PortfolioDetail>
92-
<S.PortfolioImage src={thumbnailUrl.current} />
90+
<S.PortfolioImage src={thumbnailUrl} />
9391
</S.PortfolioBox>
9492
<S.IntroduceBox>
9593
{isLogin

client/src/components/Portfolio/style.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const PortfolioImage = styled(Img)`
3333
margin: 35px 38px 30px 0;
3434
background-size:cover;
3535
background-position: center center;
36+
border-radius: 100%;
3637
`;
3738
export const FollowLine = styled.div`
3839
font-size: 13px;

client/src/components/Portfolio/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
export interface portfolioProp{
3+
thumbnailUrl: string;
34
introSimple: string;
45
introDetail: string;
56
activeFields: string[];

client/src/containers/CreatorContainer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from 'react';
1+
import React, { useState, useEffect, useRef } from 'react';
22
import { Redirect } from 'react-router-dom';
33
import { withRouter, RouteComponentProps } from 'react-router';
44
import styled from 'styled-components';
@@ -39,6 +39,7 @@ interface matchParams {
3939
const CreatorContainer: React.SFC<RouteComponentProps<matchParams>> = ({ match }) => {
4040
const [portfolio, setPortfolio] = useState({ ...initialPortfolio });
4141
const { isLogin, id: LoginedId } = useSelector((root:RootState) => root.login);
42+
const thumbnailUrl = useRef('');
4243

4344
const isMyPortfolio = (!match.params.Id);
4445
const Id = match.params.Id || '';
@@ -57,6 +58,7 @@ const CreatorContainer: React.SFC<RouteComponentProps<matchParams>> = ({ match }
5758
};
5859
getData().then((data:any) => {
5960
if (data) {
61+
thumbnailUrl.current = data.thumbnailUrl;
6062
const followerObject = {
6163
following: [...data.profile.following],
6264
follower: [...data.profile.follower],
@@ -77,6 +79,7 @@ const CreatorContainer: React.SFC<RouteComponentProps<matchParams>> = ({ match }
7779
<S.CreatorContainer>
7880
<S.PortfolioContainer>
7981
<Portfolio
82+
thumbnailUrl={thumbnailUrl.current}
8083
isMyPortfolio={isMyPortfolio}
8184
introDetail={portfolio.introDetail}
8285
introSimple={portfolio.introSimple}

0 commit comments

Comments
 (0)