typescript src/room (#437)

This commit is contained in:
Timo 2022-08-02 00:46:16 +02:00 committed by GitHub
commit 2d99acabe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 465 additions and 284 deletions

View file

@ -14,9 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React, { ReactNode } from "react";
import React, { HTMLAttributes } from "react";
import { Link } from "react-router-dom";
import classNames from "classnames";
import * as H from "history";
import {
variantToClassName,
@ -24,19 +25,21 @@ import {
ButtonVariant,
ButtonSize,
} from "./Button";
interface Props {
className?: string;
variant?: ButtonVariant;
interface Props extends HTMLAttributes<HTMLAnchorElement> {
children: JSX.Element | string;
to: H.LocationDescriptor | ((location: H.Location) => H.LocationDescriptor);
size?: ButtonSize;
children: ReactNode;
[index: string]: unknown;
variant?: ButtonVariant;
className?: string;
}
export function LinkButton({
className,
variant,
size,
children,
to,
size,
variant,
className,
...rest
}: Props) {
return (
@ -46,6 +49,7 @@ export function LinkButton({
sizeToClassName[size],
className
)}
to={to}
{...rest}
>
{children}