Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style: fix font size and text #53

Merged
merged 7 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/hooks/use-preset-button.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const usePresetButton = () => {

const handleReferenceButtonClick = (references: referenceState[]) => {
let content = '๋‹ต๋ณ€ ์ถœ์ฒ˜๋ฅผ ์•Œ๋ ค๋“œ๋ฆด๊ฒŒ์š”!\n';
if (references === undefined || references.length === 0) {
// references๊ฐ€ null, undefined, ๋˜๋Š” ๊ธธ์ด๊ฐ€ 0์ธ ๊ฒฝ์šฐ ์ฒดํฌ
if (!references || references.length === 0) {
addMessage({ content: '์ถœ์ฒ˜ ์ •๋ณด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.', role: 'system' });
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/atom/chat-card/chat-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ const ChatCard = ({ content, role }: ChatCardProps) => {
<div
className={cn('flex w-auto rounded-md bg-white px-5 py-3 text-black', {
'justify-end bg-primary-blue text-white': role === 'user',
'justify-start text-left': role !== 'user',
'max-w-full justify-start text-left mobile:max-w-full desktop:max-w-[2/3]': role !== 'user', // ๋ชจ๋ฐ”์ผ์—์„œ๋Š” w-auto,
})}
>
<div className="font-pretendard text-sm font-normal">
<div className="text-md font-pretendard font-normal">
{content === 'loading' ? <Loader /> : <ReactMarkdown remarkPlugins={[remarkGfm]}>{content}</ReactMarkdown>}
</div>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/ui/components/atom/preset/preset-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ interface PresetButtonProps {

const PresetButton = ({ onClick, isSelected, disabled, children }: PresetButtonProps) => {
const buttonClasses = cn(
'cursor-pointer rounded-full border border-gray text-black bg-white px-4 py-2 ',
isSelected ? 'bg-primary-blue text-white border-primary-blue' : 'bg-white text-black',
disabled ? 'bg-border-gray cursor-not-allowed text-border-gray bg-text-white' : '',
'cursor-pointer text-base rounded-full border border-gray text-black bg-white px-4 py-2 transition-colors duration-200',
isSelected
? 'bg-primary-blue text-white border-gray'
: 'bg-white text-black hover:bg-primary-blue hover:text-white',
disabled
? 'bg-border-gray cursor-not-allowed text-border-gray bg-text-white hover:text-border-gray hover:bg-text-white'
: '',
);

return (
Expand Down
43 changes: 31 additions & 12 deletions src/ui/components/molecule/chat-section/chat-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ const ChatSection: React.FC = () => {
const showCategoryStatus = () => {
let contentMessage = '';
if (!activeSusi && !activeJeongsi && !activePyeonip) {
contentMessage = 'ํ˜„์žฌ ๋ชจ๋“  ์นดํ…Œ๊ณ ๋ฆฌ ์ด์šฉ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.';
contentMessage = 'ํ˜„์žฌ๋Š” ๋ชจ๋“  ์นดํ…Œ๊ณ ๋ฆฌ ์ด์šฉ์ด ๊ฐ€๋Šฅํ•ด์š”.';
} else if (!activeSusi && activeJeongsi && activePyeonip) {
contentMessage = 'ํ˜„์žฌ ์ˆ˜์‹œ ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.';
contentMessage = 'ํ˜„์žฌ๋Š” ์ˆ˜์‹œ ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ด์š”.';
} else if (activeSusi && !activeJeongsi && activePyeonip) {
contentMessage = 'ํ˜„์žฌ ์ •์‹œ ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.';
contentMessage = 'ํ˜„์žฌ๋Š” ์ •์‹œ ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ด์š”.';
} else if (activeSusi && activeJeongsi && !activePyeonip) {
contentMessage = 'ํ˜„์žฌ ํŽธ์ž… ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.';
contentMessage = 'ํ˜„์žฌ๋Š” ํŽธ์ž… ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ด์š”.';
} else if (!activeSusi && !activeJeongsi && activePyeonip) {
contentMessage = 'ํ˜„์žฌ ์ˆ˜์‹œ, ์ •์‹œ ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.';
contentMessage = 'ํ˜„์žฌ๋Š” ์ˆ˜์‹œ, ์ •์‹œ ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ด์š”.';
} else if (!activeSusi && activeJeongsi && !activePyeonip) {
contentMessage = 'ํ˜„์žฌ ์ˆ˜์‹œ, ํŽธ์ž… ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.';
contentMessage = 'ํ˜„์žฌ๋Š” ์ˆ˜์‹œ, ํŽธ์ž… ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ด์š”';
} else if (activeSusi && !activeJeongsi && !activePyeonip) {
contentMessage = 'ํ˜„์žฌ ์ •์‹œ, ํŽธ์ž… ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.';
contentMessage = 'ํ˜„์žฌ๋Š” ์ •์‹œ, ํŽธ์ž… ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ด์šฉ ๊ฐ€๋Šฅํ•ด์š”.';
}

if (contentMessage) {
Expand Down Expand Up @@ -101,16 +101,24 @@ const ChatSection: React.FC = () => {
<div className="max-h-100vh w-full overflow-y-auto px-4 pb-24 pt-16">
{contextHolder}
<ChatCard
content={`์•ˆ๋…•ํ•˜์„ธ์š” ์ž…ํ•™์ฒ˜ ์ฑ—๋ด‡ MARU-EGG์ž…๋‹ˆ๋‹ค!
๊ถ๊ธˆํ•˜์‹  ๋‚ด์šฉ ์•ˆ๋‚ด ๋„์™€๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.
์•Œ์•„๋ณด๊ณ  ์‹ถ์€ ์ „ํ˜•์„ ์„ ํƒํ•ด์ฃผ์„ธ์š”!`}
content={`์•ˆ๋…•ํ•˜์„ธ์š”.
๋ช…์ง€๋Œ€ํ•™๊ต ์ž…ํ•™ AI์ฑ—๋ด‡ ๋งˆ๋ฃจ์—๊ทธ์ž…๋‹ˆ๋‹ค!
๋ฌธ์˜์‚ฌํ•ญ์€ ์•„๋ž˜ ์ „ํ˜• ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•ด์ฃผ์‹œ๋ฉด
์•ˆ๋‚ด ๋„์™€๋“œ๋ฆด๊ฒŒ์š”!`}
role="system"
/>
<TypePresetButtons />
{type && <ChatCard role="user" content={type === 'SUSI' ? '์ˆ˜์‹œ' : type === 'JEONGSI' ? '์ •์‹œ' : 'ํŽธ์ž…'} />}
{type && (
<>
<ChatCard content="์•Œ๊ณ ์‹ถ์€ ๋‚ด์šฉ์„ ์„ ํƒํ•ด์ฃผ์„ธ์š”" role="system" />
<ChatCard
content={`${
type === 'SUSI' ? '์ˆ˜์‹œ' : type === 'JEONGSI' ? '์ •์‹œ' : 'ํŽธ์ž…'
}์™€ ๊ด€๋ จํ•˜์—ฌ ๊ถ๊ธˆํ•˜์‹  ์ ์ด ์žˆ์œผ์‹ ๊ฐ€์š”?
์•„๋ž˜์—์„œ ๊ด€๋ จ ๋ฒ„ํŠผ์„ ์„ ํƒํ•˜์—ฌ
์ž์„ธํ•œ ๋‚ด์šฉ์„ ํ™•์ธํ•ด์ฃผ์„ธ์š”!`}
role="system"
/>
<CategoryPresetButtons />
</>
)}
Expand All @@ -127,7 +135,18 @@ const ChatSection: React.FC = () => {
/>
)}
{type && category && (
<ChatCard role="system" content="์•ˆ๋…•ํ•˜์„ธ์š” ์ž…ํ•™์ฒ˜ ์ฑ—๋ด‡ MARU-EGG์ž…๋‹ˆ๋‹ค! ๊ถ๊ธˆํ•˜์‹  ๋‚ด์šฉ ์•ˆ๋‚ด ๋„์™€๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค." />
<ChatCard
role="system"
content={`${type === 'SUSI' ? '์ˆ˜์‹œ' : type === 'JEONGSI' ? '์ •์‹œ' : 'ํŽธ์ž…'}์—์„œ ${
category === 'PASSING_RESULT'
? '์ „๋…„๋„ ์ž…์‹œ๊ฒฐ๊ณผ'
: category === 'ADMISSION_GUIDELINE'
? '๋ชจ์ง‘ ๊ด€๋ จ'
: '๊ธฐ์ถœ๋ฌธ์ œ'
}์„(๋ฅผ) ์„ ํƒํ•˜์…จ๋„ค์š”!
์•„๋ž˜ ๋ฒ„ํŠผ์„ ์„ ํƒํ•˜์—ฌ ๋” ์ž์„ธํ•œ ๋‚ด์šฉ์„ ์•Œ์•„๋ณด๊ฑฐ๋‚˜
์ง์ ‘ ์งˆ๋ฌธํ•ด๋ณด์„ธ์š”!`}
/>
)}
{messages.map((msg, index) => (
<ChatCard key={index} content={msg.content} role={msg.role} />
Expand Down
8 changes: 4 additions & 4 deletions src/ui/components/molecule/menu-drawer/menu-drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const MenuDrawer = ({ open, onClose }: MenuDrawerProps) => {
closable={false}
open={open}
onClose={onClose}
height="260px"
height="300px"
rootClassName="absolute mx-auto my-auto desktop:max-w-[390px] desktop:max-h-[780px] desktop:rounded-t-3xl desktop:rounded-b-3xl mobile:max-w-full mobile:max-h-full mobile:rounded-none mobile:shadow-none"
rootStyle={{ width: '100%', overflow: 'hidden' }}
>
Expand All @@ -81,19 +81,19 @@ const MenuDrawer = ({ open, onClose }: MenuDrawerProps) => {
</div>
<div
onClick={() => window.open(FAQUrl, '_blank', 'noopener, noreferrer')}
className="w-full cursor-pointer p-2 text-start font-pretendard text-sm hover:rounded-lg hover:bg-[#F4F4F4]"
className="w-full cursor-pointer p-2 text-start font-pretendard text-base hover:rounded-lg hover:bg-[#F4F4F4]"
>
{selectedButton === 'PYEONIP' ? 'ํŽธ์ž…' : selectedButton === 'JEONGSI' ? '์ •์‹œ' : '์ˆ˜์‹œ'} FAQ ๋ฐ”๋กœ๊ฐ€๊ธฐ
</div>
<div
onClick={() => window.open(admissionResultsUrl, '_blank', 'noopener, noreferrer')}
className="w-full cursor-pointer p-2 text-start font-pretendard text-sm hover:rounded-lg hover:bg-[#F4F4F4]"
className="w-full cursor-pointer p-2 text-start font-pretendard text-base hover:rounded-lg hover:bg-[#F4F4F4]"
>
{selectedButton === 'PYEONIP' ? 'ํŽธ์ž…' : selectedButton === 'JEONGSI' ? '์ •์‹œ' : '์ˆ˜์‹œ'} ์ž…์‹œ๊ฒฐ๊ณผ ๋ฐ”๋กœ๊ฐ€๊ธฐ
</div>
<div
onClick={() => window.open(admissionGuideUrl, '_blank', 'noopener, noreferrer')}
className="w-full cursor-pointer p-2 text-start font-pretendard text-sm hover:rounded-lg hover:bg-[#F4F4F4]"
className="w-full cursor-pointer p-2 text-start font-pretendard text-base hover:rounded-lg hover:bg-[#F4F4F4]"
>
{selectedButton === 'PYEONIP' ? 'ํŽธ์ž…' : selectedButton === 'JEONGSI' ? '์ •์‹œ' : '์ˆ˜์‹œ'} ๋ชจ์ง‘์š”๊ฐ• ๋ฐ”๋กœ๊ฐ€๊ธฐ
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const QuestionPresetButtons = () => {
const { handleReferenceButtonClick, handleButtonClick } = usePresetButton();

return (
<div>
<div className="grid w-full grid-cols-1 gap-2 mobile:w-2/3 mobile:grid-cols-1 desktop:grid desktop:w-full desktop:grid-cols-2 desktop:gap-2">
{!referenceButtonDisabled && (
<PresetButton onClick={() => handleReferenceButtonClick(lastReference)}>๐Ÿ‘† ์ถœ์ฒ˜๋ฅผ ์•Œ๊ณ ์‹ถ์–ด์š”</PresetButton>
)}
Expand Down
Loading