File tree Expand file tree Collapse file tree 3 files changed +84
-0
lines changed Expand file tree Collapse file tree 3 files changed +84
-0
lines changed Original file line number Diff line number Diff line change
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
+ ) ) ;
Original file line number Diff line number Diff line change
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
+ } ;
Original file line number Diff line number Diff line change 1
1
export * from './BlockchainAccountStatus' ;
2
+ export * from './Background' ;
2
3
export * from './CTAButton' ;
3
4
export * from './CurrencyProvider' ;
4
5
export * from './CurrencyUtils' ;
You can’t perform that action at this time.
0 commit comments