Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
concept-front-mojsprat-v2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Djordje Mutavdzic
concept-front-mojsprat-v2
Commits
73caab57
Commit
73caab57
authored
Oct 27, 2022
by
Djordje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Notification tab
parent
75f4065f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
21 deletions
+82
-21
ApplicationTab.tsx
src/components/ApplicationTab.tsx
+2
-1
Issue.tsx
src/components/Issues/Issue.tsx
+22
-19
Notification.tsx
src/components/Notifications/Notification.tsx
+42
-0
Notifications.tsx
src/components/Notifications/Notifications.tsx
+15
-0
Voting.tsx
src/components/Voting/Voting.tsx
+1
-1
No files found.
src/components/ApplicationTab.tsx
View file @
73caab57
...
@@ -6,6 +6,7 @@ import { getBuilding } from "../actions/data-manager";
...
@@ -6,6 +6,7 @@ import { getBuilding } from "../actions/data-manager";
import
{
JWT_TENANT
}
from
"../actions/network-manager"
;
import
{
JWT_TENANT
}
from
"../actions/network-manager"
;
import
{
BuildingInvoices
}
from
"./BuildingInvoices/BuildingInvoices"
;
import
{
BuildingInvoices
}
from
"./BuildingInvoices/BuildingInvoices"
;
import
{
Issues
}
from
"./Issues/Issues"
;
import
{
Issues
}
from
"./Issues/Issues"
;
import
{
Notifications
}
from
"./Notifications/Notifications"
;
import
{
Settings
}
from
"./Settings/Settings"
;
import
{
Settings
}
from
"./Settings/Settings"
;
import
{
Voting
}
from
"./Voting/Voting"
;
import
{
Voting
}
from
"./Voting/Voting"
;
...
@@ -42,7 +43,7 @@ export const ApplicationTab = () => {
...
@@ -42,7 +43,7 @@ export const ApplicationTab = () => {
{
building
&&
{
building
&&
<
Routes
>
<
Routes
>
<
Route
path=
'overview'
element=
{
<
div
>
Hello from overview
</
div
>
}
/>
<
Route
path=
'overview'
element=
{
<
div
>
Hello from overview
</
div
>
}
/>
<
Route
path=
'notifications'
element=
{
<
div
>
Hello from notifications
</
div
>
}
/>
<
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
buildingId=
{
buildingId
}
/>
}
/>
<
Route
path=
'voting'
element=
{
<
Voting
buildingId=
{
buildingId
}
/>
}
/>
<
Route
path=
'invoices'
element=
{
<
div
>
Hello from invoices
</
div
>
}
/>
<
Route
path=
'invoices'
element=
{
<
div
>
Hello from invoices
</
div
>
}
/>
...
...
src/components/Issues/Issue.tsx
View file @
73caab57
...
@@ -6,44 +6,44 @@ import { Card } from "../Card/Card";
...
@@ -6,44 +6,44 @@ import { Card } from "../Card/Card";
import
{
ExpandIcon
}
from
"../icons/ExpandIcon"
;
import
{
ExpandIcon
}
from
"../icons/ExpandIcon"
;
const
classes
=
{
const
classes
=
{
wrapp
er
:
{
head
er
:
{
display
:
'flex'
,
display
:
'flex'
,
flexDirection
:
'column'
,
flexDirection
:
'row'
,
gap
:
'50px'
,
alignItems
:
'center'
,
gap
:
'20px'
},
},
header
:
{
expandWrapper
:
{
fontWeight
:
600
,
marginLeft
:
'auto'
,
fontSize
:
'1.6em'
,
transition
:
'transform .25s'
,
},
description
:
{
display
:
'flex'
,
flexDirection
:
'column'
,
gap
:
'5px'
},
},
subheader
:
{
subheader
:
{
color
:
'gray'
,
color
:
'gray'
,
fontSize
:
'0.9rem'
fontSize
:
'0.9rem'
},
},
subject
:
{
title
:
{
fontSize
:
'1.2rem'
fontSize
:
'1.2rem'
},
},
button
:
{
marginLeft
:
'auto'
,
borderRadius
:
'50px'
}
}
as
const
;
}
as
const
;
export
const
Issue
=
({
issue
}:
{
issue
:
any
})
=>
{
export
const
Issue
=
({
issue
}:
{
issue
:
any
})
=>
{
const
[
expand
,
setExpand
]
=
useState
(
false
);
const
[
expand
,
setExpand
]
=
useState
(
false
);
const
{
t
}
=
useTranslation
();
const
{
t
}
=
useTranslation
();
return
(
return
(
<
Card
>
<
Card
>
<
Box
sx=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
gap
:
'20px'
}
}
>
<
Box
sx=
{
classes
.
header
}
>
<
Typography
sx=
{
classes
.
subject
}
>
{
issue
.
title
}
</
Typography
>
<
Typography
sx=
{
classes
.
title
}
>
{
issue
.
title
}
</
Typography
>
<
Box
sx=
{
{
marginLeft
:
'auto'
,
transition
:
'transform .25s'
,
transform
:
`rotate(${expand ? 180 : 0}deg)`
,
width
:
'20px'
}
}
onClick=
{
()
=>
{
setExpand
(
!
expand
)
}
}
>
<
Box
sx=
{
{
...
classes
.
expandWrapper
,
transform
:
`rotate(${expand ? 180 : 0}deg)`
,
width
:
'20px'
}
}
onClick=
{
()
=>
{
setExpand
(
!
expand
)
}
}
>
<
ExpandIcon
/>
<
ExpandIcon
/>
</
Box
>
</
Box
>
{
/* <Typography sx={{ marginLeft: 'auto', transition: 'transform .5s', transform: `rotate(${expand ? 180 : 0}deg)` }} onClick={() => { setExpand(!expand) }}>V</Typography> */
}
</
Box
>
</
Box
>
<
Box
sx=
{
{
display
:
'flex'
,
flexDirection
:
'column'
,
gap
:
'5px'
}
}
>
<
Box
sx=
{
classes
.
description
}
>
<
Typography
sx=
{
classes
.
subheader
}
>
Opis
</
Typography
>
<
Typography
sx=
{
classes
.
subheader
}
>
Opis
</
Typography
>
<
Typography
>
{
issue
.
description
}
</
Typography
>
<
Typography
>
{
issue
.
description
}
</
Typography
>
</
Box
>
</
Box
>
...
@@ -54,7 +54,10 @@ export const Issue = ({ issue }: { issue: any }) => {
...
@@ -54,7 +54,10 @@ export const Issue = ({ issue }: { issue: any }) => {
<
Typography
sx=
{
classes
.
subheader
}
>
Rešenja
</
Typography
>
<
Typography
sx=
{
classes
.
subheader
}
>
Rešenja
</
Typography
>
{
issue
.
solutions
.
map
((
solution
:
any
,
ind
:
number
)
=>
(
{
issue
.
solutions
.
map
((
solution
:
any
,
ind
:
number
)
=>
(
<
Box
key=
{
ind
}
>
<
Box
key=
{
ind
}
>
<
Typography
>
{
`${ind + 1}. ${solution.name} - ${t("priceFormat", { num: (solution.price) })}`
}
</
Typography
>
<
Box
sx=
{
{
display
:
'flex'
,
flexDirection
:
'row'
}
}
>
<
Typography
>
{
`${ind + 1}. ${solution.name}`
}
</
Typography
>
<
Typography
sx=
{
{
marginLeft
:
'auto'
,
fontWeight
:
'bold'
}
}
>
{
`${t("priceFormat", { num: (solution.price) })}`
}
</
Typography
>
</
Box
>
<
Typography
sx=
{
{
paddingLeft
:
'10px'
,
fontSize
:
'15px'
}
}
>
{
solution
.
description
||
'Opis resenja nije unet.'
}
</
Typography
>
<
Typography
sx=
{
{
paddingLeft
:
'10px'
,
fontSize
:
'15px'
}
}
>
{
solution
.
description
||
'Opis resenja nije unet.'
}
</
Typography
>
</
Box
>
</
Box
>
))
}
))
}
...
...
src/components/Notifications/Notification.tsx
0 → 100644
View file @
73caab57
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
{
Card
}
from
"../Card/Card"
;
const
classes
=
{
header
:
{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
gap
:
'20px'
},
expandWrapper
:
{
marginLeft
:
'auto'
,
transition
:
'transform .25s'
,
},
description
:
{
display
:
'flex'
,
flexDirection
:
'column'
,
gap
:
'5px'
},
subheader
:
{
color
:
'gray'
,
fontSize
:
'0.9rem'
},
title
:
{
fontSize
:
'1.2rem'
},
}
as
const
;
export
const
Notification
=
({
title
,
description
}:
{
title
:
string
,
description
:
string
})
=>
{
return
(
<
Card
>
<
Typography
sx=
{
classes
.
title
}
>
{
title
}
</
Typography
>
<
Box
sx=
{
classes
.
description
}
>
<
Typography
sx=
{
classes
.
subheader
}
>
Opis
</
Typography
>
<
Typography
>
{
description
}
</
Typography
>
</
Box
>
</
Card
>
);
}
\ No newline at end of file
src/components/Notifications/Notifications.tsx
0 → 100644
View file @
73caab57
import
{
TabWrapper
}
from
"../TabWrapper/TabWrapper"
;
import
{
Notification
}
from
"./Notification"
;
export
const
Notifications
=
({
notifications
}:
{
notifications
:
any
})
=>
{
return
(
<
TabWrapper
header=
"Obaveštenja"
>
{
notifications
.
map
((
notification
:
any
,
index
:
number
)
=>
(
<
Notification
title=
{
notification
.
title
}
description=
{
notification
.
description
}
/>
))
}
</
TabWrapper
>);
}
\ No newline at end of file
src/components/Voting/Voting.tsx
View file @
73caab57
...
@@ -94,7 +94,7 @@ export const Voting = ({ buildingId }: { buildingId: string }): JSX.Element => {
...
@@ -94,7 +94,7 @@ export const Voting = ({ buildingId }: { buildingId: string }): JSX.Element => {
<
FormControl
>
<
FormControl
>
<
FormLabel
>
Opcije
</
FormLabel
>
<
FormLabel
>
Opcije
</
FormLabel
>
<
RadioGroup
value=
{
selectedCandidateId
}
onChange=
{
(
event
)
=>
{
setSelectedCandidateId
(
event
.
target
.
value
)
}
}
>
<
RadioGroup
value=
{
selectedCandidateId
}
onChange=
{
(
event
)
=>
{
setSelectedCandidateId
(
event
.
target
.
value
)
}
}
>
{
voting
.
candidates
.
map
((
candidate
,
ind
:
number
)
=>
(<
FormControlLabel
value=
{
candidate
.
_id
}
control=
{
<
Radio
/>
}
label=
{
candidate
.
name
}
key=
{
ind
}
/>))
}
{
voting
.
candidates
.
map
((
candidate
,
ind
:
number
)
=>
(<
FormControlLabel
value=
{
candidate
.
_id
}
control=
{
<
Radio
size=
"small"
/>
}
label=
{
candidate
.
name
}
key=
{
ind
}
/>))
}
</
RadioGroup
>
</
RadioGroup
>
</
FormControl
>
</
FormControl
>
<
Button
variant=
'contained'
sx=
{
classes
.
button
}
disabled=
{
selectedCandidateId
===
''
}
onClick=
{
handleVote
}
>
Glasaj
</
Button
>
<
Button
variant=
'contained'
sx=
{
classes
.
button
}
disabled=
{
selectedCandidateId
===
''
}
onClick=
{
handleVote
}
>
Glasaj
</
Button
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment