Skip to content

Commit ba45c39

Browse files
committed
ROFL App details card
1 parent e512514 commit ba45c39

7 files changed

Lines changed: 11 additions & 19 deletions

File tree

src/app/components/Account/AccountLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FC, ReactNode } from 'react'
22
import { Link as RouterLink } from 'react-router-dom'
33
import { useScreenSize } from '../../hooks/useScreensize'
4+
import { Link } from '@oasisprotocol/ui-library/src/components/link'
45
import { RouteUtils } from '../../utils/route-utils'
56
import InfoIcon from '@mui/icons-material/Info'
67
import { SearchScope } from '../../../types/searchScope'
@@ -13,7 +14,6 @@ import { AdaptiveHighlightedText } from '../HighlightedText/AdaptiveHighlightedT
1314
import { AdaptiveTrimmer } from '../AdaptiveTrimmer/AdaptiveTrimmer'
1415
import { AccountMetadataSourceIndicator } from './AccountMetadataSourceIndicator'
1516
import { WithHoverHighlighting } from '../HoverHighlightingContext/WithHoverHighlighting'
16-
import { Link } from '@oasisprotocol/ui-library/src/components/link'
1717

1818
const WithTypographyAndLink: FC<{
1919
scope: SearchScope

src/app/components/AdaptiveTrimmer/AdaptiveDynamicTrimmer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Box from '@mui/material/Box'
33
import InfoIcon from '@mui/icons-material/Info'
44
import { MaybeWithTooltip } from '../Tooltip/MaybeWithTooltip'
55
import { getAdaptiveId, ShorteningResult, useAdaptiveSizing } from './hooks'
6+
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
67

78
type AdaptiveDynamicTrimmerProps = {
89
/**
@@ -92,7 +93,7 @@ export const AdaptiveDynamicTrimmer: FC<AdaptiveDynamicTrimmerProps> = ({
9293
<Box component="span" ref={textRef} sx={{ maxWidth: '100%', overflowX: 'hidden' }}>
9394
<MaybeWithTooltip
9495
title={title}
95-
spanSx={{ textWrap: 'nowrap', whiteSpace: 'nowrap', opacity: isFinal ? 1 : 0 }}
96+
spanClassName={cn('whitespace-nowrap', isFinal ? 'opacity-100' : 'opacity-0')}
9697
>
9798
{currentContent}
9899
</MaybeWithTooltip>

src/app/components/StyledDescriptionList/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export const StyledDescriptionList = styled(InlineDescriptionList, {
5959
alignItems: 'start',
6060
},
6161
dd: {
62-
color: COLORS.brandExtraDark,
6362
overflowWrap: 'anywhere',
6463
alignItems: 'center',
6564
maxWidth: '100%',

src/app/components/Tooltip/MaybeWithTooltip.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { FC, ReactNode } from 'react'
22
import Tooltip from '@mui/material/Tooltip'
33
import Box from '@mui/material/Box'
4-
import { SxProps } from '@mui/material/styles'
54
import { useScreenSize } from '../../hooks/useScreensize'
65

76
type MaybeWithTooltipProps = {
@@ -15,7 +14,7 @@ type MaybeWithTooltipProps = {
1514
/**
1615
* Any extra styles to apply to the span
1716
*/
18-
spanSx?: SxProps
17+
spanClassName?: string
1918

2019
/**
2120
* The content to show
@@ -26,8 +25,9 @@ type MaybeWithTooltipProps = {
2625
/**
2726
* A component to display some content with or without a tooltip
2827
*/
29-
export const MaybeWithTooltip: FC<MaybeWithTooltipProps> = ({ title, children, spanSx }) => {
28+
export const MaybeWithTooltip: FC<MaybeWithTooltipProps> = ({ title, children, spanClassName }) => {
3029
const { isMobile } = useScreenSize()
30+
3131
return (
3232
<Tooltip
3333
placement="top"
@@ -49,9 +49,7 @@ export const MaybeWithTooltip: FC<MaybeWithTooltipProps> = ({ title, children, s
4949
disableHoverListener={!title}
5050
disableTouchListener={!title}
5151
>
52-
<Box component="span" sx={{ display: 'inline-flex', ...spanSx }}>
53-
{children}
54-
</Box>
52+
<span className={spanClassName}>{children}</span>
5553
</Tooltip>
5654
)
5755
}

src/app/components/Transactions/TransactionLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FC, ReactNode } from 'react'
22
import { Link as RouterLink } from 'react-router-dom'
3+
import { Link } from '@oasisprotocol/ui-library/src/components/link'
34
import InfoIcon from '@mui/icons-material/Info'
45
import { useScreenSize } from '../../hooks/useScreensize'
56
import { RouteUtils } from '../../utils/route-utils'
@@ -9,7 +10,6 @@ import { MaybeWithTooltip } from '../Tooltip/MaybeWithTooltip'
910
import { trimLongString } from '../../utils/trimLongString'
1011
import Box from '@mui/material/Box'
1112
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
12-
import { Link } from '@oasisprotocol/ui-library/src/components/link'
1313

1414
const WithTypographyAndLink: FC<{ children: ReactNode; mobile?: boolean; to: string }> = ({
1515
children,

src/app/pages/RoflAppDetailsPage/Enclaves.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import Typography from '@mui/material/Typography'
43
import { RoflAppPolicy } from '../../../oasis-nexus/api'
54
import { CopyToClipboard } from 'app/components/CopyToClipboard'
65

@@ -21,9 +20,7 @@ export const Enclaves: FC<EnclavesProps> = ({ policy }) => {
2120
{policy.enclaves.map((enclave: string) => (
2221
<tr key={enclave}>
2322
<td>
24-
<Typography variant="mono" component="span">
25-
{enclave}
26-
</Typography>
23+
<span className="font-medium">{enclave}</span>
2724
</td>
2825
<td>
2926
<CopyToClipboard value={enclave} />

src/app/pages/RoflAppDetailsPage/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useHref, useLoaderData } from 'react-router-dom'
33
import { useTranslation } from 'react-i18next'
44
import { Skeleton } from '@oasisprotocol/ui-library/src/components/ui/skeleton'
55
import Tooltip from '@mui/material/Tooltip'
6-
import Typography from '@mui/material/Typography'
76
import InfoIcon from '@mui/icons-material/Info'
87
import { RoflApp, RoflAppPolicy, RuntimeTransaction, useGetRuntimeRoflAppsId } from '../../../oasis-nexus/api'
98
import { getPreciseNumberFormat } from '../../../locales/getPreciseNumberFormat'
@@ -125,17 +124,15 @@ export const RoflAppDetailsView: FC<{
125124
<TeeRow policy={app.policy} />
126125
<DetailsRow title={t('rofl.appId')}>
127126
<WithHoverHighlighting address={app.id}>
128-
<Typography variant="mono" component="span">
129-
{app.id}
130-
</Typography>
127+
<span className="font-medium">{app.id}</span>
131128
</WithHoverHighlighting>
132129
<CopyToClipboard value={app.id} />
133130
</DetailsRow>
134131
<DetailsRow title={t('rofl.enclaveId')}>
135132
<Enclaves policy={app.policy} />
136133
</DetailsRow>
137134
<DetailsRow title={t('rofl.sekPublicKey')}>
138-
<Typography variant="mono">{app.sek}</Typography> <CopyToClipboard value={app.sek} />
135+
<span className="font-medium">{app.sek}</span> <CopyToClipboard value={app.sek} />
139136
</DetailsRow>
140137
<AdminAccountRow
141138
address={app.admin_eth ?? app.admin}

0 commit comments

Comments
 (0)