Skip to content

Commit 07db36d

Browse files
committed
Refactor: Chats 컬러시스템 적용
1 parent 5205460 commit 07db36d

14 files changed

Lines changed: 47 additions & 31 deletions

File tree

src/pages/Chats/ChatRoom/ChatBox/styles.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export const ChatBoxContainer = styled.div`
1111
1212
display: flex;
1313
padding: 0.5rem 1.12rem;
14-
background-color: white;
14+
background-color: ${({ theme }) => theme.colors.text.white};
1515
gap: 0.5rem;
16-
border-top: 1px solid ${({ theme }) => theme.colors.gray2};
16+
border-top: 1px solid ${({ theme }) => theme.colors.gray[300]};
1717
align-items: center;
1818
`;
1919

@@ -26,21 +26,21 @@ export const Textarea = styled.textarea<{ $isOtherUserValid: boolean }>`
2626
outline: none;
2727
resize: none;
2828
overflow: hidden;
29-
color: ${({ theme }) => theme.colors.black};
29+
color: ${({ theme }) => theme.colors.text.primary};
3030
cursor: ${({ $isOtherUserValid }) => ($isOtherUserValid ? '' : 'not-allowed')};
3131
background-color: #f2f2f2;
3232
${({ theme }) => theme.fontStyles['body2-regular']};
3333
3434
&::placeholder {
35-
color: ${({ theme }) => theme.colors.gray2};
35+
color: ${({ theme }) => theme.colors.text.tertiary};
3636
${({ theme }) => theme.fontStyles['body2-regular']};
3737
}
3838
`;
3939

4040
export const SendButton = styled.button<{ $isOtherUserValid: boolean }>`
4141
padding: 1.12rem;
4242
border-radius: 50%;
43-
background-color: #ffe9f3;
43+
background-color: ${({ theme }) => theme.colors.brand.primaryLight};
4444
background-image: url(${SendIcon});
4545
background-repeat: no-repeat;
4646
background-position: center;

src/pages/Chats/ChatRoom/DateBar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const DateBar: React.FC<DateBarProps> = React.memo(({ formattedDate }) => {
1010
return (
1111
<DatebarLayout>
1212
<Divider />
13-
<Date $textTheme={{ style: 'caption1-regular' }} color={theme.colors.gray3}>
13+
<Date $textTheme={{ style: 'caption1-regular' }} color={theme.colors.text.tertiary}>
1414
{formattedDate}
1515
</Date>
1616
<Divider />

src/pages/Chats/ChatRoom/RcvdMessage/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,24 @@ const RcvdMessage: React.FC<RcvdMessageProps & { onClickProfile: () => void }> =
1919
<FirstMessageLayout $isSenderChanged={isSenderChanged}>
2020
<UserImage onClick={onClickProfile} src={profilePictureUrl} alt="프로필 사진" />
2121
<MessageBox>
22-
<UsernameText onClick={onClickProfile} $textTheme={{ style: 'body2-regular' }} color={theme.colors.black}>
22+
<UsernameText
23+
onClick={onClickProfile}
24+
$textTheme={{ style: 'body2-regular' }}
25+
color={theme.colors.text.primary}
26+
>
2327
{fromUserNickname}
2428
</UsernameText>
25-
<Message $textTheme={{ style: 'body2-regular' }} color={theme.colors.black}>
29+
<Message $textTheme={{ style: 'body2-regular' }} color={theme.colors.text.primary}>
2630
{content}
2731
</Message>
2832
</MessageBox>
33+
{isTimeVisible && <TimeWrapper>{formattedTime}</TimeWrapper>}
2934
</FirstMessageLayout>
3035
);
3136
} else {
3237
return (
3338
<MessageLayout>
34-
<Message $textTheme={{ style: 'body2-regular' }} color={theme.colors.black}>
39+
<Message $textTheme={{ style: 'body2-regular' }} color={theme.colors.text.primary}>
3540
{content}
3641
</Message>
3742
{isTimeVisible && <TimeWrapper>{formattedTime}</TimeWrapper>}

src/pages/Chats/ChatRoom/RcvdMessage/styles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const Message = styled(StyledText)`
4343
export const TimeWrapper = styled.time`
4444
display: flex;
4545
align-items: flex-end;
46-
color: ${({ theme }) => theme.colors.gray3};
46+
color: ${({ theme }) => theme.colors.text.caption};
4747
font-family: 'Pretendard Variable';
4848
font-size: 0.5625rem;
4949
font-style: normal;

src/pages/Chats/ChatRoom/SentMessage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const SentMessage: React.FC<SentMessageProps> = React.memo(
88
return (
99
<MessageLayout $isSenderChanged={isSenderChanged}>
1010
{isTimeVisible && <TimeWrapper>{formattedTime}</TimeWrapper>}
11-
<Message $textTheme={{ style: 'body2-regular' }} color={theme.colors.black}>
11+
<Message $textTheme={{ style: 'body2-regular' }} color={theme.colors.text.primary}>
1212
{content}
1313
</Message>
1414
</MessageLayout>

src/pages/Chats/ChatRoom/SentMessage/styles.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export const MessageLayout = styled.div<{ $isSenderChanged: boolean }>`
1010

1111
export const Message = styled(StyledText)`
1212
padding: 0.4rem 0.8rem;
13-
background-color: #ffe9f3;
13+
/* background-color: ${({ theme }) => theme.colors.brand.primaryLight}; */
14+
border: 1.2px solid ${({ theme }) => theme.colors.brand.primaryLight};
1415
border-radius: 0.8rem 0 0.8rem 0.8rem;
1516
max-width: 75%;
1617
overflow-wrap: break-word;
@@ -20,7 +21,7 @@ export const TimeWrapper = styled.time`
2021
display: flex;
2122
align-items: flex-end;
2223
margin-right: 0.5rem;
23-
color: #8e8e93;
24+
color: ${({ theme }) => theme.colors.text.caption};
2425
font-family: 'Pretendard Variable';
2526
font-size: 0.5625rem;
2627
font-style: normal;

src/pages/Chats/ChatRoomItem/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'dayjs/locale/ko';
99
import { useEffect, useState } from 'react';
1010
import type { ChatRoomData } from '@apis/chatting/dto';
1111
import defaultProfile from '@assets/default/defaultProfile.svg';
12+
import theme from '@styles/theme';
1213
dayjs.extend(relativeTime);
1314

1415
const ChatRoomItem: React.FC<ChatRoomData> = ({ id, otherUser, latestMessage }) => {
@@ -42,15 +43,15 @@ const ChatRoomItem: React.FC<ChatRoomData> = ({ id, otherUser, latestMessage })
4243
<ChatRoomItemLayout onClick={handleChatRoomClick}>
4344
<UserImage src={otherUser?.profilePictureUrl || defaultProfile} alt="user" />
4445
<LeftBox>
45-
<StyledText $textTheme={{ style: 'body2-medium' }} color="#1D1D1D">
46+
<StyledText $textTheme={{ style: 'body2-medium' }} color={theme.colors.text.primary}>
4647
{otherUser?.nickname || '알수없음'}
4748
</StyledText>
48-
<LatestMessage $textTheme={{ style: 'caption2-regular' }} color="#1D1D1D">
49+
<LatestMessage $textTheme={{ style: 'caption2-regular' }} color={theme.colors.text.primary}>
4950
{latestMessage.content}
5051
</LatestMessage>
5152
</LeftBox>
5253
<RightBox>
53-
<StyledText $textTheme={{ style: 'caption2-regular' }} color="#8e8e93">
54+
<StyledText $textTheme={{ style: 'caption2-regular' }} color={theme.colors.text.caption}>
5455
{timeAgo}
5556
</StyledText>
5657
</RightBox>

src/pages/Chats/Matching/Cards/Card/index.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,21 @@ const Card: React.FC<CardProps> = ({ removeRejectedMatching, matching }) => {
8787
<img src={requester.profilePictureUrl || defaultProfile} alt="profile" />
8888
</ProfileImgBox>
8989
<ProfileInfo>
90-
<StyledText $textTheme={{ style: 'body1-medium' }} color={theme.colors.black} onClick={handleUserClick}>
90+
<StyledText
91+
$textTheme={{ style: 'body1-medium' }}
92+
color={theme.colors.text.primary}
93+
onClick={handleUserClick}
94+
>
9195
{requester.nickname || '알수없음'}
9296
</StyledText>
9397
<div className="row-flex">
9498
{requester.representativePost.styleTags.map((tag, index) => (
9599
<div className="row-flex" key={tag}>
96-
<StyledText $textTheme={{ style: 'caption2-regular' }} color={theme.colors.gray1}>
100+
<StyledText $textTheme={{ style: 'caption2-regular' }} color={theme.colors.gray[200]}>
97101
{tag}
98102
</StyledText>
99103
{index < requester.representativePost.styleTags.length - 1 && (
100-
<StyledText $textTheme={{ style: 'caption2-regular' }} color={theme.colors.gray1}>
104+
<StyledText $textTheme={{ style: 'caption2-regular' }} color={theme.colors.gray[200]}>
101105
,&nbsp;
102106
</StyledText>
103107
)}
@@ -106,7 +110,7 @@ const Card: React.FC<CardProps> = ({ removeRejectedMatching, matching }) => {
106110
</div>
107111
</ProfileInfo>
108112
<SeeMore onClick={() => nav(`/users/${requester.id}`)}>
109-
<StyledText $textTheme={{ style: 'caption2-regular' }} color="#8e8e93">
113+
<StyledText $textTheme={{ style: 'caption2-regular' }} color={theme.colors.text.caption}>
110114
OOTD 더 보기
111115
</StyledText>
112116
<ArrowButton />

src/pages/Chats/Matching/Cards/Card/styles.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styled from 'styled-components';
22
import ArrowIcon from '@assets/arrow/min-right.svg';
33

44
export const CardLayout = styled.div`
5-
background-color: #ececec;
5+
background-color: ${({ theme }) => theme.colors.gray[200]};
66
border-radius: 0.5rem;
77
position: relative;
88
height: 100%;
@@ -79,7 +79,6 @@ export const OOTDImgBox = styled.div`
7979
8080
.childSwiper {
8181
z-index: 10;
82-
// align-items: stretch;
8382
width: 100%;
8483
height: 100%;
8584
}

src/pages/Chats/Matching/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import type { MatchingProps } from './dto';
88
const Matching: React.FC<MatchingProps> = ({ matchingCount, decreaseMatchingCount }) => {
99
return (
1010
<>
11-
<ReqeustInfo $textTheme={{ style: 'body2-regular' }} color={theme.colors.black}>
11+
<ReqeustInfo $textTheme={{ style: 'body2-regular' }} color={theme.colors.text.primary}>
1212
Message&nbsp;
13-
<StyledText $textTheme={{ style: 'body1-bold' }} color="#FF2389">
13+
<StyledText $textTheme={{ style: 'body1-bold' }} color={theme.colors.brand.primary}>
1414
{matchingCount}
1515
</StyledText>
1616
</ReqeustInfo>

0 commit comments

Comments
 (0)