-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/add-delegation-search
- Loading branch information
Showing
24 changed files
with
483 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export interface ISlotRequest { | ||
/** | ||
* The network to search on. | ||
*/ | ||
network: string; | ||
|
||
/** | ||
* The slot index to get the details for. | ||
*/ | ||
slotIndex: string; | ||
} |
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,10 @@ | ||
// eslint-disable-next-line import/no-unresolved | ||
import { SlotCommitment } from "@iota/sdk-nova"; | ||
import { IResponse } from "./IResponse"; | ||
|
||
export interface ISlotResponse extends IResponse { | ||
/** | ||
* The deserialized slot. | ||
*/ | ||
slot?: SlotCommitment; | ||
} |
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,30 @@ | ||
import { ServiceFactory } from "../../../factories/serviceFactory"; | ||
import { ISlotRequest } from "../../../models/api/nova/ISlotRequest"; | ||
import { ISlotResponse } from "../../../models/api/nova/ISlotResponse"; | ||
import { IConfiguration } from "../../../models/configuration/IConfiguration"; | ||
import { NOVA } from "../../../models/db/protocolVersion"; | ||
import { NetworkService } from "../../../services/networkService"; | ||
import { NovaApiService } from "../../../services/nova/novaApiService"; | ||
import { ValidationHelper } from "../../../utils/validationHelper"; | ||
|
||
/** | ||
* Fetch the block from the network. | ||
* @param _ The configuration. | ||
* @param request The request. | ||
* @returns The response. | ||
*/ | ||
export async function get(_: IConfiguration, request: ISlotRequest): Promise<ISlotResponse> { | ||
const networkService = ServiceFactory.get<NetworkService>("network"); | ||
const networks = networkService.networkNames(); | ||
ValidationHelper.oneOf(request.network, networks, "network"); | ||
ValidationHelper.numberFromString(request.slotIndex, "slotIndex"); | ||
|
||
const networkConfig = networkService.get(request.network); | ||
|
||
if (networkConfig.protocolVersion !== NOVA) { | ||
return {}; | ||
} | ||
|
||
const novaApiService = ServiceFactory.get<NovaApiService>(`api-service-${networkConfig.network}`); | ||
return novaApiService.getSlotCommitment(Number(request.slotIndex)); | ||
} |
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,30 @@ | ||
import React from "react"; | ||
import classNames from "classnames"; | ||
import TruncatedId from "../stardust/TruncatedId"; | ||
|
||
export interface IPageDataRow { | ||
label: string; | ||
value?: string | number; | ||
highlight?: boolean; | ||
truncatedId?: { | ||
id: string; | ||
link?: string; | ||
showCopyButton?: boolean; | ||
}; | ||
} | ||
const PageDataRow = ({ label, value, truncatedId, highlight }: IPageDataRow): React.JSX.Element => { | ||
return ( | ||
<div className="section--data"> | ||
<div className="label">{label}</div> | ||
<div className={classNames("value code", { highlight })}> | ||
{truncatedId ? ( | ||
<TruncatedId id={truncatedId.id} link={truncatedId.link} showCopyButton={truncatedId.showCopyButton} /> | ||
) : ( | ||
value | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PageDataRow; |
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 "./../../../scss/fonts"; | ||
@import "./../../../scss/mixins"; | ||
@import "./../../../scss/media-queries"; | ||
@import "./../../../scss/variables"; | ||
|
||
.status-pill { | ||
@include font-size(12px); | ||
|
||
display: flex; | ||
align-items: center; | ||
margin-right: 8px; | ||
padding: 6px 12px; | ||
border: 0; | ||
border-radius: 6px; | ||
outline: none; | ||
color: $gray-midnight; | ||
font-family: $inter; | ||
font-weight: 500; | ||
letter-spacing: 0.5px; | ||
white-space: nowrap; | ||
|
||
@include phone-down { | ||
height: 32px; | ||
} | ||
|
||
&.status__ { | ||
&success { | ||
background-color: var(--message-confirmed-bg); | ||
color: $mint-green-7; | ||
} | ||
|
||
&error { | ||
background-color: var(--message-conflicting-bg); | ||
} | ||
|
||
&pending { | ||
background-color: var(--light-bg); | ||
color: #8493ad; | ||
} | ||
} | ||
} |
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,42 @@ | ||
import classNames from "classnames"; | ||
import React from "react"; | ||
import { PillStatus } from "~/app/lib/ui/enums"; | ||
import Tooltip from "../Tooltip"; | ||
import "./StatusPill.scss"; | ||
|
||
interface IStatusPill { | ||
/** | ||
* Label for the status. | ||
*/ | ||
label: string; | ||
/** | ||
* The status of the pill. | ||
*/ | ||
status: PillStatus; | ||
/** | ||
* Tooltip explaining further for the label. | ||
*/ | ||
tooltip?: string; | ||
} | ||
|
||
const StatusPill: React.FC<IStatusPill> = ({ label, status, tooltip }): React.JSX.Element => ( | ||
<> | ||
<div | ||
className={classNames("status-pill", { | ||
status__success: status === PillStatus.Success, | ||
status__error: status === PillStatus.Error, | ||
status__pending: status === PillStatus.Pending, | ||
})} | ||
> | ||
{tooltip ? ( | ||
<Tooltip tooltipContent={tooltip}> | ||
<span className="capitalize-text">{status}</span> | ||
</Tooltip> | ||
) : ( | ||
<span className="capitalize-text">{label}</span> | ||
)} | ||
</div> | ||
</> | ||
); | ||
|
||
export default StatusPill; |
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
42 changes: 0 additions & 42 deletions
42
client/src/app/components/nova/block/section/TransactionMetadataSection.scss
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.