Skip to content

Commit 7e5b53c

Browse files
💄 style: Update Mobile Compinents
1 parent 12a408e commit 7e5b53c

File tree

2 files changed

+41
-47
lines changed

2 files changed

+41
-47
lines changed

src/ChatInputArea/mobile/ChatInputArea.tsx

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ import {
1717
import { Flexbox } from 'react-layout-kit';
1818

1919
import ActionIcon from '@/ActionIcon';
20-
import MobileSafeArea from '@/MobileSafeArea';
2120

2221
import ChatInputAreaInner, { type ChatInputAreaInnerProps } from '../ChatInputAreaInner';
2322

2423
const useStyles = createStyles(({ css, token }) => {
2524
return {
2625
container: css`
26+
flex: none;
2727
padding-block: 12px 12px;
2828
background: ${token.colorFillQuaternary};
2929
border-block-start: 1px solid ${rgba(token.colorBorder, 0.25)};
@@ -51,7 +51,6 @@ const useStyles = createStyles(({ css, token }) => {
5151
export interface MobileChatInputAreaProps extends ChatInputAreaInnerProps {
5252
bottomAddons?: ReactNode;
5353
expand?: boolean;
54-
safeArea?: boolean;
5554
setExpand?: (expand: boolean) => void;
5655
style?: CSSProperties;
5756
textAreaLeftAddons?: ReactNode;
@@ -74,7 +73,6 @@ const MobileChatInputArea = forwardRef<TextAreaRef, MobileChatInputAreaProps>(
7473
onInput,
7574
loading,
7675
value,
77-
safeArea,
7876
},
7977
ref,
8078
) => {
@@ -114,51 +112,46 @@ const MobileChatInputArea = forwardRef<TextAreaRef, MobileChatInputAreaProps>(
114112
const showAddons = !expand && !isFocused;
115113

116114
return (
117-
<Flexbox>
115+
<Flexbox
116+
className={cx(styles.container, expand && styles.expand, className)}
117+
gap={12}
118+
style={style}
119+
>
120+
{topAddons && <Flexbox style={showAddons ? {} : { display: 'none' }}>{topAddons}</Flexbox>}
118121
<Flexbox
119-
className={cx(styles.container, expand && styles.expand, className)}
120-
gap={12}
121-
style={style}
122+
className={cx(expand && styles.expand)}
123+
ref={containerRef}
124+
style={{ position: 'relative' }}
122125
>
123-
{topAddons && (
124-
<Flexbox style={showAddons ? {} : { display: 'none' }}>{topAddons}</Flexbox>
125-
)}
126-
<Flexbox
127-
className={cx(expand && styles.expand)}
128-
ref={containerRef}
129-
style={{ position: 'relative' }}
130-
>
131-
{showFullscreen && (
132-
<ActionIcon
133-
active
134-
className={styles.expandButton}
135-
icon={expand ? ChevronDown : ChevronUp}
136-
onClick={() => setExpand?.(!expand)}
137-
size={{ blockSize: 24, borderRadius: '50%', fontSize: 14 }}
138-
style={expand ? { top: 6 } : {}}
139-
/>
140-
)}
141-
<InnerContainer>
142-
<ChatInputAreaInner
143-
autoSize={expand ? false : { maxRows: 6, minRows: 0 }}
144-
className={cx(expand && styles.expandTextArea)}
145-
loading={loading}
146-
onBlur={() => setIsFocused(false)}
147-
onFocus={() => setIsFocused(true)}
148-
onInput={onInput}
149-
onSend={onSend}
150-
ref={ref}
151-
style={{ height: 36, paddingBlock: 6 }}
152-
type={expand ? 'pure' : 'block'}
153-
value={value}
154-
/>
155-
</InnerContainer>
156-
</Flexbox>
157-
{bottomAddons && (
158-
<Flexbox style={showAddons ? {} : { display: 'none' }}>{bottomAddons}</Flexbox>
126+
{showFullscreen && (
127+
<ActionIcon
128+
active
129+
className={styles.expandButton}
130+
icon={expand ? ChevronDown : ChevronUp}
131+
onClick={() => setExpand?.(!expand)}
132+
size={{ blockSize: 24, borderRadius: '50%', fontSize: 14 }}
133+
style={expand ? { top: 6 } : {}}
134+
/>
159135
)}
136+
<InnerContainer>
137+
<ChatInputAreaInner
138+
autoSize={expand ? false : { maxRows: 6, minRows: 0 }}
139+
className={cx(expand && styles.expandTextArea)}
140+
loading={loading}
141+
onBlur={() => setIsFocused(false)}
142+
onFocus={() => setIsFocused(true)}
143+
onInput={onInput}
144+
onSend={onSend}
145+
ref={ref}
146+
style={{ height: 36, paddingBlock: 6 }}
147+
type={expand ? 'pure' : 'block'}
148+
value={value}
149+
/>
150+
</InnerContainer>
160151
</Flexbox>
161-
{safeArea && !isFocused && <MobileSafeArea position={'bottom'} />}
152+
{bottomAddons && (
153+
<Flexbox style={showAddons ? {} : { display: 'none' }}>{bottomAddons}</Flexbox>
154+
)}
162155
</Flexbox>
163156
);
164157
},

src/MobileTabBar/style.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ export const useStyles = createStyles(({ css, token }) => {
77
color: ${token.colorPrimary};
88
`,
99
container: css`
10+
user-select: none;
11+
1012
overflow: hidden;
1113
flex: none;
12-
user-select: none;
1314
1415
width: 100vw;
1516
@@ -31,16 +32,16 @@ export const useStyles = createStyles(({ css, token }) => {
3132
cursor: pointer;
3233
width: 48px;
3334
height: 48px;
34-
color: ${token.colorTextSecondary};
35+
color: ${token.colorTextDescription};
3536
`,
3637
title: css`
3738
overflow: hidden;
3839
3940
width: 100%;
41+
margin-block-start: -0.125em;
4042
4143
font-size: 12px;
4244
line-height: 1.125em;
43-
margin-top: -0.125em;
4445
text-align: center;
4546
text-overflow: ellipsis;
4647
white-space: nowrap;

0 commit comments

Comments
 (0)