-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from kaleido-io/misc-tweaks
Adding Batches, Groups, Approvals, Namespaces pages and other tweaks
- Loading branch information
Showing
77 changed files
with
2,577 additions
and
374 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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,24 @@ | ||
import { Download } from '@mui/icons-material'; | ||
import { IconButton } from '@mui/material'; | ||
import { downloadJsonString } from '../../utils'; | ||
|
||
interface Props { | ||
filename: string; | ||
jsonString: string; | ||
} | ||
|
||
export const DownloadJsonButton: React.FC<Props> = ({ | ||
filename, | ||
jsonString, | ||
}) => { | ||
return ( | ||
<IconButton | ||
onClick={(e) => { | ||
e.stopPropagation(); | ||
downloadJsonString(jsonString, filename); | ||
}} | ||
> | ||
<Download /> | ||
</IconButton> | ||
); | ||
}; |
This file contains 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,17 @@ | ||
import { ArrowForward } from '@mui/icons-material'; | ||
import { IconButton } from '@mui/material'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
interface Props { | ||
link: string; | ||
} | ||
|
||
export const FFArrowButton: React.FC<Props> = ({ link }) => { | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<IconButton onClick={() => navigate(link)}> | ||
<ArrowForward /> | ||
</IconButton> | ||
); | ||
}; |
This file contains 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,41 @@ | ||
import { Launch } from '@mui/icons-material'; | ||
import { IconButton } from '@mui/material'; | ||
import { useContext } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { ApplicationContext } from '../../contexts/ApplicationContext'; | ||
import { FF_NAV_PATHS } from '../../interfaces'; | ||
import { FFColors } from '../../theme'; | ||
|
||
type Props = { | ||
did?: string; | ||
nodeID?: string; | ||
}; | ||
|
||
const getDIDNavURL = (did: string, ns: string) => { | ||
if (did.startsWith('did:firefly:org')) { | ||
return FF_NAV_PATHS.networkOrgsPath(ns, did); | ||
} else if (did.startsWith('did:firefly:node')) { | ||
return FF_NAV_PATHS.networkNodesPath(ns, did); | ||
} | ||
|
||
return FF_NAV_PATHS.networkIdentitiesPath(ns, did); | ||
}; | ||
|
||
export const IdentityButton: React.FC<Props> = ({ did, nodeID }) => { | ||
const { selectedNamespace } = useContext(ApplicationContext); | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<IconButton | ||
sx={{ backgroundColor: FFColors.Purple }} | ||
onClick={(e) => { | ||
e.stopPropagation(); | ||
did | ||
? navigate(getDIDNavURL(did, selectedNamespace)) | ||
: navigate(FF_NAV_PATHS.networkNodesPath(selectedNamespace, nodeID)); | ||
}} | ||
> | ||
<Launch /> | ||
</IconButton> | ||
); | ||
}; |
This file contains 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,16 +1,22 @@ | ||
import { Launch } from '@mui/icons-material'; | ||
import { IconButton, Link } from '@mui/material'; | ||
import { IconButton } from '@mui/material'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { FFColors } from '../../theme'; | ||
|
||
interface Props { | ||
link: string; | ||
noColor?: boolean; | ||
} | ||
|
||
export const LaunchButton: React.FC<Props> = ({ link }) => { | ||
export const LaunchButton: React.FC<Props> = ({ link, noColor = false }) => { | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<Link href={`/ui${link}`} underline="always"> | ||
<IconButton> | ||
<Launch /> | ||
</IconButton> | ||
</Link> | ||
<IconButton | ||
sx={{ backgroundColor: noColor ? undefined : FFColors.Purple }} | ||
onClick={() => navigate(link)} | ||
> | ||
<Launch /> | ||
</IconButton> | ||
); | ||
}; |
This file contains 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.