stylesheet.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import {
  2. type TextStyle,
  3. type ViewStyle,
  4. StyleSheet
  5. } from "react-native";
  6. import type {
  7. RowCardDynamicStyleType
  8. } from "./type";
  9. import type {
  10. Mutable
  11. } from "../../types";
  12. const stylesheet = StyleSheet.create({
  13. container: {
  14. flexDirection: "row",
  15. alignItems: "center",
  16. alignSelf: "stretch"
  17. },
  18. iconContainer: {
  19. justifyContent: "center",
  20. alignItems: "center"
  21. },
  22. rightIconContainer: {
  23. },
  24. title: {
  25. textAlign: "left"
  26. },
  27. subTitle: {
  28. textAlign: "left"
  29. },
  30. rightContainer: {
  31. justifyContent: "flex-end",
  32. flexDirection: "row",
  33. alignItems: "center"
  34. },
  35. leftContainer: {
  36. justifyContent: "flex-start",
  37. flexDirection: "row",
  38. alignItems: "center"
  39. },
  40. rightSubTitle: {
  41. },
  42. rightTitle: {
  43. }
  44. });
  45. export const useStyles = ({
  46. isTransparentBackground,
  47. spaces,
  48. colors,
  49. type
  50. }: RowCardDynamicStyleType) => {
  51. const styles = {
  52. container: {
  53. backgroundColor: isTransparentBackground ? "transparent" : colors.content.container.mid,
  54. padding: spaces.spacingMd
  55. } as Mutable<ViewStyle>,
  56. title: {
  57. textAlign: "left"
  58. } as Mutable<TextStyle>,
  59. subTitle: {
  60. textAlign: "left"
  61. } as Mutable<TextStyle>,
  62. iconContainer: {
  63. paddingHorizontal: spaces.spacingSm
  64. } as Mutable<ViewStyle>,
  65. rightSubTitle: {
  66. textAlign: "right"
  67. } as Mutable<TextStyle>,
  68. leftContainer: {
  69. paddingHorizontal: spaces.spacingSm
  70. } as Mutable<ViewStyle>,
  71. rightContainer: {
  72. paddingHorizontal: spaces.spacingSm
  73. } as Mutable<ViewStyle>,
  74. rightIconContainer: {
  75. paddingHorizontal: spaces.spacingSm
  76. } as Mutable<ViewStyle>,
  77. rightTitle: {
  78. textAlign: "right"
  79. } as Mutable<TextStyle>
  80. };
  81. if(type === "evenly") {
  82. styles.rightContainer.flex = 1;
  83. styles.leftContainer.flex = 1;
  84. } else {
  85. styles.leftContainer.flex = 1;
  86. }
  87. return styles;
  88. };
  89. export default stylesheet;