-
Notifications
You must be signed in to change notification settings - Fork 4
style: implement Overview design #31
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
scorebreaker
wants to merge
2
commits into
opendexnetwork:main
Choose a base branch
from
scorebreaker:design-overview
base: main
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 all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,47 +1,91 @@ | ||
import { Divider, Grid, makeStyles } from "@material-ui/core"; | ||
import FileCopyOutlinedIcon from "@material-ui/icons/FileCopyOutlined"; | ||
import { Grid, makeStyles } from "@material-ui/core"; | ||
import React, { ReactElement } from "react"; | ||
import { copyToClipboard } from "../../utils/appUtil"; | ||
import IconButton from "../input/buttons/IconButton"; | ||
import { copyIcon } from "../../../common/utils/svgIcons"; | ||
import ButtonBase from "@material-ui/core/ButtonBase"; | ||
|
||
type LabeledRowProps = { | ||
label: string; | ||
value: string | number; | ||
paddingSpacing?: number; | ||
showCopyIcon?: boolean; | ||
padding?: string; | ||
reserveSpaceForCopyIcon?: boolean; | ||
statusIcon?: string; | ||
}; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
const useStyles = makeStyles(() => ({ | ||
cell: (props: LabeledRowProps) => ({ | ||
padding: theme.spacing(props.paddingSpacing ?? 2), | ||
textAlign: "center", | ||
padding: props.padding ? props.padding : "15px 40px", | ||
wordWrap: "break-word", | ||
whiteSpace: "pre-wrap", | ||
fontSize: "16px", | ||
}), | ||
textLabel: { | ||
color: "#979797", | ||
}, | ||
textValue: { | ||
color: "#f2f2f2", | ||
}, | ||
copyIcon: { | ||
paddingRight: "5px", | ||
}, | ||
copyContainer: { | ||
cursor: "pointer", | ||
color: "#f15a24", | ||
fontSize: "14px", | ||
display: "flex", | ||
justifyContent: "flex-end", | ||
}, | ||
statusContainer: { | ||
display: "flex", | ||
alignItems: "center", | ||
}, | ||
statusIcon: { | ||
marginRight: "10px", | ||
}, | ||
})); | ||
|
||
const LabeledRow = (props: LabeledRowProps): ReactElement => { | ||
const { label, value, showCopyIcon, reserveSpaceForCopyIcon } = props; | ||
const classes = useStyles(props); | ||
|
||
return ( | ||
<Grid container item justify="space-between" alignItems="center"> | ||
<Grid item xs={reserveSpaceForCopyIcon ? 3 : 4} className={classes.cell}> | ||
<Grid container item alignItems="center"> | ||
<Grid | ||
item | ||
xs={reserveSpaceForCopyIcon ? 2 : 3} | ||
className={`${classes.cell} ${classes.textLabel}`} | ||
> | ||
{label} | ||
</Grid> | ||
<Divider orientation="vertical" flexItem /> | ||
<Grid item xs={reserveSpaceForCopyIcon ? 6 : 7} className={classes.cell}> | ||
{value} | ||
|
||
<Grid | ||
item | ||
xs={reserveSpaceForCopyIcon ? 6 : 7} | ||
className={`${classes.cell} ${classes.textValue}`} | ||
> | ||
{props.statusIcon ? ( | ||
<div className={classes.statusContainer}> | ||
<img | ||
src={props.statusIcon} | ||
className={classes.statusIcon} | ||
alt="status" | ||
/> | ||
{value} | ||
</div> | ||
) : ( | ||
<div>{value}</div> | ||
)} | ||
</Grid> | ||
{reserveSpaceForCopyIcon && ( | ||
<Grid item xs={2} className={classes.cell}> | ||
{showCopyIcon && ( | ||
<IconButton | ||
icon={<FileCopyOutlinedIcon fontSize="small" />} | ||
tooltipTitle="Copy to clipboard" | ||
onClick={() => copyToClipboard(value)} | ||
/> | ||
<div className={classes.copyContainer}> | ||
<ButtonBase onClick={() => copyToClipboard(value)}> | ||
<img src={copyIcon} alt="copy" className={classes.copyIcon} /> | ||
Copy | ||
</ButtonBase> | ||
</div> | ||
Comment on lines
+83
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The icon seems a bit off in two ways:
|
||
)} | ||
</Grid> | ||
)} | ||
|
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,47 @@ | ||
import React, { ReactElement } from "react"; | ||
import { Icon } from "@material-ui/core"; | ||
import { makeStyles } from "@material-ui/core"; | ||
import { notificationIcon } from "../../../utils/svgIcons"; | ||
|
||
type PageTitleProps = { | ||
title: string; | ||
}; | ||
|
||
const useStyles = makeStyles(() => ({ | ||
headingContainer: { | ||
display: "flex", | ||
alignItems: "center", | ||
}, | ||
heading: { | ||
fontSize: "30px", | ||
fontWeight: 500, | ||
}, | ||
notificationIconContainer: { | ||
marginLeft: "auto", | ||
}, | ||
notificationIcon: { | ||
cursor: "pointer", | ||
}, | ||
})); | ||
|
||
const PageTitle = (props: PageTitleProps): ReactElement => { | ||
const { title } = props; | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<div className={classes.headingContainer}> | ||
<h1 className={classes.heading}>{title}</h1> | ||
{false && ( | ||
<Icon className={classes.notificationIconContainer}> | ||
<img | ||
src={notificationIcon} | ||
alt="notifications" | ||
className={classes.notificationIcon} | ||
/> | ||
</Icon> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default PageTitle; |
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 |
---|---|---|
@@ -1,3 +1,21 @@ | ||
import openDexLogo from "../../assets/OpenDEXLogo.svg"; | ||
import expandIcon from "../../assets/icon-expand.svg"; | ||
import readyIcon from "../../assets/icon-ready.svg"; | ||
import syncingIcon from "../../assets/icon-syncing.svg"; | ||
import copyIcon from "../../assets/icon-copy.svg"; | ||
import notificationIcon from "../../assets/icon-notification.svg"; | ||
import notificationActiveIcon from "../../assets/icon-notification-active.svg"; | ||
import downloadIcon from "../../assets/icon-download-log.svg"; | ||
import collapseIcon from "../../assets/icon-collapse.svg"; | ||
|
||
export { openDexLogo }; | ||
export { | ||
openDexLogo, | ||
expandIcon, | ||
readyIcon, | ||
syncingIcon, | ||
copyIcon, | ||
notificationIcon, | ||
notificationActiveIcon, | ||
downloadIcon, | ||
collapseIcon, | ||
}; |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are button components in this project. Let's just use them in order to handle consistent style throughout the project.