mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
💄 style(intervention): polish confirmation bar layout (#14587)
This commit is contained in:
+7
-4
@@ -133,6 +133,7 @@ const AskUserQuestionIntervention = memo<BuiltinInterventionProps<AskUserQuestio
|
|||||||
}, [escapeActive]);
|
}, [escapeActive]);
|
||||||
|
|
||||||
const isFreeform = !question.fields || question.fields.length === 0;
|
const isFreeform = !question.fields || question.fields.length === 0;
|
||||||
|
const shouldShowEscapeAction = !isFreeform;
|
||||||
|
|
||||||
const isSubmitDisabled = escapeActive
|
const isSubmitDisabled = escapeActive
|
||||||
? !escapeText.trim()
|
? !escapeText.trim()
|
||||||
@@ -207,7 +208,7 @@ const AskUserQuestionIntervention = memo<BuiltinInterventionProps<AskUserQuestio
|
|||||||
)}
|
)}
|
||||||
<Flexbox horizontal gap={8} justify={'space-between'}>
|
<Flexbox horizontal gap={8} justify={'space-between'}>
|
||||||
<Flexbox horizontal gap={8} justify="flex-start">
|
<Flexbox horizontal gap={8} justify="flex-start">
|
||||||
{escapeActive ? (
|
{escapeActive && shouldShowEscapeAction ? (
|
||||||
<Text className={styles.escapeLink} type="secondary" onClick={handleEscapeToggle}>
|
<Text className={styles.escapeLink} type="secondary" onClick={handleEscapeToggle}>
|
||||||
<Icon icon={ArrowLeft} /> {t('form.otherBack')}
|
<Icon icon={ArrowLeft} /> {t('form.otherBack')}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -216,9 +217,11 @@ const AskUserQuestionIntervention = memo<BuiltinInterventionProps<AskUserQuestio
|
|||||||
<Text className={styles.escapeLink} type="secondary" onClick={handleSkip}>
|
<Text className={styles.escapeLink} type="secondary" onClick={handleSkip}>
|
||||||
{t('form.skip')}
|
{t('form.skip')}
|
||||||
</Text>
|
</Text>
|
||||||
<Text className={styles.escapeLink} type="secondary" onClick={handleEscapeToggle}>
|
{shouldShowEscapeAction && (
|
||||||
{t('form.other')} <Icon icon={PenLine} />
|
<Text className={styles.escapeLink} type="secondary" onClick={handleEscapeToggle}>
|
||||||
</Text>
|
{t('form.other')} <Icon icon={PenLine} />
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Flexbox>
|
</Flexbox>
|
||||||
|
|||||||
@@ -2,35 +2,40 @@ import { createStaticStyles } from 'antd-style';
|
|||||||
|
|
||||||
export const styles = createStaticStyles(({ css, cssVar }) => ({
|
export const styles = createStaticStyles(({ css, cssVar }) => ({
|
||||||
actions: css`
|
actions: css`
|
||||||
padding-block: 8px;
|
padding-block: 8px 10px;
|
||||||
padding-inline: 16px;
|
padding-inline: 10px;
|
||||||
border-block-start: 1px solid ${cssVar.colorBorderSecondary};
|
border-block-start: 1px solid ${cssVar.colorBorderSecondary};
|
||||||
|
background: color-mix(in srgb, ${cssVar.colorBgElevated} 92%, ${cssVar.colorFillSecondary});
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
container: css`
|
container: css`
|
||||||
|
overflow: hidden;
|
||||||
margin-block-end: 12px;
|
margin-block-end: 12px;
|
||||||
`,
|
`,
|
||||||
content: css`
|
content: css`
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
padding-block: 8px 12px;
|
padding-block: 6px 8px;
|
||||||
`,
|
`,
|
||||||
tab: css`
|
tab: css`
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
padding-block: 6px;
|
padding-block: 5px;
|
||||||
padding-inline: 14px;
|
padding-inline: 10px;
|
||||||
border-block-end: 2px solid transparent;
|
border-block-end: 2px solid transparent;
|
||||||
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: ${cssVar.colorTextSecondary};
|
color: ${cssVar.colorTextSecondary};
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
transition: all 0.2s;
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
color 0.2s,
|
||||||
|
background 0.2s;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: ${cssVar.colorText};
|
color: ${cssVar.colorText};
|
||||||
@@ -49,8 +54,8 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
|
|||||||
`,
|
`,
|
||||||
tabCounter: css`
|
tabCounter: css`
|
||||||
margin-inline-start: auto;
|
margin-inline-start: auto;
|
||||||
padding-block: 6px;
|
padding-block: 5px;
|
||||||
padding-inline: 14px;
|
padding-inline: 10px;
|
||||||
|
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: ${cssVar.colorTextTertiary};
|
color: ${cssVar.colorTextTertiary};
|
||||||
|
|||||||
+13
-5
@@ -34,7 +34,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|||||||
footer: css`
|
footer: css`
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin-block-start: 12px;
|
margin-block-start: 8px;
|
||||||
`,
|
`,
|
||||||
number: css`
|
number: css`
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
@@ -49,9 +49,10 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
padding-block: 8px;
|
min-height: 40px;
|
||||||
padding-inline: 12px;
|
padding-block: 7px;
|
||||||
border-radius: 8px;
|
padding-inline: 16px;
|
||||||
|
border-radius: calc(${cssVar.borderRadiusLG} - 2px);
|
||||||
|
|
||||||
color: ${cssVar.colorTextSecondary};
|
color: ${cssVar.colorTextSecondary};
|
||||||
|
|
||||||
@@ -121,6 +122,13 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|||||||
margin-inline-start: 6px;
|
margin-inline-start: 6px;
|
||||||
color: ${cssVar.colorTextTertiary};
|
color: ${cssVar.colorTextTertiary};
|
||||||
`,
|
`,
|
||||||
|
submitButton: css`
|
||||||
|
&.ant-btn {
|
||||||
|
min-width: 88px;
|
||||||
|
height: 36px;
|
||||||
|
border-radius: calc(${cssVar.borderRadiusLG} - 2px);
|
||||||
|
}
|
||||||
|
`,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const ApprovalActions = memo<ApprovalActionsProps>(
|
const ApprovalActions = memo<ApprovalActionsProps>(
|
||||||
@@ -290,9 +298,9 @@ const ApprovalActions = memo<ApprovalActionsProps>(
|
|||||||
|
|
||||||
<div className={styles.footer}>
|
<div className={styles.footer}>
|
||||||
<Button
|
<Button
|
||||||
|
className={styles.submitButton}
|
||||||
disabled={isMessageCreating}
|
disabled={isMessageCreating}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
shape={'round'}
|
|
||||||
size={'middle'}
|
size={'middle'}
|
||||||
type={'primary'}
|
type={'primary'}
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
|
|||||||
+3
-1
@@ -29,7 +29,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
padding-block: 6px;
|
padding-block: 6px;
|
||||||
padding-inline: 16px;
|
padding-inline: 10px;
|
||||||
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: ${cssVar.colorTextTertiary};
|
color: ${cssVar.colorTextTertiary};
|
||||||
@@ -41,7 +41,9 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|||||||
description: css`
|
description: css`
|
||||||
padding-block: 8px;
|
padding-block: 8px;
|
||||||
padding-inline: 16px;
|
padding-inline: 16px;
|
||||||
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
color: ${cssVar.colorText};
|
color: ${cssVar.colorText};
|
||||||
`,
|
`,
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user