Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tdemin committed Nov 25, 2019
1 parent 94d6914 commit 57625bb
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 30 deletions.
38 changes: 14 additions & 24 deletions src/main.tsx
Expand Up @@ -46,30 +46,20 @@ class App extends React.Component<Props, Props> {
const token = this.state.token as string;
const loggedIn = token.length !== 0;
return (
<div className="app">
<Router>
{!loggedIn && (
<Switch>
<Route
path="/signup"
exact
component={SignupForm}
/>
<Route path="/" exact component={LoginForm} />
</Switch>
)}
{loggedIn && (
<Switch>
<Route path="/" exact component={MainView} />
<Route
path="/task/:id"
exact
component={EditorView}
/>
</Switch>
)}
</Router>
</div>
<Router>
{!loggedIn && (
<Switch>
<Route path="/signup" exact component={SignupForm} />
<Route path="/" exact component={LoginForm} />
</Switch>
)}
{loggedIn && (
<Switch>
<Route path="/" exact component={MainView} />
<Route path="/task/:id" exact component={EditorView} />
</Switch>
)}
</Router>
);
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/bulma/button.tsx
Expand Up @@ -3,9 +3,9 @@ import React, { FC, InputHTMLAttributes } from "react";
/** Encapsulates `<input type="button">`. */
export const Button: FC<InputHTMLAttributes<HTMLInputElement>> = (props) => (
<input
{...props}
type="button"
className={"button ".concat(props.className as string)}
{...props}
>
{props.children}
</input>
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/bulma/control.tsx
Expand Up @@ -2,7 +2,7 @@ import React, { FC, HTMLAttributes } from "react";

/** Encapsulates `<div class="control">`. */
export const Control: FC<HTMLAttributes<HTMLDivElement>> = (props) => (
<div className={"control ".concat(props.className as string)} {...props}>
<div {...props} className={`control ${props.className}`}>
{props.children}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/bulma/field.tsx
Expand Up @@ -8,7 +8,7 @@ import { BulmaFieldProps } from "../../../typings/bulma";
export const Field: FC<HTMLAttributes<HTMLDivElement> & BulmaFieldProps> = (
props
) => (
<div className={"field ".concat(props.className as string)} {...props}>
<div {...props} className={"field ".concat(props.className as string)}>
<label className="label">{props.label}</label>
<Control>{props.control ? props.control : props.children}</Control>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/bulma/input.tsx
Expand Up @@ -10,9 +10,9 @@ export const Input: React.FC<InputHTMLAttributes<HTMLInputElement> & Props> = (
props
) => (
<input
{...(props as InputHTMLAttributes<HTMLInputElement>)}
type={props.password ? "password" : "text"}
className={"input ".concat(props.className as string)}
{...(props as InputHTMLAttributes<HTMLInputElement>)}
>
{props.children}
</input>
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/bulma/level.tsx
Expand Up @@ -12,7 +12,7 @@ export const Level: React.FC<HTMLAttributes<HTMLDivElement> & BP> = (props) => {
if (props.levelRight) classes.push("level-right");
if (props.isMobile) classes.push("is-mobile");
return (
<div className={`${classes.join(" ")} ${props.className}`} {...props}>
<div {...props} className={`${classes.join(" ")} ${props.className}`}>
{props.children}
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/views/signupForm.tsx
Expand Up @@ -15,7 +15,6 @@ import Message from "./components/message";
import strings from "./assets/locales";

import "./styles/signupForm.scss";
import { string } from "prop-types";

enum Status {
UNDEFINED,
Expand Down

0 comments on commit 57625bb

Please sign in to comment.