Skip to content

Commit

Permalink
Merge pull request #821 from safe-global/chore/normalize-tx-builder-t…
Browse files Browse the repository at this point in the history
…heme

feat(transaction-builder-theme): Remove safe-react-components from transaction builder
  • Loading branch information
clovisdasilvaneto authored Oct 7, 2024
2 parents c1dff3f + 539da3e commit fd74e30
Show file tree
Hide file tree
Showing 102 changed files with 3,894 additions and 424 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# branch should not be protected
branch: 'main'
# user names of users allowed to contribute without CLA
allowlist: rmeissner,germartinez,Uxio0,dasanra,francovenica,luarx,DaniSomoza,yagopv,JagoFigueroa,jmealy,usame-algan,bot*
allowlist: clovisdasilvaneto,rmeissner,germartinez,Uxio0,dasanra,francovenica,luarx,DaniSomoza,yagopv,JagoFigueroa,jmealy,usame-algan,bot*

# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
# enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
Expand Down
2 changes: 1 addition & 1 deletion apps/tx-builder/src/assets/add-new-batch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/tx-builder/src/assets/fonts/DMSans700.woff2
Binary file not shown.
Binary file not shown.
87 changes: 87 additions & 0 deletions apps/tx-builder/src/components/Accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { ReactElement } from 'react'
import AccordionMUI, { AccordionProps as AccordionMUIProps } from '@material-ui/core/Accordion'
import AccordionSummaryMUI, {
AccordionSummaryProps as AccordionSummaryMUIProps,
} from '@material-ui/core/AccordionSummary'
import styled from 'styled-components'
import FixedIcon from '../FixedIcon'

type AccordionProps = AccordionMUIProps & {
compact?: boolean
}

type StyledAccordionProps = AccordionMUIProps & {
$compact?: AccordionProps['compact']
}

const StyledAccordion = styled(AccordionMUI)<StyledAccordionProps>`
&.MuiAccordion-root {
border-radius: ${({ $compact }) => ($compact ? '8px' : '0')};
border: ${({ $compact, theme }) => ($compact ? '2px solid ' + theme.palette.divider : 'none')};
border-bottom: 2px solid ${({ theme }) => theme.palette.divider};
margin-bottom: ${({ $compact }) => ($compact ? '16px' : '0')};
overflow: hidden;
&:before {
height: 0;
}
&:first-child {
border-top: 2px solid ${({ theme }) => theme.palette.divider};
}
&.Mui-expanded {
margin: ${({ $compact }) => ($compact ? '0 0 16px 0' : '0')};
}
.MuiAccordionDetails-root {
padding: 16px;
}
}
`

const StyledAccordionSummary = styled(AccordionSummaryMUI)`
&.MuiAccordionSummary-root {
&.Mui-expanded {
min-height: 48px;
border-bottom: 2px solid ${({ theme }) => theme.palette.divider};
background-color: ${({ theme }) => theme.palette.background.default};
}
&:hover {
background-color: ${({ theme }) => theme.palette.background.default};
}
.MuiAccordionSummary-content {
&.Mui-expanded {
margin: 0;
}
}
.MuiIconButton-root {
font-size: 0;
padding: 16px;
}
}
`

export const Accordion = ({ compact, children, ...props }: AccordionProps): ReactElement => {
return (
<StyledAccordion square elevation={0} $compact={compact} {...props}>
{children}
</StyledAccordion>
)
}

export const AccordionSummary = ({
children,
...props
}: AccordionSummaryMUIProps): ReactElement => {
return (
<StyledAccordionSummary expandIcon={<FixedIcon type="chevronDown" />} {...props}>
{children}
</StyledAccordionSummary>
)
}

export { default as AccordionActions } from '@material-ui/core/AccordionActions'
export { default as AccordionDetails } from '@material-ui/core/AccordionDetails'
Loading

0 comments on commit fd74e30

Please sign in to comment.