Skip to content

Commit fab6678

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 fb9a3ae commit fab6678

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@
2222
margin: 0 0 var(--spacing-half) 0;
2323
}
2424

25-
@media (max-width: 768px) {
26-
.message {
27-
--size-default: 1.4rem;
28-
}
29-
.message .title {
30-
--size-subheader: 1.8rem;
31-
}
32-
}
33-
3425
.message.small {
3526
flex-shrink: 1;
3627
font-size: var(--size-default);

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)