-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate inscription text components
- Loading branch information
1 parent
bce58e5
commit 7c0ec2b
Showing
22 changed files
with
219 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
apps/mobile/src/components/widgets/collectibles/collectibles.mocks.d.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
apps/mobile/src/components/widgets/collectibles/collectibles.mocks.d.ts.map
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
packages/ui/src/components/collectibles/native/collectible-card-layout.native.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
packages/ui/src/components/collectibles/native/collectible-html.native.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/ui/src/components/collectibles/native/collectible-image.native.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
packages/ui/src/components/collectibles/web/collectible.layout.web.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
packages/ui/src/components/collectibles/web/image-unavailable.web.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...components/collectibles/web/inscription-preview-card/components/inscription-image.web.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
interface InscriptionImageProps { | ||
src: string; | ||
} | ||
export function InscriptionImage({ src }: InscriptionImageProps) { | ||
return ( | ||
<img | ||
src={src} | ||
style={{ width: '100%', height: '100%', aspectRatio: '1 / 1', objectFit: 'cover' }} | ||
/> | ||
); | ||
} |
31 changes: 31 additions & 0 deletions
31
...ponents/collectibles/web/inscription-preview-card/components/inscription-metadata.web.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Flex, styled } from 'leather-styles/jsx'; | ||
|
||
import { Link } from '../../../../link/link.web'; | ||
|
||
interface InscriptionMetadataProps { | ||
action?(): void; | ||
actionLabel?: string; | ||
icon?: React.JSX.Element; | ||
subtitle: string; | ||
title: string; | ||
} | ||
export function InscriptionMetadata({ | ||
action, | ||
actionLabel, | ||
icon, | ||
subtitle, | ||
title, | ||
}: InscriptionMetadataProps) { | ||
return ( | ||
<Flex alignItems="flex-start" flexDirection="column" justifyContent="center"> | ||
{icon && icon} | ||
<styled.span textStyle="label.01">{title}</styled.span> | ||
<styled.span textStyle="caption.01">{subtitle}</styled.span> | ||
{action ? ( | ||
<Link color="stacks" onClick={() => action()} textStyle="caption.01" variant="text"> | ||
{actionLabel} | ||
</Link> | ||
) : null} | ||
</Flex> | ||
); | ||
} |
19 changes: 19 additions & 0 deletions
19
...s/collectibles/web/inscription-preview-card/components/inscription-preview.layout.web.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Box, BoxProps } from 'leather-styles/jsx'; | ||
|
||
import { HasChildren } from '../../../../../utils/has-children.shared'; | ||
|
||
export function InscriptionPreviewLayout({ children, ...props }: HasChildren & BoxProps) { | ||
return ( | ||
<Box | ||
bg="black" | ||
borderRadius="xs" | ||
width="100px" | ||
height="100px" | ||
overflow="hidden" | ||
position="relative" | ||
{...props} | ||
> | ||
{children} | ||
</Box> | ||
); | ||
} |
31 changes: 31 additions & 0 deletions
31
...ents/collectibles/web/inscription-preview-card/components/inscription-text.layout.web.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { sanitize } from 'dompurify'; | ||
import { Box } from 'leather-styles/jsx'; | ||
|
||
interface InscriptionTextLayoutProps { | ||
content: string; | ||
} | ||
export function InscriptionTextLayout({ content }: InscriptionTextLayoutProps) { | ||
return ( | ||
<Box | ||
_after={{ | ||
content: '""', | ||
position: 'absolute', | ||
bottom: '0', | ||
left: '0', | ||
height: '30px', | ||
width: '100%', | ||
backgroundImage: 'linear-gradient(rgba(0,0,0,0), rgba(0,0,0,1))', | ||
}} | ||
color="white" | ||
fontSize="9px" | ||
height="100%" | ||
p="space.03" | ||
position="relative" | ||
overflow="hidden" | ||
textAlign="left" | ||
width="100%" | ||
> | ||
<pre>{sanitize(content)}</pre> | ||
</Box> | ||
); | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/ui/src/components/collectibles/web/inscription-preview-card/index.web.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { InscriptionPreviewCard } from './inscription-preview-card.web'; | ||
export { InscriptionTextLayout } from './components/inscription-text.layout.web'; | ||
export { InscriptionPreviewLayout } from './components/inscription-preview.layout.web'; | ||
export { InscriptionImage } from './components/inscription-image.web'; |
Oops, something went wrong.