Skip to content

Commit ec67f83

Browse files
committed
Tweak stop button size in compact mode
1 parent 0b27296 commit ec67f83

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/app/components/Button.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface Props {
99
type?: ButtonHTMLAttributes<HTMLButtonElement>['type']
1010
onClick?: () => void
1111
isLoading?: boolean
12-
size?: 'small' | 'normal'
12+
size?: 'small' | 'normal' | 'tiny'
1313
icon?: ReactNode
1414
}
1515

@@ -20,8 +20,9 @@ const Button: FC<Props> = (props) => {
2020
<button
2121
type={type}
2222
className={cx(
23-
size === 'normal' ? 'rounded-full' : 'rounded-xl',
24-
size === 'normal' ? 'text-base font-medium px-6 py-[5px]' : 'text-sm px-4 py-1',
23+
size === 'normal' && 'text-base font-medium px-6 py-[5px] rounded-full',
24+
size === 'small' && 'text-sm px-4 py-1 rounded-xl',
25+
size === 'tiny' && 'text-xs px-3 py-[3px] rounded-lg',
2526
props.color === 'primary' ? 'text-white bg-primary-blue' : 'text-primary-text bg-secondary',
2627
props.className,
2728
)}

src/app/components/Chat/ChatMessageInput.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ const ChatMessageInput: FC<Props> = (props) => {
194194
autoFocus={props.autoFocus}
195195
/>
196196
</div>
197-
{props.actionButton || (
198-
<Button text="-" className="invisible" size={props.mode === 'full' ? 'normal' : 'small'} />
199-
)}
197+
{props.actionButton || <Button text="-" className="invisible" size={props.mode === 'full' ? 'normal' : 'tiny'} />}
200198
</form>
201199
)
202200
}

src/app/components/Chat/ConversationPanel.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,7 @@ const ConversationPanel: FC<Props> = (props) => {
7070
let inputActionButton: ReactNode = null
7171
if (props.generating) {
7272
inputActionButton = (
73-
<Button
74-
text={t('Stop')}
75-
color="flat"
76-
size={mode === 'full' ? 'normal' : 'small'}
77-
onClick={props.stopGenerating}
78-
/>
73+
<Button text={t('Stop')} color="flat" size={mode === 'full' ? 'normal' : 'tiny'} onClick={props.stopGenerating} />
7974
)
8075
} else if (mode === 'full') {
8176
inputActionButton = (
@@ -123,7 +118,9 @@ const ConversationPanel: FC<Props> = (props) => {
123118
<ChatMessageList botId={props.botId} messages={props.messages} className={marginClass} />
124119
<div className={cx('mt-3 flex flex-col ', marginClass, mode === 'full' ? 'mb-3' : 'mb-[5px]')}>
125120
<div className={cx('flex flex-row items-center gap-[5px]', mode === 'full' ? 'mb-3' : 'mb-0')}>
126-
{mode === 'compact' && <span className="font-medium text-xs text-light-text">Send to {botInfo.name}</span>}
121+
{mode === 'compact' && (
122+
<span className="font-medium text-xs text-light-text cursor-default">Send to {botInfo.name}</span>
123+
)}
127124
<hr className="grow border-primary-border" />
128125
</div>
129126
<ChatMessageInput

0 commit comments

Comments
 (0)