File tree Expand file tree Collapse file tree 3 files changed +252
-120
lines changed Expand file tree Collapse file tree 3 files changed +252
-120
lines changed Original file line number Diff line number Diff line change 11import  React  from  'react' ; 
2- import  {  Snackbar ,  Text ,  useTheme  }  from  'react95-native' ; 
3- 
4- import  Container  from  '../util/Container' ; 
2+ import  {  StyleSheet ,  View  }  from  'react-native' ; 
3+ import  {  Snackbar ,  Button ,  useTheme  }  from  'react95-native' ; 
54
65const  SnackbarExample  =  ( )  =>  { 
6+   const  [ visible ,  setVisible ]  =  React . useState < boolean > ( true ) ; 
7+ 
78  const  theme  =  useTheme ( ) ; 
89  return  ( 
9-     < Container  style = { [ {  backgroundColor : theme . materialDark  } ] } > 
10-       < Container . Section  title = 'Default:' > 
11-         < Snackbar  style = { [ {  height : 80  } ] } > 
12-           < Snackbar . Content > 
13-             < Text > Display some information here.</ Text > 
14-           </ Snackbar . Content > 
15-         </ Snackbar > 
16-       </ Container . Section > 
17-     </ Container > 
10+     < View  style = { [ styles . container ,  {  backgroundColor : theme . materialDark  } ] } > 
11+       < Button  size = 'lg'  onPress = { ( )  =>  setVisible ( ! visible ) } > 
12+         { visible  ? 'Hide'  : 'Show' } 
13+       </ Button > 
14+       < Snackbar 
15+         visible = { visible } 
16+         onDismiss = { ( )  =>  setVisible ( false ) } 
17+         action = { { 
18+           label : 'Undo' , 
19+           onPress : ( )  =>  { 
20+             // Do something 
21+           } , 
22+         } } 
23+         duration = { Snackbar . DURATION_MEDIUM } 
24+       > 
25+         Hi! I am Clippy, your office assistant.
26+       </ Snackbar > 
27+     </ View > 
1828  ) ; 
1929} ; 
2030
31+ const  styles  =  StyleSheet . create ( { 
32+   container : { 
33+     flex : 1 , 
34+     alignItems : 'center' , 
35+     justifyContent : 'center' , 
36+   } , 
37+ } ) ; 
38+ 
2139export  default  SnackbarExample ; 
Load Diff This file was deleted. 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments