Skip to content

Commit f22cb0d

Browse files
committed
frontend: refactor message and remove small and title props
Title was never used, and small only in one place (Send) for the noFeeTargets warning message. Replaced small font in send View by using `<label>` element (most other text elements use Label element on that page, so it shows the smaller font size. Tested by patching the api endpoint with: ```diff diff --git a/frontends/web/src/api/account.ts b/frontends/web/src/api/account.ts index cbef324..2d26f3347 100644 --- a/frontends/web/src/api/account.ts +++ b/frontends/web/src/api/account.ts @@ -20,6 +20,7 @@ import type { TDetailStatus } from './bitsurance'; import type { SuccessResponse } from './response'; import type { NonEmptyArray } from '@/utils/types'; import { apiGet, apiPost } from '@/utils/request'; +// import { FeeTargets } from '@/routes/account/send/feetargets'; export type NativeCoinCode = 'btc' | 'tbtc' | 'rbtc' | 'ltc' | 'tltc' | 'eth' | 'sepeth'; @@ -379,7 +380,7 @@ export type TFeeTargetList = { }; export const getFeeTargetList = (code: AccountCode): Promise<TFeeTargetList> => { - return apiGet(`account/${code}/fee-targets`); + return apiGet(`account/${code}/fee-targets`).then(() => ({ defaultFeeTarget: 'custom', feeTargets: [] })); }; ```
1 parent 3e4fc1f commit f22cb0d

File tree

3 files changed

+4
-30
lines changed

3 files changed

+4
-30
lines changed

frontends/web/src/components/message/message.module.css

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,6 @@
1818
width: 100%;
1919
}
2020

21-
.message .title {
22-
margin: 0 0 var(--spacing-half) 0;
23-
}
24-
25-
@media (max-width: 768px) {
26-
.message {
27-
--size-default: 14px
28-
}
29-
.message .title {
30-
--size-subheader: 18px;
31-
}
32-
}
33-
34-
.message.small {
35-
flex-shrink: 1;
36-
font-size: var(--size-default);
37-
}
38-
3921
.message img {
4022
margin-right: 4px;
4123
max-width: 30px;

frontends/web/src/components/message/message.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ const MessageIcon = ({ type, icon }: TMessageIconProps) => {
5252
type MessageProps = {
5353
className?: string;
5454
hidden?: boolean;
55-
small?: boolean;
56-
title?: string;
5755
type?: TMessageTypes;
5856
icon?: ReactNode;
5957
noIcon?: boolean;
@@ -63,8 +61,6 @@ type MessageProps = {
6361
export const Message = ({
6462
className = '',
6563
hidden,
66-
small,
67-
title,
6864
type = 'info',
6965
icon,
7066
noIcon = false,
@@ -76,16 +72,10 @@ export const Message = ({
7672
return (
7773
<div className={`
7874
${styles[type] || ''}
79-
${small && styles.small || ''}
8075
${className || ''}
8176
`.trim()}>
8277
{!noIcon && <MessageIcon type={type} icon={icon} />}
8378
<div className={styles.content}>
84-
{title && (
85-
<h2 className={`subTitle ${styles.title || ''}`}>
86-
{title}
87-
</h2>
88-
)}
8979
{children}
9080
</div>
9181
</div>

frontends/web/src/routes/account/send/feetargets.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,10 @@ export const FeeTargets = ({
193193
) : (
194194
<div className={style.rowCustomFee}>
195195
{ noFeeTargets ? (
196-
<Message small type="warning">
197-
{t('send.noFeeTargets')}
196+
<Message type="warning">
197+
<label>
198+
{t('send.noFeeTargets')}
199+
</label>
198200
</Message>
199201
) : null }
200202
<div className={style.column}>

0 commit comments

Comments
 (0)