Skip to content

Commit

Permalink
Fixing style on Owner.js
Browse files Browse the repository at this point in the history
Related to issue #4
Related to issue #2

Signed-off-by: João Paulo Ferreira <[email protected]>
  • Loading branch information
iamferreirajp committed Apr 22, 2017
1 parent c7e2d2e commit 0f323fa
Showing 1 changed file with 64 additions and 22 deletions.
86 changes: 64 additions & 22 deletions src/Categories/Owners.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ DeleteButton, ReferenceInput, SelectInput, SimpleForm, TextInput, TabbedForm, Fo

const OwnerFilter = props => (
<Filter {...props}>
<TextInput label="Pesquisar" source="q" alwaysOn />
<TextInput
label="Pesquisar"
source="q"
alwaysOn
/>
<ReferenceInput label="Proprietário" source="id" reference="owner" allowEmpty>
<SelectInput source="id" optionText="ownerName" />
<SelectInput
source="id"
optionText="ownerName"
/>
</ReferenceInput>
</Filter>
);
Expand All @@ -30,10 +37,22 @@ export const OwnerList = props => (
}
medium={
<Datagrid>
<TextField source="id" label="ID" />
<TextField source="ownerName" label="Nome" />
<TextField source="ownerLastName" label="Sobrenome" />
<TextField source="ownerPhoneNumber" label="Telefone" />
<TextField
source="id"
label="ID"
/>
<TextField
source="ownerName"
label="Nome"
/>
<TextField
source="ownerLastName"
label="Sobrenome"
/>
<TextField
source="phoneNumber"
label="Telefone"
/>
<EditButton />
<DeleteButton />
</Datagrid>
Expand All @@ -44,11 +63,7 @@ export const OwnerList = props => (
export const OwnerCreate = props => (
<Create {...props}>
<SimpleForm>
<TextInput
source="ownerID"
label="ID"
/>
<TextInput
<TextInput
source="cpf"
label="CPF"
validation={TextInputValidation}
Expand Down Expand Up @@ -92,22 +107,49 @@ export const OwnerCreate = props => (
</Create>
);

const OwnerName = ({ record }) => {
return <span>Proprietário {record ? `"${record.ownerName}"` : ''}</span>;
const OwnerName = ({ owner }) => {
return <span>Proprietário {owner ? `"${owner.ownerName}"` : ''}</span>;
};

export const OwnerEdit = props => (
<Edit title={<OwnerName />} {...props}>
<SimpleForm>
<TextInput source="ownerID" label="ID" />
<TextInput source="cpf" label="CPF" />
<TextInput source="ownerName" label="Primeiro Nome" />
<TextInput source="ownerLastName" label="Sobrenome" />
<TextInput source="phoneNumber" label="Telefone" />
<TextInput source="zipCode" label="Código Postal" />
<TextInput source="district" label="Estado" />
<TextInput source="publicPlace" label="Endereço" />
<TextInput source="addressNumber" label="Número" />
<TextInput
source="ownerID"
label="ID"
/>
<TextInput
source="cpf"
label="CPF"
/>
<TextInput
source="ownerName"
label="Primeiro Nome"
/>
<TextInput
source="ownerLastName"
label="Sobrenome"
/>
<TextInput
source="phoneNumber"
label="Telefone"
/>
<TextInput
source="zipCode"
label="Código Postal"
/>
<TextInput
source="district"
label="Estado"
/>
<TextInput
source="publicPlace"
label="Endereço"
/>
<TextInput
source="addressNumber"
label="Número"
/>
</SimpleForm>
</Edit>
);

0 comments on commit 0f323fa

Please sign in to comment.