Add guest access for rooms

This commit is contained in:
Robert Long
2021-09-03 15:45:07 -07:00
parent 196c8eeeeb
commit 46f8eb84fc
11 changed files with 338 additions and 60 deletions

View File

@@ -1,6 +1,7 @@
import React, { forwardRef } from "react";
import classNames from "classnames";
import styles from "./Input.module.css";
import { ReactComponent as CheckIcon } from "./icons/Check.svg";
export function FieldRow({ children, rightAlign, className, ...rest }) {
return (
@@ -21,11 +22,23 @@ export function Field({ children, className, ...rest }) {
}
export const InputField = forwardRef(
({ id, label, className, ...rest }, ref) => {
({ id, label, className, type, checked, ...rest }, ref) => {
return (
<Field>
<input id={id} {...rest} ref={ref} />
<label htmlFor={id}>{label}</label>
<Field
className={classNames(
type === "checkbox" ? styles.checkboxField : styles.inputField,
className
)}
>
<input id={id} {...rest} ref={ref} type={type} checked={checked} />
<label htmlFor={id}>
{type === "checkbox" && (
<div className={styles.checkbox}>
<CheckIcon />
</div>
)}
{label}
</label>
</Field>
);
}