Skip to content

Commit

Permalink
Merge pull request #2 from aulasoftwarelibre/animal-cc
Browse files Browse the repository at this point in the history
Add attribution field
  • Loading branch information
sgomez authored Sep 27, 2020
2 parents 8d93aa6 + 740130d commit 049234c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
19 changes: 16 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import * as React from 'react';
import { Admin, Resource } from 'react-admin';
import { FirebaseAuthProvider, FirebaseDataProvider } from 'react-admin-firebase';
import {
FirebaseAuthProvider,
FirebaseDataProvider,
} from 'react-admin-firebase';

import { AnimalCreate, AnimalEdit, AnimalList, AnimalShow } from './animals';
import CustomLoginPage from './CustomLoginPage';
import { firebaseConfig as config } from './FIREBASE_CONFIG';
import { JourneyCreate, JourneyEdit, JourneyList, JourneyShow } from './journeys';
import { ModalitiesCreate, ModalitiesEdit, ModalitiesList, ModalitiesShow } from './modalities';
import {
JourneyCreate,
JourneyEdit,
JourneyList,
JourneyShow,
} from './journeys';
import {
ModalitiesCreate,
ModalitiesEdit,
ModalitiesList,
ModalitiesShow,
} from './modalities';

const options = {
logging: true,
Expand Down
20 changes: 11 additions & 9 deletions src/animals.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
DeleteButton,
Edit,
EditButton,
FileInput,
Filter,
ImageField,
ImageInput,
List,
SelectInput,
Show,
Expand Down Expand Up @@ -58,8 +58,8 @@ export const AnimalEdit = (props) => (
<Edit {...props}>
<SimpleForm redirect="show">
<TextInput disabled source="id" />
<TextInput label="Nombre" source="name" />
<SelectInput
<TextInput fullWidth label="Nombre" source="name" />
<SelectInput fullWidth
label="Tipo"
source="type"
choices={[
Expand All @@ -68,18 +68,19 @@ export const AnimalEdit = (props) => (
]}
/>
<BooleanInput source="isEnabled" />
<FileInput source="image" label="Imagen" accept="image/*">
<ImageInput source="image" label="Imagen" accept="image/*">
<ImageField source="src" title="image" />
</FileInput>
</ImageInput>
<TextInput fullWidth multiline label="Atribución" source="attribution" />
</SimpleForm>
</Edit>
);

export const AnimalCreate = (props) => (
<Create {...props}>
<SimpleForm>
<TextInput label="Nombre" source="name" />
<SelectInput
<TextInput fullWidth label="Nombre" source="name" />
<SelectInput fullWidth
label="Tipo"
source="type"
choices={[
Expand All @@ -88,9 +89,10 @@ export const AnimalCreate = (props) => (
]}
/>
<BooleanInput source="isEnabled" />
<FileInput source="image" label="Imagen" accept="image/*">
<ImageInput source="image" label="Imagen" accept="image/*">
<ImageField source="src" title="image" />
</FileInput>
</ImageInput>
<TextInput fullWidth multiline label="Atribución" source="attribution" />
</SimpleForm>
</Create>
);

0 comments on commit 049234c

Please sign in to comment.