-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashboard): add recent projects list to dashboard
- Loading branch information
1 parent
609190a
commit 475fb9b
Showing
17 changed files
with
173 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/components/recent-projects-list/RecentProjectsList.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.recent-projects-list { | ||
&__title { | ||
padding: $spacing-unit/2 $spacing-unit; | ||
font-weight: bold; | ||
} | ||
|
||
&__content { | ||
display: flex; | ||
gap: $spacing-unit * 2; | ||
padding: $spacing-unit; | ||
overflow-x: auto; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/components/recent-projects-list/RecentProjectsList.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<template> | ||
<div class="recent-projects-list"> | ||
<div class="recent-projects-list__title"> | ||
{{ $t("RecentProjectsList.title") }} | ||
</div> | ||
<div class="recent-projects-list__content"> | ||
<ProjectCard | ||
v-for="project in recentProjects" | ||
:key="project.id" | ||
:project="project" | ||
:actionMenu="false" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { ref, watchEffect } from "vue"; | ||
import { useProjects } from "@/state/projects"; | ||
// Components | ||
import ProjectCard from "@/components/project-card/ProjectCard"; | ||
export default { | ||
components: { | ||
ProjectCard | ||
}, | ||
setup() { | ||
const { userProjects } = useProjects(); | ||
const recentProjects = ref([]); | ||
watchEffect(() => { | ||
if (userProjects.value) { | ||
recentProjects.value = userProjects.value | ||
.slice() | ||
.sort((a, b) => (a.updatedAt < b.updatedAt ? 1 : -1)) | ||
.slice(0, 7); | ||
} | ||
}); | ||
return { | ||
recentProjects | ||
}; | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss" src="./RecentProjectsList.scss"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
.dashboard-view { | ||
&__head { | ||
display: grid; | ||
grid-template-columns: repeat( auto-fit, minmax(300px, 1fr) ); | ||
gap: $spacing-unit*2; | ||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); | ||
gap: $spacing-unit * 2; | ||
} | ||
|
||
&__main { | ||
display: flex; | ||
flex-direction: column; | ||
margin: $spacing-unit*2 0; | ||
margin: $spacing-unit * 2 0; | ||
padding: $spacing-unit; | ||
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); | ||
background-color: $color-white; | ||
|
||
.recent-projects-list { | ||
margin-top: $spacing-unit * 2; | ||
} | ||
} | ||
} |
Oops, something went wrong.