🔧 AirDCPP Settings form WIP
This commit is contained in:
@@ -1 +1 @@
|
|||||||
LIBRARY_SOCKET_HOST=ws://import:3001
|
LIBRARY_SOCKET_HOST=import
|
||||||
@@ -11,40 +11,20 @@ export const AirDCPPSettingsForm = (): ReactElement => {
|
|||||||
validate={validate}
|
validate={validate}
|
||||||
render={({ handleSubmit }) => (
|
render={({ handleSubmit }) => (
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<h2>Simple Default Input</h2>
|
<h2>Hub Connection Information</h2>
|
||||||
<div>
|
<div className="field">
|
||||||
<label>First Name</label>
|
<label className="label">Hub URL</label>
|
||||||
<Field
|
<div className="control">
|
||||||
name="firstName"
|
<Field
|
||||||
component="input"
|
name="airdcpp_hostname"
|
||||||
placeholder="First Name"
|
component="input"
|
||||||
/>
|
className="input"
|
||||||
|
placeholder="adc://hub.url"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Render Function</h2>
|
<button type="submit" className="button is-primary">Submit</button>
|
||||||
<Field
|
|
||||||
name="bio"
|
|
||||||
render={({ input, meta }) => (
|
|
||||||
<div>
|
|
||||||
<label>Bio</label>
|
|
||||||
<textarea {...input} />
|
|
||||||
{meta.touched && meta.error && <span>{meta.error}</span>}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<h2>Render Function as Children</h2>
|
|
||||||
<Field name="phone">
|
|
||||||
{({ input, meta }) => (
|
|
||||||
<div>
|
|
||||||
<label>Phone</label>
|
|
||||||
<input type="text" {...input} placeholder="Phone" />
|
|
||||||
{meta.touched && meta.error && <span>{meta.error}</span>}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
|
|
||||||
<button type="submit">Submit</button>
|
|
||||||
</form>
|
</form>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import ZeroState from "./ZeroState";
|
|||||||
import { RecentlyImported } from "./RecentlyImported";
|
import { RecentlyImported } from "./RecentlyImported";
|
||||||
import { VolumeGroups } from "./VolumeGroups";
|
import { VolumeGroups } from "./VolumeGroups";
|
||||||
import { getComicBooks } from "../actions/fileops.actions";
|
import { getComicBooks } from "../actions/fileops.actions";
|
||||||
import { isEmpty } from "lodash";
|
import { isEmpty, isNil, isUndefined } from "lodash";
|
||||||
|
|
||||||
export const Dashboard = (): ReactElement => {
|
export const Dashboard = (): ReactElement => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -22,6 +22,9 @@ export const Dashboard = (): ReactElement => {
|
|||||||
const recentComics = useSelector(
|
const recentComics = useSelector(
|
||||||
(state: RootState) => state.fileOps.recentComics,
|
(state: RootState) => state.fileOps.recentComics,
|
||||||
);
|
);
|
||||||
|
const volumeGroups = useSelector(
|
||||||
|
(state: RootState) => state.fileOps.comicVolumeGroups,
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<section className="section">
|
<section className="section">
|
||||||
@@ -30,7 +33,7 @@ export const Dashboard = (): ReactElement => {
|
|||||||
{!isEmpty(recentComics) && !isEmpty(recentComics.docs) ? (
|
{!isEmpty(recentComics) && !isEmpty(recentComics.docs) ? (
|
||||||
<>
|
<>
|
||||||
<RecentlyImported comicBookCovers={recentComics} />
|
<RecentlyImported comicBookCovers={recentComics} />
|
||||||
<VolumeGroups />
|
{!isEmpty(volumeGroups) ? <VolumeGroups /> : null}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<ZeroState
|
<ZeroState
|
||||||
|
|||||||
Reference in New Issue
Block a user