Skip to content

Commit

Permalink
Merge pull request #36 from msvoro/Build-failed-due-to-warnings-#17
Browse files Browse the repository at this point in the history
Build-failed-due-to-warnings-#17 WIP
  • Loading branch information
jozef-slezak authored Jun 17, 2021
2 parents b17aa33 + c6bc697 commit 37cd9d1
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import * as serviceWorker from './serviceWorker';
import App from './App';
import sk from './compiled-lang/sk';
import en from './compiled-lang/en';
import sk from './compiled-lang/sk.json';
import en from './compiled-lang/en.json';
import {
createClient,
Provider,
Expand Down
4 changes: 3 additions & 1 deletion src/theme/shadows.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default [
const shadows = [
'none',
'0 0 0 1px rgba(63,63,68,0.05), 0 1px 2px 0 rgba(63,63,68,0.15)',
'0 0 1px 0 rgba(0,0,0,0.31), 0 2px 2px -2px rgba(0,0,0,0.25)',
Expand All @@ -25,3 +25,5 @@ export default [
'0 0 1px 0 rgba(0,0,0,0.31), 0 22px 34px -8px rgba(0,0,0,0.25)',
'0 0 1px 0 rgba(0,0,0,0.31), 0 24px 36px -8px rgba(0,0,0,0.25)'
];

export default shadows
4 changes: 3 additions & 1 deletion src/theme/typography.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
const typography = {
h1: {
fontWeight: 500,
fontSize: 35,
Expand Down Expand Up @@ -33,3 +33,5 @@ export default {
fontWeight: 500
}
};

export default typography
4 changes: 3 additions & 1 deletion src/utils/getInitials.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export default (name = '') => name
const getInitials = (name = '') => name
.replace(/\s+/, ' ')
.split(' ')
.slice(0, 2)
.map((v) => v && v[0].toUpperCase())
.join('');

export default getInitials
16 changes: 8 additions & 8 deletions src/views/customer/CustomerListView/UpdateCustomer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ const UpdateCustomer: React.FC<UpdateProps> = ({ customer, handleClose }) => {
const [newEmail, setNewEmail] = React.useState<string>(null);
const [newPhoneNumber, setNewPhoneNumber] = React.useState<string>(null);
const [state, executeMutation] = useUpdateCustomerMutation();

const updateCustomerItems = [
executeMutation,
customer?.id,
newName ? newName : customer?.name,
newEmail ? newEmail : customer?.email,
newPhoneNumber ? newPhoneNumber : customer?.phone,
]
const submit = React.useCallback(() => {
executeMutation({
"id": customer?.id,
Expand All @@ -41,13 +47,7 @@ const UpdateCustomer: React.FC<UpdateProps> = ({ customer, handleClose }) => {
"phone": newPhoneNumber ? newPhoneNumber : customer?.phone,
})
handleClose();
}, [
executeMutation,
customer?.id,
newName ? newName : customer?.name,
newEmail ? newEmail : customer?.email,
newPhoneNumber ? newPhoneNumber : customer?.phone,
])
}, [updateCustomerItems])

return (
<Box maxWidth={500} maxHeight={400} className={classes.box}>
Expand Down
4 changes: 3 additions & 1 deletion src/views/customer/CustomerListView/data.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { v4 as uuid } from 'uuid';

export default [
const data = [
{
id: uuid(),
address: {
Expand Down Expand Up @@ -142,3 +142,5 @@ export default [
phone: '801-301-7894'
}
];

export default data
2 changes: 1 addition & 1 deletion src/views/customer/CustomerListView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const CustomerListView = () => {
const classes = useStyles();
const [searchCustomer, setSearchCustomer] = useState("");
const search = "%" + searchCustomer + "%";
const [result, _reexecuteQuery1] = useSearchCustomersQuery({
const [result] = useSearchCustomersQuery({
variables: { search }
})
const { data, error, fetching } = result;
Expand Down
4 changes: 3 additions & 1 deletion src/views/product/ProductListView/data.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { v4 as uuid } from 'uuid';

export default [
const data = [
{
id: uuid(),
createdAt: '27/03/2019',
Expand Down Expand Up @@ -50,3 +50,5 @@ export default [
totalDownloads: '835'
}
];

export default data
2 changes: 0 additions & 2 deletions src/views/test/DetailPageCodegen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import {
TextField,
Avatar,
Card,
CardHeader,
CardContent,
Grid
} from '@material-ui/core';
import { useFormik } from 'formik';
import { Customer } from './Customer';
export var FormikComponent: React.FC<Customer> = customer => {
const intl = useIntl();
const formik = useFormik({
initialValues: {
avatarUrl: customer.avatarUrl,
Expand Down

0 comments on commit 37cd9d1

Please sign in to comment.