stylesheet.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import {
  2. type TextStyle,
  3. type ViewStyle,
  4. StyleSheet
  5. } from "react-native";
  6. import type {
  7. DateSelectorDynamicStyle
  8. } from "./type";
  9. import type {
  10. Mutable
  11. } from "../../types";
  12. const stylesheet = StyleSheet.create({
  13. container: {
  14. flex: 1
  15. },
  16. contentContainer: {
  17. justifyContent: "space-between",
  18. flexDirection: "row",
  19. alignItems: "center",
  20. flexShrink: 1,
  21. flex: 1
  22. },
  23. columnContainer: {
  24. justifyContent: "center",
  25. flexDirection: "column",
  26. alignItems: "center",
  27. flexShrink: 1,
  28. flex: 1
  29. },
  30. day: {
  31. justifyContent: "center",
  32. alignItems: "center",
  33. position: "relative",
  34. flexShrink: 1,
  35. width: "100%",
  36. flex: 1
  37. },
  38. todayIndicator: {
  39. position: "absolute",
  40. zIndex: 999
  41. },
  42. nextPrevToolContainer: {
  43. justifyContent: "space-between",
  44. flexDirection: "row",
  45. alignItems: "center",
  46. flex: 1
  47. }
  48. });
  49. export const useStyles = ({
  50. radiuses,
  51. borders,
  52. spaces,
  53. colors
  54. }: DateSelectorDynamicStyle) => {
  55. const styles = {
  56. dayOfWeek: {
  57. marginBottom: spaces.spacingMd
  58. } as Mutable<TextStyle>,
  59. day: {
  60. borderBottomRightRadius: radiuses.full,
  61. borderBottomLeftRadius: radiuses.full,
  62. borderTopRightRadius: radiuses.full,
  63. borderTopLeftRadius: radiuses.full,
  64. borderColor: "transparent",
  65. borderWidth: borders.line,
  66. padding: spaces.spacingSm
  67. } as Mutable<ViewStyle>,
  68. todayIndicator: {
  69. borderColor: colors.content.border.default,
  70. borderBottomRightRadius: radiuses.full,
  71. borderBottomLeftRadius: radiuses.full,
  72. borderTopRightRadius: radiuses.full,
  73. borderTopLeftRadius: radiuses.full,
  74. borderWidth: borders.line,
  75. bottom: spaces.spacingXs,
  76. right: spaces.spacingXs,
  77. left: spaces.spacingXs,
  78. top: spaces.spacingXs
  79. } as Mutable<ViewStyle>,
  80. nextPrevToolContainer: {
  81. marginBottom: spaces.spacingMd
  82. } as Mutable<ViewStyle>,
  83. nextPrevToolChevronButton: {
  84. padding: spaces.spacingSm
  85. } as Mutable<ViewStyle>
  86. };
  87. return styles;
  88. };
  89. export default stylesheet;