Skip to content

Commit

Permalink
update grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaut committed Dec 3, 2024
1 parent d43229a commit a6abfc2
Show file tree
Hide file tree
Showing 24 changed files with 185 additions and 442 deletions.
14 changes: 3 additions & 11 deletions packages/ui/src/components/AccountEditName.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Grid } from '@mui/material'
import { Grid2 as Grid } from '@mui/material'
import { ChangeEvent, useCallback, useMemo, useState } from 'react'
import { useAccounts } from '../contexts/AccountsContext'
import { useAccountNames } from '../contexts/AccountNamesContext'
Expand Down Expand Up @@ -45,23 +45,15 @@ const AccountEditName = ({ address, onNameChange, className, testId }: Props) =>
spacing={2}
>
<Grid
item
xs={12}
sm={6}
md={4}
size={{ xs: 12, sm: 6, md: 4 }}
alignItems="center"
>
<AccountDisplay
address={address}
withName={false}
/>
</Grid>
<Grid
item
xs={12}
sm={6}
md={8}
>
<Grid size={{ xs: 12, sm: 6, md: 8 }}>
<InputField
label={`Name${isExtensionAccount ? ' (from extension)' : ''}`}
onChange={onChange}
Expand Down
24 changes: 5 additions & 19 deletions packages/ui/src/components/DeepTxAlert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, Grid } from '@mui/material'
import { Alert, Grid2 as Grid } from '@mui/material'
import { styled } from '@mui/material/styles'
import { useCallback, useEffect, useMemo, useState } from 'react'
import { useMultisigsByMultisigOrPureSignatoriesQuery } from '../../types-and-hooks'
Expand Down Expand Up @@ -217,30 +217,19 @@ export const DeepTxAlert = ({ pendingTxCallData }: Props) => {
data-cy="banner-nested-multisig-tx"
>
<Grid
item
xs={12}
sm={9}
md={9}
size={{ xs: 12, sm: 9, md: 9 }}
container
>
<Grid
item
xs={12}
sm={12}
md={12}
lg={6}
size={{ xs: 12, sm: 12, md: 12, lg: 6 }}
display="flex"
alignItems="center"
className="gridItem"
>
Pending tx <FunctionNameStyled>{data1.name}</FunctionNameStyled>
</Grid>
<Grid
item
xs={12}
sm={12}
md={12}
lg={6}
size={{ xs: 12, sm: 12, md: 12, lg: 6 }}
display="flex"
alignItems="center"
className="gridItem"
Expand All @@ -254,10 +243,7 @@ export const DeepTxAlert = ({ pendingTxCallData }: Props) => {
</Grid>
</Grid>
<Grid
item
xs={12}
sm={3}
md={3}
size={{ xs: 12, sm: 3, md: 3 }}
display="flex"
alignItems="center"
className="gridItem"
Expand Down
10 changes: 6 additions & 4 deletions packages/ui/src/components/EasySetup/BalancesTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ const BalancesTransfer = ({ className, onSetExtrinsic, onSetErrorMessage, from }
value={amountString}
helperText={amountError}
error={!!amountError}
InputProps={{
endAdornment: (
<InputAdornment position="end">{chainInfo?.tokenSymbol || ''}</InputAdornment>
)
slotProps={{
input: {
endAdornment: (
<InputAdornment position="end">{chainInfo?.tokenSymbol || ''}</InputAdornment>
)
}
}}
/>
</Box>
Expand Down
7 changes: 2 additions & 5 deletions packages/ui/src/components/ErrorFallback/ErrorFallback.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNavigate, useRouteError } from 'react-router'
import { Alert, AlertTitle, Grid } from '@mui/material'
import { Alert, AlertTitle, Grid2 as Grid } from '@mui/material'
import { theme } from '../../styles/theme'
import { styled, ThemeProvider as MuiThemeProvider } from '@mui/material/styles'
import { Button } from '../library'
Expand All @@ -15,10 +15,7 @@ export const ErrorFallback = () => {
alignItems="center"
container
>
<Grid
item
xs={6}
>
<Grid size={{ xs: 6 }}>
<AlertStyled
severity="error"
role="alert"
Expand Down
18 changes: 3 additions & 15 deletions packages/ui/src/components/SuccessCreation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Grid } from '@mui/material'
import { Box, Grid2 as Grid } from '@mui/material'
import { styled } from '@mui/material/styles'
import { HiOutlineClock as AccessTimeIcon } from 'react-icons/hi2'

Expand All @@ -14,22 +14,10 @@ const SuccessCreation = ({ className }: Props) => {
container
alignItems="center"
>
<Grid
item
xs={12}
sm={4}
md={4}
lg={4}
>
<Grid size={{ xs: 12, sm: 4, md: 4, lg: 4 }}>
<AccessTimeIcon className="icon" />
</Grid>
<Grid
item
xs={12}
sm={8}
md={8}
lg={8}
>
<Grid size={{ xs: 12, sm: 8, md: 8, lg: 8 }}>
<h4 className="explainer">
It shouldn&apos;t take more than 30s.
<br />
Expand Down
13 changes: 3 additions & 10 deletions packages/ui/src/components/WalletConnect/WalletConnectSession.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, Box, CircularProgress, Grid, Tooltip, styled } from '@mui/material'
import { Alert, Box, CircularProgress, Grid2 as Grid, Tooltip, styled } from '@mui/material'
import { Button, InputField } from '../library'
import { useCallback, useMemo, useState, ChangeEvent } from 'react'
import { useWalletConnect } from '../../contexts/WalletConnectContext'
Expand Down Expand Up @@ -35,10 +35,7 @@ export const WalletConnectSession = () => {
container
spacing={2}
>
<Grid
item
alignItems="center"
>
<Grid alignItems="center">
{!canUseWalletConnect && (
<AlertStyled
severity="warning"
Expand All @@ -50,11 +47,7 @@ export const WalletConnectSession = () => {
</AlertStyled>
)}
</Grid>
<Grid
xs={12}
md={8}
item
>
<Grid size={{ xs: 12, md: 8 }}>
<Grid
container
direction="column"
Expand Down
9 changes: 2 additions & 7 deletions packages/ui/src/components/layout/Center.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Grid } from '@mui/material'
import { Grid2 as Grid } from '@mui/material'

interface Props {
className?: string
Expand All @@ -15,11 +15,6 @@ export const Center = ({ children, className }: Props) => (
justifyContent="center"
style={{ height: '100%' }}
>
<Grid
item
xs={3}
>
{children}
</Grid>
<Grid size={{ xs: 3 }}>{children}</Grid>
</Grid>
)
2 changes: 1 addition & 1 deletion packages/ui/src/components/library/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const Autocomplete = <
return (
<AutocompleteWrapper className={className}>
<AutocompleteMui
{...props}
handleHomeEndKeys={handleHomeEndKeys}
selectOnFocus={selectOnFocus}
clearOnBlur={clearOnBlur}
Expand All @@ -91,7 +92,6 @@ const Autocomplete = <
renderOption={renderOption}
popupIcon={<HiOutlineChevronDown />}
renderInput={renderInput}
{...props}
slots={{
popper: PopperStyled
}}
Expand Down
20 changes: 5 additions & 15 deletions packages/ui/src/components/modals/ChangeMultisig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Dialog,
DialogContent,
DialogTitle,
Grid
Grid2 as Grid
} from '@mui/material'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { styled } from '@mui/material/styles'
Expand Down Expand Up @@ -347,10 +347,7 @@ const ChangeMultisig = ({ onClose, className }: Props) => {
<Grid container>
{currentStep === 'selection' && (
<>
<Grid
item
xs={12}
>
<Grid size={{ xs: 12 }}>
{!hasProxyEnoughFunds && (
<Alert severity="error">
The pure account doesn&apos;t have enough funds. It needs at least{' '}
Expand Down Expand Up @@ -383,10 +380,7 @@ const ChangeMultisig = ({ onClose, className }: Props) => {
</>
)}
</Grid>
<Grid
item
xs={12}
>
<Grid size={{ xs: 12 }}>
<h4>Signatories</h4>
<Box className="subSection">
<SignatorySelection
Expand All @@ -395,10 +389,7 @@ const ChangeMultisig = ({ onClose, className }: Props) => {
/>
</Box>
</Grid>
<Grid
item
xs={12}
>
<Grid size={{ xs: 12 }}>
<h4>Threshold</h4>
<Box className="subSection">
<ThresholdSelection
Expand Down Expand Up @@ -446,8 +437,7 @@ const ChangeMultisig = ({ onClose, className }: Props) => {
</Grid>
)}
<Grid
item
xs={12}
size={{ xs: 12 }}
className="buttonContainer"
>
{!!errorMessage && <AlertStyled severity="warning">{errorMessage}</AlertStyled>}
Expand Down
Loading

0 comments on commit a6abfc2

Please sign in to comment.