Skip to content

Commit cf3a339

Browse files
committed
feat: export components
1 parent 82dc8ef commit cf3a339

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

src/Background.stories.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { storiesOf } from '@storybook/react';
2+
import React from 'react';
3+
import { Box } from 'paramount-ui';
4+
5+
import { Background } from './Background';
6+
7+
storiesOf('Background', module)
8+
.add('Textured', () => (
9+
<Background pattern="textured">
10+
<Box width={60} height={60} />
11+
</Background>
12+
))
13+
.add('Dotted', () => (
14+
<Background pattern="dotted">
15+
<Box width={60} height={60} />
16+
</Background>
17+
))
18+
.add('Dark', () => (
19+
<Background pattern="dark-pattern">
20+
<Box width={60} height={60} />
21+
</Background>
22+
))
23+
.add('Logo', () => (
24+
<Background pattern="dark-logo">
25+
<Box width={60} height={60} />
26+
</Background>
27+
));

src/Background.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import React from 'react';
2+
3+
export interface BackgroundProps {
4+
pattern: 'dotted' | 'textured' | 'dark-pattern' | 'dark-logo';
5+
children?: React.ReactNode;
6+
}
7+
8+
export const Background = (props: BackgroundProps): JSX.Element => {
9+
const { children, pattern = 'textured' } = props;
10+
11+
if (pattern === 'dark-pattern') {
12+
return (
13+
<div
14+
style={{
15+
backgroundImage: `url('https://res.cloudinary.com/wetrust-cryptounlocked/image/upload/c_crop,w_400/v1573530837/dark-bg.jpg')`,
16+
}}
17+
>
18+
{children}
19+
</div>
20+
);
21+
}
22+
23+
if (pattern === 'dark-logo') {
24+
return (
25+
<div
26+
style={{
27+
backgroundImage: `url('https://res.cloudinary.com/wetrust-cryptounlocked/image/upload/c_crop,w_400/v1573530837/wetrust-bg.jpg')`,
28+
}}
29+
>
30+
{children}
31+
</div>
32+
);
33+
}
34+
35+
if (pattern === 'dotted') {
36+
return (
37+
<div
38+
style={{
39+
backgroundImage: `url('https://res.cloudinary.com/wetrust-cryptounlocked/image/upload/c_crop,w_400/v1568706049/dotted-bg.png')`,
40+
}}
41+
>
42+
{children}
43+
</div>
44+
);
45+
}
46+
47+
return (
48+
<div
49+
style={{
50+
backgroundImage: `url('https://res.cloudinary.com/wetrust-cryptounlocked/image/upload/c_crop,w_400/v1568706049/textured-bg.png')`,
51+
}}
52+
>
53+
{children}
54+
</div>
55+
);
56+
};

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './BlockchainAccountStatus';
2+
export * from './Background';
23
export * from './CTAButton';
34
export * from './CurrencyProvider';
45
export * from './CurrencyUtils';

0 commit comments

Comments
 (0)