Skip to content

Commit

Permalink
chore: fix some issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaaru committed Dec 18, 2023
1 parent 1e46939 commit d53f73b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
7 changes: 6 additions & 1 deletion components/common/IconStatus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ function IconStatus(props: PropsType) {

return (
<>
<StatusIcon size="1.25rem" className={`${hasTitle ? 'mr-5' : ''}`} />
<StatusIcon
size="1.25rem"
className={`${title === 'Running' ? 'animate-spin' : ''} ${
hasTitle ? 'mr-5' : ''
}`}
/>
{hasTitle && <div className={`text-14 md:text-16 ${color}`}>{title}</div>}
</>
);
Expand Down
13 changes: 4 additions & 9 deletions components/common/Table/cells/TokenCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function TokenCell(props: CellProps) {
column.tokenType === 'destination'
? lastStep?.toToken
: firstStep?.fromToken;
const amount = token?.realAmount ? token.realAmount : token?.expectedAmount;

const { blockchain, blockchainLogo, logo, name, symbol } = token || {};

Expand Down Expand Up @@ -41,19 +40,15 @@ function TokenCell(props: CellProps) {
<div className="text-14 leading-14 md:leading-16 md:text-16 flex items-center">
<span
className={`mr-5 ${
column.tokenType === 'source'
? 'text-primary-500'
: 'text-neutral-400'
token?.realAmount ? 'text-primary-500' : 'text-neutral-400'
}`}>
{`${column.tokenType === 'destination' ? '~' : ''}${parseFloat(
Number(amount).toFixed(3),
{`${!token?.realAmount ? '~' : ''}${parseFloat(
Number(token?.realAmount || token?.expectedAmount).toFixed(3),
)}`}
</span>
<span
className={`${
column.tokenType === 'source'
? 'text-primary-500'
: 'text-neutral-400'
token?.realAmount ? 'text-primary-500' : 'text-neutral-400'
}`}>
{symbol || name}
</span>
Expand Down
1 change: 1 addition & 0 deletions components/common/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import TableBody from './TableBody';

function Table(props: TableProps) {
const { data } = props;

return (
<div className="w-full">
<TableHead />
Expand Down
21 changes: 8 additions & 13 deletions components/home/ChartBox/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Tooltip,
} from '@visx/xychart';
import { customTheme, daysFilter, getDayOfMonth } from './Chart.helper';
import dayjs from 'dayjs';
import { CustomTick } from './CustomTick';
import { ChartProps } from './Chart.type';
import isMobile from 'is-mobile';
Expand Down Expand Up @@ -97,20 +96,16 @@ const Chart = (props: ChartProps) => {
<Tooltip
snapTooltipToDatumX
snapTooltipToDatumY
showVerticalCrosshair
showDatumGlyph
applyPositionStyle={true}
style={{
background: 'transparent',
}}
unstyled={false}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
renderTooltip={({ tooltipData }: any) => (
<div className="text-12">
<div className="mb-1">Swaps</div>

<div className="mb-1">
{dayjs(
tooltipData.nearestDatum.datum.date.split('T')[0],
).format('dddd, YYYY MMMM DD')}
</div>
<div className="mb-1">
Count: {tooltipData.nearestDatum.datum.count}
</div>
<div className="bg-tooltipBackground px-[8px] py-[4px] rounded-[8px] text-baseForeground text-12">
{tooltipData.nearestDatum.datum.count}
</div>
)}
/>
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ module.exports = {
backgroundRunning: '#C8E2FF',
failed: '#FF3B3B',
backgroundFailed: '#FFD7D7',
tooltipBackground: '#2B3462',

primary: {
500: '#010101',
Expand Down

0 comments on commit d53f73b

Please sign in to comment.