Skip to content

Commit 4bbf37e

Browse files
authored
Merge pull request #2241 from oasisprotocol/kaja/uil-box-rofl
Update Box elements in ROFL pages
2 parents 0e0bd60 + 5728707 commit 4bbf37e

File tree

5 files changed

+13
-65
lines changed

5 files changed

+13
-65
lines changed

.changelog/2241.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update Box elements in ROFL pages.

src/app/pages/RoflAppDetailsPage/Endorsement.tsx

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
11
import { FC, Fragment, PropsWithChildren, ReactNode } from 'react'
22
import { Trans, useTranslation } from 'react-i18next'
3-
import Box from '@mui/material/Box'
43
import { RoflAppPolicy } from '../../../oasis-nexus/api'
54
import { exhaustedTypeWarning } from '../../../types/errors'
65
import { AccountLink } from '../../components/Account/AccountLink'
76
import { useRuntimeScope } from '../../hooks/useScopeParam'
8-
import { useScreenSize } from '../../hooks/useScreensize'
97
import { getOasisAddressFromBase64PublicKey } from '../../utils/helpers'
108

119
const StyledBox: FC<PropsWithChildren> = ({ children }) => {
12-
const { isTablet } = useScreenSize()
1310
return (
14-
<Box
15-
sx={{
16-
display: 'flex',
17-
flexWrap: isTablet ? 'wrap' : 'nowrap',
18-
textWrap: isTablet ? 'wrap' : 'nowrap',
19-
gap: 2,
20-
alignItems: 'center',
21-
flex: 1,
22-
overflowX: 'hidden',
23-
overflowY: 'hidden',
24-
}}
25-
>
11+
<div className="flex flex-nowrap md:flex-wrap gap-1 items-center flex-1 overflow-x-hidden overflow-y-hidden text-nowrap md:whitespace-normal">
2612
{children}
27-
</Box>
13+
</div>
2814
)
2915
}
3016

@@ -145,21 +131,9 @@ export const Endorsement: FC<EndorsementProps> = ({ endorsements, groupOp }) =>
145131
case 'and':
146132
case 'or':
147133
return (
148-
<Box
149-
component={'div'}
150-
sx={{
151-
flex: 1,
152-
display: 'flex',
153-
flexDirection: 'column',
154-
overflowX: 'hidden',
155-
paddingLeft: '15px',
156-
borderLeft: '1px solid #000' /* Vertical line of the brace */,
157-
borderTopLeftRadius: '10px',
158-
borderBottomLeftRadius: '10px',
159-
}}
160-
>
134+
<div className="flex-1 flex flex-col overflow-x-hidden pl-4 border-l border-black rounded-tl-lg rounded-bl-lg">
161135
<Endorsement endorsements={value} groupOp={key} />
162-
</Box>
136+
</div>
163137
)
164138
}
165139
exhaustedTypeWarning('Unknown endorsement', key)
@@ -185,18 +159,9 @@ export const Endorsement: FC<EndorsementProps> = ({ endorsements, groupOp }) =>
185159
{groupOpLabel[groupOp]}
186160
</span>
187161
)}
188-
<Box
189-
sx={{
190-
flex: 1,
191-
display: 'flex',
192-
alignItems: 'center',
193-
flexWrap: 'nowrap',
194-
overflowX: 'hidden',
195-
gap: 3,
196-
}}
197-
>
162+
<div className="flex flex-1 items-center flex-nowrap overflow-x-hidden gap-2">
198163
{renderedExplanation}
199-
</Box>
164+
</div>
200165
</Fragment>
201166
) : (
202167
<Fragment key={index}>{renderedExplanation}</Fragment>

src/app/pages/RoflAppDetailsPage/RoflAppInstanceTransactionsCard.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { FC } from 'react'
2-
import Box from '@mui/material/Box'
32
import { useScreenSize } from '../../hooks/useScreensize'
43
import { NUMBER_OF_ITEMS_ON_SEPARATE_PAGE } from '../../../config'
54
import { updatesContainerId } from '../../utils/tabAnchors'
@@ -17,16 +16,11 @@ export const RoflAppInstanceTransactionsCard: FC<RoflAppDetailsContext> = contex
1716
<LinkableCardLayout
1817
containerId={updatesContainerId}
1918
title={
20-
<Box
21-
sx={{
22-
display: 'flex',
23-
justifyContent: 'end',
24-
}}
25-
>
19+
<div className="flex justify-end">
2620
{!isMobile && (
2721
<RuntimeTransactionMethodFilter layer={scope.layer} value={txMethod} setValue={setTxMethod} />
2822
)}
29-
</Box>
23+
</div>
3024
}
3125
>
3226
{isMobile && (

src/app/pages/RoflAppDetailsPage/RoflAppUpdatesCard.tsx

Lines changed: 2 additions & 8 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 Box from '@mui/material/Box'
43
import { useScreenSize } from '../../hooks/useScreensize'
54
import { NUMBER_OF_ITEMS_ON_SEPARATE_PAGE } from '../../../config'
65
import { updatesContainerId } from '../../utils/tabAnchors'
@@ -20,12 +19,7 @@ export const RoflAppUpdatesCard: FC<RoflAppDetailsContext> = context => {
2019
<LinkableCardLayout
2120
containerId={updatesContainerId}
2221
title={
23-
<Box
24-
sx={{
25-
display: 'flex',
26-
justifyContent: 'end',
27-
}}
28-
>
22+
<div className="flex justify-end">
2923
{!isMobile && (
3024
<RuntimeTransactionMethodFilter
3125
layer={scope.layer}
@@ -34,7 +28,7 @@ export const RoflAppUpdatesCard: FC<RoflAppDetailsContext> = context => {
3428
customOptions={customOptions}
3529
/>
3630
)}
37-
</Box>
31+
</div>
3832
}
3933
>
4034
{isMobile && (

src/app/pages/RoflAppInstanceDetailsPage/RoflAppInstanceRakTransactionsCard.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { FC } from 'react'
2-
import Box from '@mui/material/Box'
32
import { useScreenSize } from '../../hooks/useScreensize'
43
import { NUMBER_OF_ITEMS_ON_SEPARATE_PAGE } from '../../../config'
54
import { transactionsContainerId } from '../../utils/tabAnchors'
@@ -16,16 +15,11 @@ export const RoflAppInstanceRakTransactionsCard: FC<RoflAppInstanceDetailsContex
1615
<LinkableCardLayout
1716
containerId={transactionsContainerId}
1817
title={
19-
<Box
20-
sx={{
21-
display: 'flex',
22-
justifyContent: 'end',
23-
}}
24-
>
18+
<div className="flex justify-end">
2519
{!isMobile && (
2620
<RuntimeTransactionMethodFilter layer={scope.layer} value={txMethod} setValue={setTxMethod} />
2721
)}
28-
</Box>
22+
</div>
2923
}
3024
>
3125
{isMobile && (

0 commit comments

Comments
 (0)