index.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import {
  2. ScrollView,
  3. View
  4. } from "react-native";
  5. import stylesheet from "./stylesheet";
  6. import {
  7. NCoreUIKitLocalize,
  8. NCoreUIKitTheme,
  9. PageContainer,
  10. Text
  11. } from "ncore-ui-kit";
  12. const WebScrollbar = () => {
  13. const {
  14. colors
  15. } = NCoreUIKitTheme.useContext();
  16. const {
  17. localize
  18. } = NCoreUIKitLocalize.useContext();
  19. return <PageContainer
  20. isScrollable={true}
  21. scrollViewProps={{
  22. showsVerticalScrollIndicator: true
  23. }}
  24. >
  25. <Text
  26. variant="headlineSmallSize"
  27. style={stylesheet.descText}
  28. >
  29. {localize("webScrollbar-title")}
  30. </Text>
  31. <Text
  32. variant="bodyMediumSize"
  33. color="mid"
  34. style={stylesheet.descText}
  35. >
  36. {localize("webScrollbar-desc")}
  37. </Text>
  38. <ScrollView
  39. style={[
  40. stylesheet.scrollView,
  41. {
  42. backgroundColor: colors.content.container.default,
  43. borderColor: colors.content.container.mid
  44. }
  45. ]}
  46. >
  47. {Array.from({
  48. length: 30
  49. }).map((_, index) => <View
  50. key={index}
  51. style={[
  52. stylesheet.item,
  53. {
  54. borderBottomColor: colors.content.container.mid
  55. }
  56. ]}
  57. >
  58. <Text>
  59. {localize("webScrollbar-item")} {index + 1}
  60. </Text>
  61. </View>)}
  62. </ScrollView>
  63. </PageContainer>;
  64. };
  65. export default WebScrollbar;