formFields.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. import React from 'react';
  2. import Main from "../components/main/Main";
  3. import Doctors from "../components/specialists/Doctors";
  4. import Services from "../components/services/Services";
  5. import MoreInfo from "../components/specialists/MoreInfo";
  6. import Reviews from "../components/Reviews";
  7. import Admin from "../components/Admin/Admin";
  8. import Appointment from "../components/appointment/Appointment";
  9. import Auth from "../containers/auth";
  10. import User from "../containers/user";
  11. const PAGENOTFOUND = () => <div>PAGE 404 NOT FOUND</div>;
  12. export const logInForm = {
  13. form: {
  14. email: {
  15. id: 1,
  16. name: "email",
  17. type: "email",
  18. label: "Email",
  19. validation: {
  20. requred: {
  21. cb: v => v.trim() === ""
  22. }
  23. },
  24. fail: false,
  25. touch: false,
  26. value: ""
  27. },
  28. password: {
  29. id: 2,
  30. name: "password",
  31. type: "password",
  32. label: "Пароль",
  33. validation: {
  34. requred: {
  35. cb: v => v.trim() === ""
  36. },
  37. minL: {
  38. cb: v => v.trim().length < 6
  39. }
  40. },
  41. fail: false,
  42. touch: false,
  43. value: ""
  44. }
  45. },
  46. validForm: false
  47. };
  48. export const signUpForm = {
  49. form: {
  50. email: {
  51. id: 1,
  52. name: "email",
  53. type: "email",
  54. label: "Email",
  55. validation: {
  56. requred: {
  57. cb: v => v.trim() === ""
  58. }
  59. },
  60. fail: false,
  61. touch: false,
  62. value: ""
  63. },
  64. firstName: {
  65. id: 2,
  66. type: "text",
  67. name: "firstName",
  68. label: "Имя",
  69. validation: {
  70. requred: {
  71. cb: v => v.trim() === ""
  72. },
  73. regExp: {
  74. cb: v => !/^\w/.test(v)
  75. }
  76. },
  77. fail: false,
  78. touch: false,
  79. value: ""
  80. },
  81. lastName: {
  82. id: 3,
  83. type: "text",
  84. name: "lastName",
  85. label: "Фамилия",
  86. validation: {
  87. requred: {
  88. cb: v => v.trim() === ""
  89. }
  90. },
  91. fail: false,
  92. touch: false,
  93. value: ""
  94. },
  95. phone: {
  96. id: 4,
  97. type: "number",
  98. name: "phone",
  99. label: "Телефон",
  100. validation: {
  101. requred: {
  102. cb: v => v.trim() === ""
  103. }
  104. },
  105. fail: false,
  106. touch: false,
  107. value: ""
  108. },
  109. password: {
  110. id: 5,
  111. name: "password",
  112. type: "password",
  113. label: "Пароль",
  114. validation: {
  115. requred: {
  116. cb: v => v.trim() === ""
  117. },
  118. minL: {
  119. cb: v => v.trim().length < 6
  120. }
  121. },
  122. fail: false,
  123. touch: false,
  124. value: ""
  125. },
  126. confirmPassword: {
  127. id: 6,
  128. name: "confirmPassword",
  129. type: "password",
  130. label: "Повторите пароль",
  131. validation: {
  132. requred: {
  133. cb: v => v.trim() === ""
  134. },
  135. minL: {
  136. cb: v => v.trim().length < 6
  137. },
  138. match: {
  139. match: "password",
  140. cb: (v, m) => v !== m
  141. }
  142. },
  143. fail: false,
  144. touch: false,
  145. value: ""
  146. }
  147. },
  148. validForm: false
  149. };
  150. export const postNewDoctorForm =[
  151. {
  152. id:1,
  153. type:'text',
  154. value:"",
  155. name:'name',
  156. placeholder:'Введите ФИО сотрудника',
  157. required:true
  158. },
  159. {
  160. id:2,
  161. type:'text',
  162. value:"",
  163. name:'experience',
  164. placeholder:'Введите дату начала практики',
  165. required:true
  166. },
  167. {
  168. id:3,
  169. type:'text',
  170. value:"",
  171. name:'photo',
  172. placeholder:'Добавьте фотографию',
  173. required:true
  174. },
  175. {
  176. id:4,
  177. type:'text',
  178. value:"",
  179. name:'profession',
  180. placeholder:'Добавьте специализацию',
  181. required:true
  182. },
  183. {
  184. id:5,
  185. type:'text',
  186. value:"",
  187. name:'skillsDescription',
  188. placeholder:'Введите описание навыков здесь',
  189. required:true
  190. }
  191. ];
  192. export const postNewServiceForm =[
  193. {
  194. id:1,
  195. type:'text',
  196. value:"",
  197. name:'name',
  198. placeholder:'Введите название сервиса',
  199. required:true
  200. },
  201. {
  202. id:2,
  203. type:'text',
  204. value:"",
  205. name:'description',
  206. placeholder:'Введите описание сервиса',
  207. required:true
  208. },
  209. {
  210. id:3,
  211. type:'number',
  212. value:"",
  213. name:'duration',
  214. placeholder:'Введите длительность (часы)',
  215. required:true
  216. },
  217. {
  218. id:4,
  219. type:'number',
  220. value:"",
  221. name:'price',
  222. placeholder:'Введите стоимость сервиса',
  223. required:true
  224. }
  225. ];
  226. export const route = [
  227. {
  228. id: 1,
  229. exact: true,
  230. path: "/",
  231. protected: false,
  232. // hasAccess: [],
  233. component: Main
  234. },
  235. {
  236. id: 2,
  237. exact: true,
  238. path: "/doctors",
  239. protected: false,
  240. component: Doctors
  241. },
  242. {
  243. id: 3,
  244. exact: true,
  245. path: "/services",
  246. protected: false,
  247. component: Services
  248. },
  249. {
  250. id: 3,
  251. exact: true,
  252. path: "/doctors/:doctor",
  253. protected: false,
  254. component: MoreInfo
  255. },
  256. {
  257. id: 4,
  258. exact: true,
  259. path: "/services/:service",
  260. protected: false,
  261. component: MoreInfo
  262. },
  263. {
  264. id: 5,
  265. exact: true,
  266. path: "/reviews",
  267. protected: false,
  268. component: Reviews
  269. },
  270. {
  271. id: 6,
  272. exact: false,
  273. path: "/admin",
  274. protected: true,
  275. component: Admin
  276. },
  277. {
  278. id: 7,
  279. exact: true,
  280. path: "/appointment/:doctorId",
  281. protected: false,
  282. component: Appointment
  283. },
  284. {
  285. id: 8,
  286. exact: true,
  287. path: "/auth",
  288. protected: false,
  289. component: Auth
  290. },
  291. {
  292. id: 9,
  293. exact: false,
  294. path: "/user",
  295. protected: true,
  296. component: User
  297. },
  298. {
  299. id: 10,
  300. component: PAGENOTFOUND
  301. },
  302. ];