Commit 20b47c84 authored by Djordje's avatar Djordje

Fix navbar overlap and documents dates, add translations for payment order, remove overview tab

parent fa7f194c
...@@ -27,7 +27,7 @@ export const ApplicationTab = ({ building, selectedUnit }: { building: any, sele ...@@ -27,7 +27,7 @@ export const ApplicationTab = ({ building, selectedUnit }: { building: any, sele
return ( return (
<Box sx={classes.wrapper}> <Box sx={classes.wrapper}>
<Routes> <Routes>
<Route path='overview' element={<div>Hello from overview</div>} /> {/* <Route path='overview' element={<div>Hello from overview</div>} /> */}
<Route path='notifications' element={<Notifications notifications={building.notifications} />} /> <Route path='notifications' element={<Notifications notifications={building.notifications} />} />
<Route path='issues' element={<Issues issues={building.issues} />} /> <Route path='issues' element={<Issues issues={building.issues} />} />
<Route path='voting' element={<Voting />} /> <Route path='voting' element={<Voting />} />
......
...@@ -57,7 +57,7 @@ export const DocumentsList = ({ documents }: { documents: any }) => { ...@@ -57,7 +57,7 @@ export const DocumentsList = ({ documents }: { documents: any }) => {
{documents.map((payable: any) => ( {documents.map((payable: any) => (
<TableRow key={payable._id} sx={classes.tableBody}> <TableRow key={payable._id} sx={classes.tableBody}>
<TableCell align="left">{payable.name} </TableCell> <TableCell align="left">{payable.name} </TableCell>
<TableCell align="center">{t("formatDate", { date: new Date(payable.created) })}</TableCell> <TableCell align="center">{!!payable.created ? t("formatDate", { date: new Date(payable.created) }) : 'Nepoznat datum'}</TableCell>
<TableCell align="center"><a href={payable.link}>{(payable.link.includes('dropboxusercontent')) ? <DownloadIcon /> : <LinkIcon />} </a></TableCell> <TableCell align="center"><a href={payable.link}>{(payable.link.includes('dropboxusercontent')) ? <DownloadIcon /> : <LinkIcon />} </a></TableCell>
</TableRow> </TableRow>
))} ))}
......
...@@ -85,7 +85,7 @@ export const LoginForm = () => { ...@@ -85,7 +85,7 @@ export const LoginForm = () => {
} }
localStorage.setItem(JWT_TENANT, res); localStorage.setItem(JWT_TENANT, res);
navigate('../tenant/overview'); navigate('../tenant/notifications');
} }
const handleKeyUp = (event: React.KeyboardEvent<HTMLDivElement>): void => { const handleKeyUp = (event: React.KeyboardEvent<HTMLDivElement>): void => {
......
...@@ -9,4 +9,5 @@ ...@@ -9,4 +9,5 @@
padding: 0.5vh; padding: 0.5vh;
display: flex; display: flex;
align-items: center; align-items: center;
z-index: 1;
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ import { SubMenu } from "../../internal-types"; ...@@ -2,7 +2,7 @@ import { SubMenu } from "../../internal-types";
import { ActivityIcon } from "../icons/ActivityIcon"; import { ActivityIcon } from "../icons/ActivityIcon";
import { BuidlingInvoicesIcon } from "../icons/BuildingInvoicesIcon"; import { BuidlingInvoicesIcon } from "../icons/BuildingInvoicesIcon";
import { DocumentIcon } from "../icons/DocumentIcon"; import { DocumentIcon } from "../icons/DocumentIcon";
import { HomeIcon } from "../icons/HomeIcon"; // import { HomeIcon } from "../icons/HomeIcon";
import { InvoicesIcon } from "../icons/InvoicesIcon"; import { InvoicesIcon } from "../icons/InvoicesIcon";
import { LanguageIcon } from "../icons/LanguageIcon"; import { LanguageIcon } from "../icons/LanguageIcon";
import { NotificationIcon } from "../icons/NotificationIcon"; import { NotificationIcon } from "../icons/NotificationIcon";
...@@ -14,7 +14,7 @@ export const subMenu: SubMenu[] = [ ...@@ -14,7 +14,7 @@ export const subMenu: SubMenu[] = [
{ {
title: 'Main menu', title: 'Main menu',
items: [ items: [
{ title: 'Overview', icon: <HomeIcon />, path: 'overview' }, // { title: 'Overview', icon: <HomeIcon />, path: 'overview' },
{ title: 'Notifications', icon: <NotificationIcon />, path: 'notifications' }, { title: 'Notifications', icon: <NotificationIcon />, path: 'notifications' },
{ title: 'Issues', icon: <ActivityIcon />, path: 'issues' }, { title: 'Issues', icon: <ActivityIcon />, path: 'issues' },
{ title: 'Voting', icon: <VotingIcon />, path: 'voting' } { title: 'Voting', icon: <VotingIcon />, path: 'voting' }
......
...@@ -42,24 +42,24 @@ export const PaymentOrder = ({ recipient, debit, bankAccount, payReference }: { ...@@ -42,24 +42,24 @@ export const PaymentOrder = ({ recipient, debit, bankAccount, payReference }: {
return ( return (
<Card> <Card>
<Typography sx={classes.title}>Nalog za uplatu</Typography> <Typography sx={classes.title}>{t('Payment order')}</Typography>
<Box sx={classes.mainContainer}> <Box sx={classes.mainContainer}>
<Box sx={classes.itemsContainer}> <Box sx={classes.itemsContainer}>
<PaymentOrderItem flex={1} label="Uplatilac" size="large" value={`${tenantInfo.firstName} ${tenantInfo.lastName}`} /> <PaymentOrderItem flex={1} label="Payer" size="large" value={`${tenantInfo.firstName} ${tenantInfo.lastName}`} />
<PaymentOrderItem flex={1} label="Svrha uplate" size="large" /> <PaymentOrderItem flex={1} label="Purpose of payment" size="large" />
<PaymentOrderItem flex={1} label="Primalac" size="large" value={recipient} /> <PaymentOrderItem flex={1} label="Recipient" size="large" value={recipient} />
</Box> </Box>
<Divider sx={classes.divider} orientation="vertical" variant="middle" flexItem /> <Divider sx={classes.divider} orientation="vertical" variant="middle" flexItem />
<Box sx={classes.itemsContainer}> <Box sx={classes.itemsContainer}>
<Box sx={classes.itemsGroup}> <Box sx={classes.itemsGroup}>
<PaymentOrderItem flex={1} label='sifra placanja' size="small" value='221' /> <PaymentOrderItem flex={1} label='payment code' size="small" value='221' />
<PaymentOrderItem flex={1} label='valuta' size="small" value="RSD" /> <PaymentOrderItem flex={1} label='currency' size="small" value="RSD" />
<PaymentOrderItem flex={4} label='iznos' size="small" value={t("nalog", { num: (debit > 0 ? debit : 0) })} /> <PaymentOrderItem flex={4} label='amount' size="small" value={t("nalog", { num: (debit > 0 ? debit : 0) })} />
</Box> </Box>
<PaymentOrderItem flex={1} label='Racun primaoca' size="small" value={bankAccount} /> <PaymentOrderItem flex={1} label="Recipient's account" size="small" value={bankAccount} />
<Box sx={classes.itemsGroup}> <Box sx={classes.itemsGroup}>
<PaymentOrderItem flex={1} label='model' size="small" value='00' /> <PaymentOrderItem flex={1} label='model' size="small" value='00' />
<PaymentOrderItem flex={4} label='poziv na broj' size="small" value={payReference.replaceAll('-', '')} /> <PaymentOrderItem flex={4} label='Invoice Id' size="small" value={payReference.replaceAll('-', '')} />
</Box> </Box>
<div style={{ marginLeft: "auto", maxWidth: 80 }}> <div style={{ marginLeft: "auto", maxWidth: 80 }}>
<QRCode <QRCode
......
import { Box, Button, Typography } from "@mui/material"; import { Box, Button, Typography } from "@mui/material";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next";
import { CopyIcon } from "../icons/CopyIcon"; import { CopyIcon } from "../icons/CopyIcon";
const classes = { const classes = {
...@@ -34,10 +35,11 @@ const classes = { ...@@ -34,10 +35,11 @@ const classes = {
export const PaymentOrderItem = ({ flex, label, value, size }: { flex: number, label: string, value?: string, size: string }) => { export const PaymentOrderItem = ({ flex, label, value, size }: { flex: number, label: string, value?: string, size: string }) => {
const [hovered, setHovered] = useState(false); const [hovered, setHovered] = useState(false);
const { t } = useTranslation();
return ( return (
<Box sx={{ flex, ...classes.mainContainer }}> <Box sx={{ flex, ...classes.mainContainer }}>
<Typography variant={size === 'large' ? 'body2' : 'caption'}>{label}</Typography> <Typography variant={size === 'large' ? 'body2' : 'caption'}>{t(label)}</Typography>
<Box <Box
sx={{ minHeight: size === 'large' ? '40px' : '25px', ...classes.valueContainer }} sx={{ minHeight: size === 'large' ? '40px' : '25px', ...classes.valueContainer }}
onMouseEnter={() => { setHovered(true); }} onMouseEnter={() => { setHovered(true); }}
......
...@@ -58,7 +58,7 @@ export const TenantInvoices = ({ building, unit }: { building: any, unit: any }) ...@@ -58,7 +58,7 @@ export const TenantInvoices = ({ building, unit }: { building: any, unit: any })
return { invoices, bankAccount, lastUnpaid, payReference }; return { invoices, bankAccount, lastUnpaid, payReference };
}, [building.finance, unit.invoices]); }, [building.finance, unit.invoices]);
const { t, i18n } = useTranslation(); const { t } = useTranslation();
const [info, setInfo] = useState<Test>(getInfo()); const [info, setInfo] = useState<Test>(getInfo());
...@@ -93,13 +93,11 @@ export const TenantInvoices = ({ building, unit }: { building: any, unit: any }) ...@@ -93,13 +93,11 @@ export const TenantInvoices = ({ building, unit }: { building: any, unit: any })
{info.invoices.length === 0 && <Typography sx={classes.noRecords} >{t('No records')}</Typography>} {info.invoices.length === 0 && <Typography sx={classes.noRecords} >{t('No records')}</Typography>}
</TableContainer> </TableContainer>
</Card> </Card>
{i18n.language === 'sr' &&
<PaymentOrder <PaymentOrder
recipient={building.name} recipient={building.name}
debit={unit.debit} debit={unit.debit}
bankAccount={info.bankAccount} bankAccount={info.bankAccount}
payReference={info.payReference} /> payReference={info.payReference} />
}
</TabWrapper> </TabWrapper>
); );
} }
\ No newline at end of file
...@@ -43,6 +43,15 @@ ...@@ -43,6 +43,15 @@
"per group/per unit":"per group", "per group/per unit":"per group",
"per unit/per unit": "per unit", "per unit/per unit": "per unit",
"per unit/per area": "per area", "per unit/per area": "per area",
"Payment order": "Payment order",
"Payer": "Payer",
"Purpose of payment": "Purpose of payment",
"Recipient": "Recipient",
"payment code": "payment code",
"currency": "currency",
"amount": "amount",
"Recipient's account": "Recipient's account",
"model": "model",
"Name": "Name", "Name": "Name",
"Action": "Action", "Action": "Action",
......
...@@ -46,6 +46,15 @@ ...@@ -46,6 +46,15 @@
"per group/per unit":"ukupno", "per group/per unit":"ukupno",
"per unit/per unit": "po stanu", "per unit/per unit": "po stanu",
"per unit/per area": "po kvadraturi", "per unit/per area": "po kvadraturi",
"Payment order": "Nalog za uplatu",
"Payer": "Uplatilac",
"Purpose of payment": "Svrha uplate",
"Recipient": "Primalac",
"payment code": "sifra plaćanja",
"currency": "valuta",
"amount": "iznos",
"Recipient's account": "Račun primaoca",
"model": "model",
"Name": "Naziv", "Name": "Naziv",
"Action": "Akcija", "Action": "Akcija",
......
...@@ -13,7 +13,7 @@ i18next ...@@ -13,7 +13,7 @@ i18next
.use(LanguageDetector) .use(LanguageDetector)
.init({ .init({
resources, resources,
debug: true, debug: false,
fallbackLng: 'sr', fallbackLng: 'sr',
detection: { detection: {
order: ['localStorage', 'navigator'], order: ['localStorage', 'navigator'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment