Skip to content

Commit

Permalink
(#72) ๐ŸŽจ design: ์ฑ—๋ด‡ ๋งํ’์„  ๋„ˆ๋น„ ์ผ๋ฐ˜ํ™” ๋ฐ ๋ชจ๋“ˆํ™”
Browse files Browse the repository at this point in the history
  • Loading branch information
inaemon committed Nov 27, 2024
1 parent 4e24904 commit 6110021
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 12 deletions.
3 changes: 3 additions & 0 deletions src/constants/ChatbotData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { StadiumType, stadiumStringList } from "@/src/constants/ZoneData";

export const chatbotName = "๋ฃจํ‚ค";

export const maxChatWidth = "max-w-[270px]"; // ์ฑ„ํŒ… ๋งํ’์„  ์ตœ๋Œ€ ํฌ๊ธฐ
export const minCategoryWidth = "min-w-[180px]"; // ์ฑ„ํŒ… ๋‚ด๋ถ€ ์นดํ…Œ๊ณ ๋ฆฌ ์ตœ์†Œ ํฌ๊ธฐ

export const questionCategories = {
// ๊ธฐ๋ณธ ๋ฐ์ดํ„ฐ
chatbotName,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Chatbot/components/message/RookieMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { maxChatWidth } from "@/src/constants/ChatbotData";

interface Props {
messageList: string[]; // ๋ฌธ์ž์—ด์„ ๋ฐฐ์—ด๋กœ ๋ฐ›์•„์„œ ๋‹ค์Œ ์ค„์— ์ž‘์„ฑ
Expand All @@ -8,7 +9,7 @@ interface Props {
const RookieMessage = ({messageList}: Props) => {
return (
// ๋ฉ”์‹œ์ง€๋ฅผ string ๋ฐฐ์—ด๋กœ ๋ฐ›๊ณ  ์ค„๋ฐ”๊ฟˆ์„ ๋ฐฐ์—ด ์›์†Œ๋กœ ๊ตฌ๋ถ„ํ•ด์„œ ์ถœ๋ ฅํ•˜๊ธฐ
<div className="bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
<div className={`bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 ${maxChatWidth}`}>
{/** ๋ฉ”์‹œ์ง€ 1์ค„ ์ด์ƒ ๋ฐฐ์—ด๋กœ ๋ฐ›์•„์„œ ์—ฌ๋Ÿฌ pํƒœ๊ทธ๋กœ ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅํ•˜๊ธฐ */}
{messageList.map((message, index) => (
<p key={index}>{message}</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import Image from "next/image";
import tailIcon from "@/src/assets/webp/chatbot_message_left_tail_white_big.webp"; // ๊ผฌ๋ž‘์ง€
import { maxChatWidth } from "@/src/constants/ChatbotData";

interface Props {
messageList: string[];
Expand All @@ -9,7 +10,7 @@ interface Props {
// ์ฑ—๋ด‡ ๋งํ’์„  ์ปดํฌ๋„ŒํŠธ ํƒ€์ž…1 (๊ผฌ๋ž‘์ง€๊ฐ€ ๋ถ™์€ ๋ฒ„์ ผ)
const RookieMessageWithTail = ({messageList}: Props) => {
return (
<div className="relative bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
<div className={`relative bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 ${maxChatWidth}`}>
{/* ๋งํ’์„  ๊ผฌ๋ž‘์ง€ */}
<Image src={tailIcon} alt="๊ผฌ๋ž‘์ง€" className="absolute left-[-12px] top-2 w-5 h-5"/>

Expand Down
3 changes: 2 additions & 1 deletion src/pages/Chatbot/components/message/UserMessageWithTail.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import Image from "next/image";
import tailIcon from "@/src/assets/webp/chatbot_message_right_tail_pink_big.webp"; // ๊ผฌ๋ž‘์ง€
import { maxChatWidth } from "@/src/constants/ChatbotData";

interface Props {
messageList: string[];
Expand All @@ -9,7 +10,7 @@ interface Props {
// ์œ ์ € ๋งํ’์„  ์ปดํฌ๋„ŒํŠธ ํƒ€์ž…1 (๊ผฌ๋ž‘์ง€๊ฐ€ ๋ถ™์€ ๋ฒ„์ ผ)
const UserMessageWithTail = ({messageList}: Props) => {
return (
<div className="relative bg-main-5 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
<div className={`relative bg-main-5 p-3 rounded-lg text-xs font-regular text-grayscale-90 ${maxChatWidth}`}>
{/* ๋งํ’์„  ๊ผฌ๋ž‘์ง€ */}
<Image src={tailIcon} alt="๊ผฌ๋ž‘์ง€" className="absolute right-[-12px] top-2 w-5 h-5"/>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import Image from "next/image";
import { maxChatWidth } from "@/src/constants/ChatbotData";

interface Props {
imgUrl: string;
Expand All @@ -14,7 +15,7 @@ const RookieImageMessage = ({imgUrl}: Props) => {
<Image
src={imgUrl}
alt="Category Icon"
className="max-w-full h-auto rounded-md"
className={`${maxChatWidth} h-auto rounded-md`}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { maxChatWidth } from "@/src/constants/ChatbotData";

interface Props {
message: string;
Expand All @@ -9,7 +10,7 @@ interface Props {
const RookiePreformattedMessage = ({message}: Props) => {
return (
// ๋ฉ”์‹œ์ง€๋ฅผ string์œผ๋กœ ๋ฐ›๊ณ  ์ค„๋ฐ”๊ฟˆ์„ \n ๊ฐ’์œผ๋กœ ๊ตฌ๋ถ„ํ•ด์„œ ์ถœ๋ ฅํ•˜๊ธฐ
<div className="whitespace-pre-wrap bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
<div className={`whitespace-pre-wrap bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 ${maxChatWidth}`}>
{[message]}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import Image from "next/image";
import tailIcon from "@/src/assets/webp/chatbot_message_left_tail_white_big.webp"; // ๊ผฌ๋ž‘์ง€
import { maxChatWidth } from "@/src/constants/ChatbotData";

interface Props {
message: string;
Expand All @@ -11,7 +12,7 @@ interface Props {
const RookiePreformattedMessage = ({message}: Props) => {
return (
// ๋ฉ”์‹œ์ง€๋ฅผ string์œผ๋กœ ๋ฐ›๊ณ  ์ค„๋ฐ”๊ฟˆ์„ \n ๊ฐ’์œผ๋กœ ๊ตฌ๋ถ„ํ•ด์„œ ์ถœ๋ ฅํ•˜๊ธฐ
<div className="relative whitespace-pre-wrap bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
<div className={`relative whitespace-pre-wrap bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 ${maxChatWidth}`}>
{/* ๋งํ’์„  ๊ผฌ๋ž‘์ง€ */}
<Image src={tailIcon} alt="๊ผฌ๋ž‘์ง€" className="absolute left-[-12px] top-2 w-5 h-5"/>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { maxChatWidth, minCategoryWidth } from "@/src/constants/ChatbotData";

interface Props {
messageList: string[];
Expand All @@ -8,13 +9,13 @@ interface Props {
// ๋ฉ”์‹œ์ง€๋ฅผ ๋ฆฌ์ŠคํŠธ๋กœ ์ถœ๋ ฅ
const RookieWhiteListMessage = ({messageList}: Props) => {
return (
<div className="bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
<div className={`bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 ${maxChatWidth}`}>
{/** ๋ฉ”์‹œ์ง€ 1์ค„ ์ด์ƒ ๋ฐฐ์—ด๋กœ ๋ฐ›์•„์„œ ์—ฌ๋Ÿฌ li ํƒœ๊ทธ๋กœ ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅํ•˜๊ธฐ */}
<ul className="space-y-1.5">
{messageList.map((message, index) => (
<li
key={index}
className="px-2 text-xs min-w-[180px] w-full text-left font-regular text-grayscale-90 rounded-md"
key={index}
className={`px-2 text-xs text-left font-regular text-grayscale-90 rounded-md ${minCategoryWidth} w-full`}
>
{message}
</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import Image from "next/image";
import tailIcon from "@/src/assets/webp/chatbot_message_left_tail_white_big.webp"; // ๊ผฌ๋ž‘์ง€
import { maxChatWidth, minCategoryWidth } from "@/src/constants/ChatbotData";

interface Props {
messageList: string[];
Expand All @@ -10,16 +11,16 @@ interface Props {
// ๋ฉ”์‹œ์ง€๋ฅผ ๋ฆฌ์ŠคํŠธ๋กœ ์ถœ๋ ฅ
const RookieWhiteListMessageWithTail = ({messageList}: Props) => {
return (
<div className="relative bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 max-w-xs">
<div className={`relative bg-main-0 p-3 rounded-lg text-xs font-regular text-grayscale-90 ${maxChatWidth}`}>
{/* ๋งํ’์„  ๊ผฌ๋ž‘์ง€ */}
<Image src={tailIcon} alt="๊ผฌ๋ž‘์ง€" className="absolute left-[-12px] top-2 w-5 h-5"/>

{/** ๋ฉ”์‹œ์ง€ 1์ค„ ์ด์ƒ ๋ฐฐ์—ด๋กœ ๋ฐ›์•„์„œ ์—ฌ๋Ÿฌ li ํƒœ๊ทธ๋กœ ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅํ•˜๊ธฐ */}
<ul className="space-y-1.5">
{messageList.map((message, index) => (
<li
key={index}
className="px-2 text-xs min-w-[180px] w-full text-left font-regular text-grayscale-90 rounded-md"
key={index}
className={`px-2 text-xs text-left font-regular text-grayscale-90 rounded-md ${minCategoryWidth} w-full`}
>
{message}
</li>
Expand Down

0 comments on commit 6110021

Please sign in to comment.