@@ -604,46 +604,116 @@ const App: () => React$Node = () => {
604
604
</ View >
605
605
606
606
< View style = { styles . body } >
607
- < View style = { styles . sectionContainer } >
608
- < Text style = { styles . sectionTitle } > { 'Hash - hash()' } </ Text >
609
- < View style = { styles . sectionDescription } >
610
- < TextInput style = { styles . input } placeholder = "Source path" onChangeText = { ( hashPathParam ) => setHashPathParam ( hashPathParam ) } placeholderTextColor = "#9a73ef" autoCapitalize = "none" />
611
- </ View >
612
- < Button title = "Hash File" color = "#9a73ef" onPress = { hashCall } />
607
+ < View style = { styles . sectionContainer } >
608
+ < Text style = { styles . sectionTitle } > { 'Hash - hash()' } </ Text >
609
+ < View style = { styles . sectionDescription } >
610
+ < TextInput
611
+ style = { styles . input }
612
+ placeholder = "Source path"
613
+ onChangeText = { setHashPathParam }
614
+ placeholderTextColor = "#9a73ef"
615
+ autoCapitalize = "none"
616
+ />
617
+ < View style = { styles . buttonGroup } >
618
+ { [ 'md5' , 'sha1' , 'sha224' , 'sha256' , 'sha384' , 'sha512' ] . map ( ( alg ) => (
619
+ < Button
620
+ key = { alg }
621
+ title = { alg . toUpperCase ( ) }
622
+ color = { hashAlgValue === alg ? '#7a42f4' : '#ccc' }
623
+ onPress = { ( ) => setHashAlgValue ( alg ) }
624
+ />
625
+ ) ) }
613
626
</ View >
627
+ </ View >
628
+ < Button title = "Hash File" color = "#9a73ef" onPress = { hashCall } />
629
+ </ View >
614
630
</ View >
615
631
616
632
< View style = { styles . body } >
617
- < View style = { styles . sectionContainer } >
618
- < Text style = { styles . sectionTitle } > { 'write - writeFile(), appendFile()' } </ Text >
619
- < View style = { styles . sectionDescription } >
620
- < TextInput style = { styles . input } placeholder = "Source path" onChangeText = { ( writeParam ) => setWriteParam ( writeParam ) } placeholderTextColor = "#9a73ef" autoCapitalize = "none" />
621
- < TextInput style = { styles . input } placeholder = "Source path" onChangeText = { ( writeURIParam ) => setWriteURIParam ( writeURIParam ) } placeholderTextColor = "#9a73ef" autoCapitalize = "none" />
622
- </ View >
623
- < Button title = "Write" color = "#9a73ef" onPress = { writeFileCall } />
624
- < Button title = "Append" color = "#9a73ef" onPress = { appendFileCall } />
633
+ < View style = { styles . sectionContainer } >
634
+ < Text style = { styles . sectionTitle } > { 'write - writeFile(), appendFile()' } </ Text >
635
+ < View style = { styles . sectionDescription } >
636
+ < TextInput
637
+ style = { styles . input }
638
+ placeholder = "Source path"
639
+ onChangeText = { setWriteParam }
640
+ placeholderTextColor = "#9a73ef"
641
+ autoCapitalize = "none"
642
+ />
643
+ < TextInput
644
+ style = { styles . input }
645
+ placeholder = "Destination path"
646
+ onChangeText = { setWriteURIParam }
647
+ placeholderTextColor = "#9a73ef"
648
+ autoCapitalize = "none"
649
+ />
650
+ < View style = { styles . buttonGroup } >
651
+ { [ 'utf8' , 'base64' , 'ascii' , 'uri' ] . map ( ( enc ) => (
652
+ < Button
653
+ key = { enc }
654
+ title = { enc . toUpperCase ( ) }
655
+ color = { writeEncodeParam === enc ? '#7a42f4' : '#ccc' }
656
+ onPress = { ( ) => setWriteEncodeParam ( enc ) }
657
+ />
658
+ ) ) }
625
659
</ View >
660
+ </ View >
661
+ < Button title = "Write" color = "#9a73ef" onPress = { writeFileCall } />
662
+ < Button title = "Append" color = "#9a73ef" onPress = { appendFileCall } />
663
+ </ View >
626
664
</ View >
627
665
628
666
< View style = { styles . body } >
629
- < View style = { styles . sectionContainer } >
630
- < Text style = { styles . sectionTitle } > { 'WriteStream - writeStream()' } </ Text >
631
- < View style = { styles . sectionDescription } >
632
- < TextInput style = { styles . input } placeholder = "Source path" onChangeText = { ( writeStreamParam ) => setWriteStreamParam ( writeStreamParam ) } placeholderTextColor = "#9a73ef" autoCapitalize = "none" />
633
- </ View >
634
- < Button title = "Write" color = "#9a73ef" onPress = { writeStreamCall } />
635
- < Button title = "Append" color = "#9a73ef" onPress = { appendStreamCall } />
667
+ < View style = { styles . sectionContainer } >
668
+ < Text style = { styles . sectionTitle } > { 'WriteStream - writeStream()' } </ Text >
669
+ < View style = { styles . sectionDescription } >
670
+ < TextInput
671
+ style = { styles . input }
672
+ placeholder = "Source path"
673
+ onChangeText = { setWriteStreamParam }
674
+ placeholderTextColor = "#9a73ef"
675
+ autoCapitalize = "none"
676
+ />
677
+ < View style = { styles . buttonGroup } >
678
+ { [ 'utf8' , 'base64' , 'ascii' ] . map ( ( enc ) => (
679
+ < Button
680
+ key = { enc }
681
+ title = { enc . toUpperCase ( ) }
682
+ color = { writeEncodeStreamParam === enc ? '#7a42f4' : '#ccc' }
683
+ onPress = { ( ) => setWriteStreamEncodeParam ( enc ) }
684
+ />
685
+ ) ) }
636
686
</ View >
687
+ </ View >
688
+ < Button title = "Write" color = "#9a73ef" onPress = { writeStreamCall } />
689
+ < Button title = "Append" color = "#9a73ef" onPress = { appendStreamCall } />
690
+ </ View >
637
691
</ View >
638
692
639
693
< View style = { styles . body } >
640
- < View style = { styles . sectionContainer } >
641
- < Text style = { styles . sectionTitle } > { 'ReadStream - readStream()' } </ Text >
642
- < View style = { styles . sectionDescription } >
643
- < TextInput style = { styles . input } placeholder = "Source path" onChangeText = { ( readStreamParam ) => setReadStreamParam ( readStreamParam ) } placeholderTextColor = "#9a73ef" autoCapitalize = "none" />
644
- </ View >
645
- < Button title = "Read" color = "#9a73ef" onPress = { readStreamCall } />
694
+ < View style = { styles . sectionContainer } >
695
+ < Text style = { styles . sectionTitle } > { 'ReadStream - readStream()' } </ Text >
696
+ < View style = { styles . sectionDescription } >
697
+ < TextInput
698
+ style = { styles . input }
699
+ placeholder = "Source path"
700
+ onChangeText = { setReadStreamParam }
701
+ placeholderTextColor = "#9a73ef"
702
+ autoCapitalize = "none"
703
+ />
704
+ < View style = { styles . buttonGroup } >
705
+ { [ 'utf8' , 'base64' , 'ascii' ] . map ( ( enc ) => (
706
+ < Button
707
+ key = { enc }
708
+ title = { enc . toUpperCase ( ) }
709
+ color = { readEncodeStreamParam === enc ? '#7a42f4' : '#ccc' }
710
+ onPress = { ( ) => setReadStreamEncodeParam ( enc ) }
711
+ />
712
+ ) ) }
646
713
</ View >
714
+ </ View >
715
+ < Button title = "Read" color = "#9a73ef" onPress = { readStreamCall } />
716
+ </ View >
647
717
</ View >
648
718
649
719
< View style = { styles . body } >
@@ -701,6 +771,12 @@ const styles = StyleSheet.create({
701
771
paddingRight : 12 ,
702
772
textAlign : 'right' ,
703
773
} ,
774
+ buttonGroup : {
775
+ flexDirection : 'row' ,
776
+ flexWrap : 'wrap' ,
777
+ gap : 8 ,
778
+ marginVertical : 8 ,
779
+ } ,
704
780
} ) ;
705
781
706
782
export default App ;
0 commit comments