Skip to content

Commit cb3153d

Browse files
committed
feat(neuron-ui): disable fadein animation on details list
1 parent 5fa5af5 commit cb3153d

4 files changed

Lines changed: 29 additions & 1 deletion

File tree

packages/neuron-ui/src/components/Addresses/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { StateWithDispatch } from 'states/stateProvider/reducer'
1717
import { useLocalDescription } from 'utils/hooks'
1818
import { MIN_CELL_WIDTH, Routes } from 'utils/const'
1919
import { localNumberFormatter, shannonToCKBFormatter } from 'utils/formatters'
20+
import { onRenderRow } from 'utils/fabricUIRender'
2021

2122
const Addresses = ({
2223
app: {
@@ -180,6 +181,7 @@ const Addresses = ({
180181
contextMenu({ type: 'addressList', id: item.identifier })
181182
}}
182183
className="listWithDesc"
184+
onRenderRow={onRenderRow}
183185
/>
184186
)
185187
}

packages/neuron-ui/src/components/Overview/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,14 @@ const Overview = ({
103103

104104
const onTransactionRowRender = useCallback((props?: IDetailsRowProps) => {
105105
if (props) {
106-
const customStyles: Partial<IDetailsRowStyles> = {}
106+
const customStyles: Partial<IDetailsRowStyles> = {
107+
root: {
108+
animationDuration: '0!important',
109+
},
110+
}
107111
if (props.item.status === 'failed') {
108112
customStyles.root = {
113+
animationDuration: '0!important',
109114
color: 'red',
110115
}
111116
}

packages/neuron-ui/src/components/TransactionList/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { contextMenu, showTransactionDetails } from 'services/remote'
1717

1818
import { useLocalDescription } from 'utils/hooks'
1919
import { shannonToCKBFormatter, uniformTimeFormatter as timeFormatter, uniformTimeFormatter } from 'utils/formatters'
20+
import { onRenderRow } from 'utils/fabricUIRender'
2021

2122
const theme = getTheme()
2223

@@ -212,6 +213,7 @@ const TransactionList = ({
212213
}
213214
}}
214215
className="listWithDesc"
216+
onRenderRow={onRenderRow}
215217
/>
216218
)
217219
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react'
2+
import { DetailsRow, IDetailsRowProps } from 'office-ui-fabric-react'
3+
4+
export const onRenderRow = (rowProps?: IDetailsRowProps) => {
5+
return rowProps ? (
6+
<DetailsRow
7+
{...rowProps}
8+
styles={{
9+
root: {
10+
animationDuration: '0!important',
11+
},
12+
}}
13+
/>
14+
) : null
15+
}
16+
17+
export default {
18+
onRenderRow,
19+
}

0 commit comments

Comments
 (0)