-
Notifications
You must be signed in to change notification settings - Fork 172
feat(explorer): show network costs and protocol fee breakdown on order details #7588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jmg-duarte
wants to merge
17
commits into
develop
Choose a base branch
from
jmgd/ucp
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
90b75e9
feat(explorer): show network costs and protocol fee breakdown on orde…
jmg-duarte 352c1de
fix: address Rabbit comments
jmg-duarte 4328749
fix: address comments from alfetopito
jmg-duarte 3a6077f
Merge branch 'develop' into jmgd/ucp
fairlighteth 187cb69
fix: update the sdk
jmg-duarte 9a1505b
fix: leverage new SDK version
jmg-duarte 285c309
Merge remote-tracking branch 'origin/jmgd/ucp' into jmgd/ucp
jmg-duarte 1179936
fix: ci + coderabbit review
jmg-duarte 5a94bd3
Merge branch 'develop' into jmgd/ucp
fairlighteth ea8bf5d
fix: remove dead code
jmg-duarte 7259337
Merge remote-tracking branch 'origin/jmgd/ucp' into jmgd/ucp
jmg-duarte e48a737
fix(explorer): derive protocol fee breakdown from all trades, not the…
jmg-duarte 8328207
Merge branch 'develop' into jmgd/ucp
fairlighteth 55c36b9
feat(explorer): label volume fees with bps and tidy fee breakdown
jmg-duarte eccec6d
Merge branch 'main' into jmgd/ucp
jmg-duarte b45138b
Merge branch 'develop' into jmgd/ucp
jmg-duarte 2e8419a
fix: address reviews
jmg-duarte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
apps/explorer/src/components/orders/NumbersBreakdown/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { PropsWithChildren, ReactNode } from 'react' | ||
|
|
||
| import { Media } from '@cowprotocol/ui' | ||
|
|
||
| import { ShowMoreButton } from 'components/common/ShowMoreButton' | ||
| import useSafeState from 'hooks/useSafeState' | ||
| import styled from 'styled-components/macro' | ||
|
|
||
| const DetailsWrapper = styled.div` | ||
| display: flex; | ||
| margin: 1.8rem 0 1rem; | ||
| border-radius: 0.6rem; | ||
| line-height: 1.6; | ||
| width: max-content; | ||
| align-items: flex-start; | ||
| word-break: break-all; | ||
| overflow: auto; | ||
| border: 1px solid rgb(151 151 184 / 10%); | ||
| background: rgb(151 151 184 / 10%); | ||
|
|
||
| ${Media.upToSmall()} { | ||
| width: 100%; | ||
| } | ||
|
|
||
| table { | ||
| width: 100%; | ||
| border-collapse: collapse; | ||
| } | ||
|
|
||
| td { | ||
| padding: 0.1rem 0.5rem; | ||
| } | ||
|
|
||
| tr:not(:last-child) td { | ||
| border-bottom: 1px solid rgb(151 151 184 / 15%); | ||
| } | ||
| ` | ||
|
|
||
| type BreakdownProps = { | ||
| showExpanded?: boolean | ||
| } & PropsWithChildren | ||
|
|
||
| export const NumbersBreakdown = ({ children, showExpanded = false }: BreakdownProps): ReactNode => { | ||
| const [showDetails, setShowDetails] = useSafeState<boolean>(showExpanded) | ||
|
|
||
| const handleToggle = (): void => { | ||
| setShowDetails(!showDetails) | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| <ShowMoreButton onClick={handleToggle}>{showDetails ? '[-] Show less' : '[+] Show more'}</ShowMoreButton> | ||
| {showDetails && <DetailsWrapper>{children}</DetailsWrapper>} | ||
| </> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.