SpecBtns.tsx 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. import Buttons from "@/components/basic/Buttons"
  2. import { ButtonType } from "@/utils/types"
  3. import { View, Text } from "@tarojs/components"
  4. import { useState } from "react"
  5. import PostBtn from "./PostBtn"
  6. export const StartFastBtn = (props: { onClick: Function, isLoading?: boolean }) => {
  7. return (
  8. <PostBtn title="开始断食" type={ButtonType.elevated}
  9. onClick={() => { props.onClick() }}
  10. btnStyle={{
  11. height: 50,
  12. borderRadius: 25,
  13. backgroundColor: '#AAFF00',
  14. width:160,
  15. // paddingLeft: 40,
  16. // paddingRight: 40,
  17. color: 'black',
  18. fontSize: 20,
  19. fontWeight:500,
  20. display: 'flex',
  21. alignItems: 'center',
  22. justifyContent: 'center',
  23. // lineHeight:20
  24. }} />
  25. )
  26. }
  27. export const StartSleepBtn = (props: { onClick: Function, lowLight?: boolean, isLoading?: boolean }) => {
  28. return (
  29. <PostBtn title="开始睡眠" type={ButtonType.elevated}
  30. onClick={() => { props.onClick() }}
  31. lowLight={props.lowLight ? props.lowLight : false}
  32. btnStyle={{
  33. height: 50,
  34. borderRadius: 25,
  35. backgroundColor: '#00FFFF',
  36. width:160,
  37. // paddingLeft: 40,
  38. // paddingRight: 40,
  39. color: 'black',
  40. fontWeight:500,
  41. fontSize: 20,
  42. display: 'flex',
  43. alignItems: 'center',
  44. justifyContent: 'center',
  45. // lineHeight:20
  46. }}
  47. />
  48. )
  49. }
  50. export const EndSleepBtn = (props: { onClick: Function, lowLight?: boolean, isLoading?: boolean }) => {
  51. return (
  52. <PostBtn title="结束睡眠" type={ButtonType.outline}
  53. onClick={() => { props.onClick() }}
  54. lowLight={props.lowLight ? props.lowLight : false}
  55. btnStyle={{
  56. height: 50,
  57. borderRadius: 25,
  58. borderColor: '#00FFFF',
  59. borderWidth: 2,
  60. borderStyle: 'solid',
  61. width:160,
  62. // paddingLeft: 40,
  63. // paddingRight: 40,
  64. color: '#00FFFF',
  65. fontWeight:500,
  66. fontSize: 20,
  67. display: 'flex',
  68. alignItems: 'center',
  69. justifyContent: 'center',
  70. // lineHeight:20
  71. }}
  72. />
  73. )
  74. }
  75. export const EndFastBtn = (props: { onClick: Function, lowLight?: boolean, isLoading?: boolean }) => {
  76. return (
  77. <PostBtn title="结束断食" type={ButtonType.outline}
  78. onClick={() => { props.onClick() }}
  79. lowLight={props.lowLight ? props.lowLight : false}
  80. btnStyle={{
  81. height: 50,
  82. borderRadius: 25,
  83. borderColor: '#AAFF00',
  84. borderWidth: 2,
  85. borderStyle: 'solid',
  86. width:160,
  87. // paddingLeft: 40,
  88. // paddingRight: 40,
  89. color: '#AAFF00',
  90. fontSize: 20,
  91. fontWeight:500,
  92. display: 'flex',
  93. alignItems: 'center',
  94. justifyContent: 'center',
  95. // lineHeight:20
  96. }}
  97. />
  98. )
  99. }
  100. export const SetScheduleBtn = (props: { onClick: Function, title: string, isFast?: boolean, lowLight?: boolean }) => {
  101. return (
  102. <Buttons title={props.title} type={ButtonType.elevated}
  103. onClick={() => { props.onClick() }}
  104. lowLight={props.lowLight ? props.lowLight : false}
  105. btnStyle={{
  106. height: 50,
  107. width: 300,
  108. boxSizing: 'border-box',
  109. borderRadius: 25,
  110. backgroundColor: props.isFast ? '#AAFF00' : '#00FFFF',
  111. paddingLeft: 40,
  112. paddingRight: 40,
  113. color: 'black',
  114. fontSize: 20,
  115. fontWeight:500,
  116. display: 'flex',
  117. alignItems: 'center',
  118. justifyContent: 'center',
  119. }}
  120. />
  121. )
  122. }
  123. export const RecordMetricBtn = (props: { onClick: Function, title: string,themeColor:string }) => {
  124. return (
  125. <PostBtn title={props.title} type={ButtonType.elevated}
  126. onClick={() => { props.onClick() }}
  127. btnStyle={{
  128. height: 42,
  129. // width: 100,
  130. boxSizing: 'border-box',
  131. borderRadius: 21,
  132. backgroundColor: props.themeColor,
  133. color: 'black',
  134. fontSize: 20,
  135. fontWeight:500,
  136. display: 'flex',
  137. alignItems: 'center',
  138. justifyContent: 'center',
  139. }}
  140. />
  141. )
  142. }