From e5ccbe62005250eaf633d620d034b84657576325 Mon Sep 17 00:00:00 2001 From: useonglee Date: Fri, 28 May 2021 22:07:18 +0900 Subject: [PATCH 1/4] Add image radius to profile image component --- src/components/Common/ProfileImage/index.tsx | 6 +++++ src/components/Common/ProfileImage/styles.ts | 24 ++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/components/Common/ProfileImage/index.tsx b/src/components/Common/ProfileImage/index.tsx index 6d630d8..45452fb 100644 --- a/src/components/Common/ProfileImage/index.tsx +++ b/src/components/Common/ProfileImage/index.tsx @@ -7,6 +7,10 @@ import { UserProfileDefault, UserProfileImage } from './styles'; 프로필은 프로필 이미지를 변경하였을 경우 유저의 프로필 이미지를 보여주고, 설정하지 않았으면 기본 프로필을 보여준다. +5/28 수정 +radius - true: border-radius 100%; +radius - false: border-radius 0; + Props: { width height @@ -26,6 +30,7 @@ interface Props { profileImage?: string; profileColor?: string; userName?: string; + radius: boolean; } const ProfileImage = (props: Props): JSX.Element => { @@ -51,6 +56,7 @@ ProfileImage.defaultProps = { height: '30px', margin: '0', userNameSize: '16px', + radius: 'true', }; export default ProfileImage; diff --git a/src/components/Common/ProfileImage/styles.ts b/src/components/Common/ProfileImage/styles.ts index 7c76eaf..7c19593 100644 --- a/src/components/Common/ProfileImage/styles.ts +++ b/src/components/Common/ProfileImage/styles.ts @@ -1,22 +1,36 @@ -import styled from 'styled-components'; +import styled, { css } from 'styled-components'; -export const UserProfileImage = styled.img<{ width: string; margin: string }>` +export const UserProfileImage = styled.img<{ width: string; margin: string; radius: boolean }>` cursor: pointer; object-fit: cover; ${({ theme }) => theme.align.flexCenter} width: ${({ width }) => width}; height: ${({ height }) => height}; margin: ${({ margin }) => margin}; - border-radius: 100%; + ${props => + props.radius + ? css` + border-radius: 100%; + ` + : ` + border-radius: 0; + `} `; -export const UserProfileDefault = styled.div<{ width: string; height: string; margin: string }>` +export const UserProfileDefault = styled.div<{ width: string; height: string; margin: string; radius: boolean }>` cursor: pointer; ${({ theme }) => theme.align.flexCenter} width: ${({ width }) => width}; height: ${({ height }) => height}; margin: ${({ margin }) => margin}; - border-radius: 100%; + ${props => + props.radius + ? css` + border-radius: 100%; + ` + : ` + border-radius: 0; + `} & > span { ${({ theme }) => theme.align.flexCenter} From 1ead0ac3af0e6a881505d364af4cad71a9bba1fc Mon Sep 17 00:00:00 2001 From: useonglee Date: Fri, 28 May 2021 22:08:22 +0900 Subject: [PATCH 2/4] Remove chatBucket props --- src/components/Chat/ChatContainer/index.tsx | 2 +- src/components/Chat/ChatZone/index.tsx | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Chat/ChatContainer/index.tsx b/src/components/Chat/ChatContainer/index.tsx index 1fd64ee..fe4a47f 100644 --- a/src/components/Chat/ChatContainer/index.tsx +++ b/src/components/Chat/ChatContainer/index.tsx @@ -133,7 +133,7 @@ const WorkSpaceChat = (): JSX.Element => { return ( - +