diff --git a/package.json b/package.json index 19fe047f..c0138d8b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "migrate": "./node_modules/.bin/mm migrate", "rollback": "./node_modules/.bin/mm down", "heroku-postbuild": "npm run migrate && ./node_modules/.bin/gulp prod --production", - "test-server": "tsc -P ./src/server/tsconfig.json --outDir /tmp" + "test-server": "tsc -P ./src/server/tsconfig.json --outDir /tmp", + "lint": "npx tslint --project ." }, "homepage": "https://github.com/UCSDTESC/Check-in#readme", "dependencies": { diff --git a/src/client/components/Fields.tsx b/src/client/components/Fields.tsx index a6c9a354..b8d5f34f 100644 --- a/src/client/components/Fields.tsx +++ b/src/client/components/Fields.tsx @@ -1,5 +1,5 @@ import { UserDiversityOptions, UserYearOptions, UserGenderOptions, UserShirtSizeOptions } from '@Shared/UserEnums'; -import React from 'react'; +import React, { FunctionComponent } from 'react'; import { Field, WrappedFieldProps } from 'redux-form'; import majors from '~/static/Majors.json'; @@ -12,6 +12,44 @@ export type CustomFieldProps = WrappedFieldProps & { maxLength?: number; }; +type ApplicationColProps = { + className?: string; +}; + +type ApplicationLabelProps = { + required?: boolean; + className?: string; + forTag?: string; + // hack? + children?: string | JSX.Element[] | JSX.Element; +}; + +export type ApplicationInputProps = { + className?: string; + name?: string; + placeholder?: string; + type?: string; + normalize?: (value: any, previousValue: any) => void; +}; + +export type ApplicationTextAreaProps = { + name?: string; + placeholder?: string; + maxLength?: number; + className?: string; +}; + +type ApplicationRadioProps = { + name?: string; + value?: any; + label?: string; + className?: string; +}; + +type ApplicationMonthPickerProps = { + name?: string; +}; + /** * Defines all of the custom fields for the application. * Anything beginning with "error" contains a label which renders the error, and @@ -26,6 +64,18 @@ export function createRow(...content: any[]) { ); } +export const ApplicationRow: FunctionComponent = (props) => ( +