Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
idatt2106_2024_02_frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IDATT2106 - Gruppe 2
idatt2106_2024_02_frontend
Commits
b15874ae
Commit
b15874ae
authored
10 months ago
by
Ina Martini
Browse files
Options
Downloads
Patches
Plain Diff
fix: add sparecomponent
parent
a4a3c37e
No related branches found
No related tags found
3 merge requests
!66
Final merge
,
!49
Create spare component
,
!4
Pipeline fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/ProfileView.vue
+21
-23
21 additions, 23 deletions
src/views/ProfileView.vue
with
21 additions
and
23 deletions
src/views/ProfileView.vue
+
21
−
23
View file @
b15874ae
<
script
lang=
"ts"
setup
>
import
authInterceptor
from
'
@/services/authInterceptor
'
import
{
computed
,
onMounted
,
ref
}
from
'
vue
'
import
{
onMounted
,
ref
}
from
'
vue
'
import
type
{
Profile
}
from
'
@/types/profile
'
import
CardTemplate
from
'
@/views/CardTemplate.vue
'
import
InteractiveSpare
from
'
@/components/InteractiveSpare.vue
'
import
type
{
Challenge
}
from
'
@/types/challenge
'
import
type
{
Goal
}
from
'
@/types/goal
'
import
CardGoal
from
'
@/components/CardGoal.vue
'
import
router
from
'
@/router
'
import
SpareComponent
from
"
@/components/SpareComponent.vue
"
;
const
profile
=
ref
<
Profile
>
()
const
completedGoals
=
ref
<
Goal
[]
>
([])
const
completedChallenges
=
ref
<
Challenge
[]
>
([])
const
isModalOpen
=
ref
(
false
)
const
speech
=
ref
<
string
[]
>
([])
const
newSpeechAvailable
=
ref
(
false
)
onMounted
(
async
()
=>
{
await
authInterceptor
(
'
/profile
'
)
...
...
@@ -41,12 +42,15 @@ onMounted(async () => {
})
})
const
welcome
=
computed
(()
=>
{
return
[
`Velkommen,
${
profile
.
value
?.
firstName
}
${
profile
.
value
?.
lastName
}
!`
]
})
const
openSpare
=
()
=>
{
let
welcomeSpeechShown
=
localStorage
.
getItem
(
'
welcomeSpeechShown
'
);
const
openInteractiveSpare
=
()
=>
{
isModalOpen
.
value
=
true
if
(
!
welcomeSpeechShown
)
{
speech
.
value
=
[
`Velkommen,
${
profile
.
value
?.
firstName
}
${
profile
.
value
?.
lastName
}
!`
,
'
Her kan du finne en oversikt over dine profilinstillinger!
'
,
'
Du kan også se dine fullførte sparemål og utfordringer!
'
]
localStorage
.
setItem
(
'
welcomeSpeechShown
'
,
'
true
'
);
}
}
</
script
>
...
...
@@ -92,21 +96,15 @@ const openInteractiveSpare = () => {
</div>
<div
class=
"flex flex-col"
>
<InteractiveSpare
:png-size=
"10"
:speech=
"welcome"
direction=
"left"
:isModalOpen=
"isModalOpen"
/>
<div
class=
"flex items-center"
>
<a
@
click=
"openInteractiveSpare"
class=
"hover:bg-transparent z-20"
>
<img
alt=
"Spare"
class=
"scale-x-[-1] md:h-5/6 md:w-5/6 w-2/3 h-2/3 cursor-pointer ml-14 md:ml-10"
src=
"@/assets/spare.png"
/>
</a>
</div>
<SpareComponent
:speech=
"speech"
:png-size=
"15"
:imageDirection=
"'left'"
:direction=
"'right'"
:notification=
"newSpeechAvailable"
@
openSpare=
"openSpare"
class=
"mb-5"
></SpareComponent>
<div
class=
"flex flex-row justify-between mx-4"
>
<p
class=
"font-bold"
>
Fullførte sparemål
</p>
<a
class=
"hover:p-0 cursor-pointer"
v-text=
"'Se alle'"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment