Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
"typescript.suggest.paths": true,
"typescript.suggest.enabled": true,
"typescript.suggest.completeFunctionCalls": true,
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { cssObj } from '@fuel-ui/css';
import { Box, Text } from '@fuel-ui/react';
import { useState } from 'react';
import { MotionStack, animations } from '~/systems/Core';

type NetworkStatusProps = {
isVisible?: boolean;
};

type NetworkStatus = 'busy' | 'normal';

export const NetworkStatus = ({ isVisible = false }: NetworkStatusProps) => {
const [status, _setStatus] = useState<NetworkStatus>('normal');
return (
<MotionStack
{...animations.slideInRight()}
style={{ visibility: isVisible ? 'visible' : 'hidden' }}
>
<Box css={styles.bar}>
<Text css={styles.title}>Status:</Text>
<Box>
<Box css={status === 'normal' ? styles.normal : styles.busy} />
</Box>
</Box>
</MotionStack>
);
};

const styles = {
title: cssObj({
pt: '$2',
color: '$intentsBase12',
lineHeight: '$none',
}),
busy: cssObj({
width: '$3',
height: '$3',
backgroundColor: '$scalesRed9',
borderRadius: '$full',
alignItems: 'center',
}),
normal: cssObj({
width: '$3',
height: '$3',
backgroundColor: '$scalesGreen9',
borderRadius: '$full',
alignItems: 'center',
}),
bar: cssObj({
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
gap: '$2',
}),
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './NetworkStatus';
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { cssObj } from '@fuel-ui/css';
import { Alert, Box, Form, Input, Text } from '@fuel-ui/react';
import { Alert, Box, Form, HStack, Input, Text } from '@fuel-ui/react';
import { motion } from 'framer-motion';
import { type BN, bn } from 'fuels';
import { useEffect, useMemo, useRef, useState } from 'react';
import { AssetSelect } from '~/systems/Asset';

import {
ControlledField,
Layout,
Expand All @@ -16,6 +17,7 @@ import { useController, useWatch } from 'react-hook-form';
import { InputAmount } from '~/systems/Core/components/InputAmount/InputAmount';
import { TxFeeOptions } from '~/systems/Transaction/components/TxFeeOptions/TxFeeOptions';
import type { UseSendReturn } from '../../hooks';
import { NetworkStatus } from '../NetworkStatus';

const MotionContent = motion(Layout.Content);

Expand Down Expand Up @@ -198,9 +200,12 @@ export function SendSelect({
regularTip &&
fastTip && (
<MotionStack {...animations.slideInTop()} gap="$3">
<Text as="span" css={styles.title}>
Fee (network)
</Text>
<HStack gap="$3" style={styles.feeBar}>
<Text as="span" css={styles.title}>
Fee (network)
</Text>
<NetworkStatus />
</HStack>
<TxFeeOptions
initialAdvanced={false}
baseFee={baseFee}
Expand Down Expand Up @@ -255,4 +260,9 @@ const styles = {
color: '$intentsWarning8',
marginTop: '$2',
}),
feeBar: cssObj({
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}),
};