diff --git a/packages/fakeyou.com/src/components/common/Input/Input.scss b/packages/fakeyou.com/src/components/common/Input/Input.scss new file mode 100644 index 0000000000..20703f0a84 --- /dev/null +++ b/packages/fakeyou.com/src/components/common/Input/Input.scss @@ -0,0 +1,68 @@ +@import "scss/colours.scss"; + +.select__control { + &.select { + height: 48px; + border-width: 2px; + padding-left: 0.15rem; + padding-right: 0.15rem; + background-color: $input-dark; + border-radius: 0.5rem; + border-color: $input-dark !important; + box-shadow: none; + cursor: pointer; + + &.no-padding { + padding-left: 0.5rem; + } + + &:hover { + background-color: lighten($input-dark, 5%); + border-color: lighten($input-dark, 5%) !important; + } + + &.focused { + border-color: $primary !important; + } + + &.with-icon { + padding-left: 2rem; + } + + &.rounded-full { + border-radius: 50px; + } + } + + &.select-option { + background-color: $input-dark; + cursor: pointer; + padding: 0.5rem 1rem; + + &:hover { + background-color: lighten($input-dark, 8%); + } + } + + &.select-input, + &.select-value { + color: $white; + } + + &.select-placeholder { + color: $white !important; + } + + &.select-container { + background: $input-dark; + margin-top: 6px; + padding: 0; + border-radius: 0.5rem; + z-index: 3; + } + + &.select-separator { + width: 1px; + opacity: 0.3; + } +} diff --git a/packages/fakeyou.com/src/components/common/Input/Input.tsx b/packages/fakeyou.com/src/components/common/Input/Input.tsx index 547ce817ba..11dff877a5 100644 --- a/packages/fakeyou.com/src/components/common/Input/Input.tsx +++ b/packages/fakeyou.com/src/components/common/Input/Input.tsx @@ -1,13 +1,31 @@ import React from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import "./Input.scss"; +import { + default as ReactSelect, + Props as ReactSelectProps, +} from "react-select"; interface InputProps extends React.InputHTMLAttributes { icon?: IconDefinition; label?: string; + textArea?: boolean; } -export default function Input({ label, icon, ...rest }: InputProps) { +interface TextAreaProps + extends React.TextareaHTMLAttributes { + label?: string; + textArea?: boolean; +} + +interface SelectProps extends ReactSelectProps { + icon?: IconDefinition; + label?: string; + rounded?: boolean; +} + +export function Input({ label, icon, textArea, ...rest }: InputProps) { return (
{label && } @@ -21,3 +39,54 @@ export default function Input({ label, icon, ...rest }: InputProps) {
); } + +export function TextArea({ label, textArea, ...rest }: TextAreaProps) { + return ( +
+ {label && } + +
+