Skip to content

Commit

Permalink
Merge pull request #66 from ensdomains/fuses-udpates-three
Browse files Browse the repository at this point in the history
Fuses udpates three
  • Loading branch information
LeonmanRolls authored Aug 26, 2022
2 parents eb130fc + 9b123a6 commit c07ec13
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 53 deletions.
18 changes: 14 additions & 4 deletions components/src/components/atoms/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type BaseProps = {
shadowless?: boolean
/** If true, adds an outline to the button */
outlined?: boolean
/** If true, makes inner div full width*/
fullWidthContent?: boolean
/** The handler for click events. */
onClick?: NativeButtonProps['onClick']
} & Omit<NativeButtonProps, 'prefix' | 'size'>
Expand Down Expand Up @@ -318,11 +320,14 @@ const PrefixContainer = styled.div<GetCenterProps>(

const LoadingContainer = styled.div(() => css``)

const LabelContainer = styled(Typography)(
({ theme }) => css`
const LabelContainer = styled(Typography)<{
$fullWidthContent: boolean
}>(
({ theme, $fullWidthContent }) => css`
color: inherit;
font-size: inherit;
font-weight: ${theme.fontWeights['semiBold']};
${$fullWidthContent && `width: 100%;`}
`,
)

Expand Down Expand Up @@ -353,12 +358,17 @@ export const Button = React.forwardRef(
pressed = false,
shadowless = false,
outlined = false,
fullWidthContent = false,
as: asProp,
...props
}: Props,
ref: React.Ref<HTMLButtonElement>,
) => {
const labelContent = <LabelContainer ellipsis>{children}</LabelContainer>
const labelContent = (
<LabelContainer $fullWidthContent={fullWidthContent} ellipsis>
{children}
</LabelContainer>
)
let childContent: ReactNodeNoStrings
if (shape) {
childContent = loading ? <Spinner color="background" /> : labelContent
Expand All @@ -371,7 +381,6 @@ export const Button = React.forwardRef(
</PrefixContainer>
)}
{labelContent}

{(loading || suffix) && (
<LoadingContainer {...{ center, size, side: 'right' }}>
{loading ? <Spinner color="background" /> : suffix}
Expand All @@ -385,6 +394,7 @@ export const Button = React.forwardRef(
<ButtonElement
{...props}
$center={center}
$fullWidthContent={fullWidthContent}
$outlined={outlined}
$pressed={pressed}
$shadowless={shadowless}
Expand Down
10 changes: 10 additions & 0 deletions components/src/icons/Flame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions components/src/icons/FlameBurned.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions components/src/icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export { ReactComponent as EthTransparentInvertedSVG } from './EthTransparentInv
export { ReactComponent as ExclamationSVG } from './Exclamation.svg'
export { ReactComponent as ExitSVG } from './Exit.svg'
export { ReactComponent as FlagSVG } from './Flag.svg'
export { ReactComponent as FlameSVG } from './Flame.svg'
export { ReactComponent as FlameBurnedSVG } from './FlameBurned.svg'
export { ReactComponent as GradientSVG } from './Gradient.svg'
export { ReactComponent as GridSVG } from './Grid.svg'
export { ReactComponent as GridSolidSVG } from './GridSolid.svg'
Expand Down
2 changes: 2 additions & 0 deletions components/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ const expectedExportedKeys = [
'ExclamationSVG',
'ExitSVG',
'FlagSVG',
'FlameSVG',
'FlameBurnedSVG',
'GradientSVG',
'GridSVG',
'GridSolidSVG',
Expand Down
1 change: 1 addition & 0 deletions docs/src/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Colors } from '@ensdomains/thorin'

import { useIsMounted } from '~/utils/isMounted'
import { PlayroomStateProvider } from '~/playroom/PlayroomState'

import { CopyButton } from './CopyButton'
import type { Props as CodePreviewProps } from './CodePreview'

Expand Down
101 changes: 52 additions & 49 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c07ec13

Please sign in to comment.