Skip to content

Commit cc00213

Browse files
committed
Projects components destrucutring and BPs
1 parent d33940e commit cc00213

File tree

4 files changed

+44
-58
lines changed

4 files changed

+44
-58
lines changed

src/components/ProjectSingle.vue

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
11
<template>
2-
<div></div>
2+
<router-link
3+
to="/projects/single-project"
4+
class="rounded-3xl shadow-lg hover:shadow-xl cursor-pointer mb-10 sm:mb-0 bg-secondary-light dark:bg-ternary-dark"
5+
aria-label="Single Project"
6+
>
7+
<div>
8+
<img
9+
:src="project.img"
10+
:alt="project.title"
11+
class="rounded-t-3xl border-none"
12+
/>
13+
</div>
14+
<div class="text-center px-4 py-6">
15+
<p
16+
class="text-2xl text-ternary-dark dark:text-ternary-light font-semibold mb-2"
17+
>
18+
{{ project.title }}
19+
</p>
20+
<span class="text-lg text-ternary-dark dark:text-ternary-light">{{
21+
project.category
22+
}}</span>
23+
</div>
24+
</router-link>
325
</template>
426

527
<script>
6-
export default {};
28+
export default {
29+
props: ['project'],
30+
};
731
</script>
832

933
<style lang="scss" scoped></style>

src/components/Projects.vue renamed to src/components/ProjectsGrid.vue

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,21 @@
66
<p
77
class="text-2xl sm:text-5xl font-semibold mb-3 text-ternary-dark dark:text-ternary-light"
88
>
9-
Projects Portfolio
9+
{{ projectsHeading }}
1010
</p>
1111
<p class="text-md sm:text-xl text-gray-500 dark:text-ternary-light">
12-
Some of the projects I have successfully completed
12+
{{ projectsDescription }}
1313
</p>
1414
</div>
1515
<!-- Projects grid title end -->
1616

1717
<!-- Projects grid start -->
1818
<div class="grid grid-cols-1 sm:grid-cols-3 mt-16 sm:gap-10">
19-
<router-link
19+
<ProjectSingle
2020
v-for="project in projects"
2121
:key="project.id"
22-
to="/projects/single-project"
23-
class="rounded-3xl shadow-lg hover:shadow-xl cursor-pointer mb-10 sm:mb-0 bg-secondary-light dark:bg-ternary-dark"
24-
aria-label="Single Project"
25-
>
26-
<div>
27-
<img
28-
:src="project.img"
29-
:alt="project.title"
30-
class="rounded-t-3xl border-none"
31-
/>
32-
</div>
33-
<div class="text-center px-4 py-6">
34-
<p
35-
class="text-2xl text-ternary-dark dark:text-ternary-light font-semibold mb-2"
36-
>
37-
{{ project.title }}
38-
</p>
39-
<span
40-
class="text-lg text-ternary-dark dark:text-ternary-light"
41-
>{{ project.category }}</span
42-
>
43-
</div>
44-
</router-link>
22+
:project="project"
23+
/>
4524
</div>
4625
<!-- Projects grid end -->
4726

@@ -61,16 +40,21 @@
6140

6241
<script>
6342
import feather from 'feather-icons';
43+
import ProjectSingle from './ProjectSingle.vue';
6444
6545
export default {
6646
name: 'Projects',
47+
components: { ProjectSingle },
6748
data() {
6849
return {
50+
projectsHeading: 'Projects Portfolio',
51+
projectsDescription:
52+
'Some of the projects I have successfully completed',
6953
projects: [
7054
{
7155
id: 1,
7256
title: 'Google Health Platform',
73-
category: 'Wen Application',
57+
category: 'Web Application',
7458
img: require('@/assets/images/web-project-2.jpg'),
7559
},
7660
{

src/views/Home.vue

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,21 @@
55
<!-- Banner snd -->
66

77
<!-- Projects start -->
8-
<Projects />
8+
<ProjectsGrid />
99
<!-- Projects end -->
1010
</div>
1111
</template>
1212

1313
<script>
14-
import feather from 'feather-icons';
1514
import AppBanner from '@/components/AppBanner';
16-
import Projects from '../components/Projects.vue';
15+
import ProjectsGrid from '../components/ProjectsGrid.vue';
1716
1817
export default {
1918
name: 'Home',
2019
components: {
2120
AppBanner,
22-
Projects,
21+
ProjectsGrid,
2322
},
24-
data: () => {
25-
return {};
26-
},
27-
mounted() {
28-
feather.replace();
29-
},
30-
updated() {
31-
feather.replace();
32-
},
33-
methods: {},
3423
};
3524
</script>
3625

src/views/Projects.vue

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
11
<template>
22
<div class="container mx-auto">
33
<!-- Projects start -->
4-
<Projects />
5-
<!-- Projects end -->
4+
<ProjectsGrid />
5+
<!-- ProjectsGrid end -->
66
</div>
77
</template>
88

99
<script>
10-
import feather from 'feather-icons';
11-
import Projects from '../components/Projects.vue';
10+
import ProjectsGrid from '../components/ProjectsGrid.vue';
1211
1312
export default {
1413
name: 'Projects',
1514
components: {
16-
Projects,
15+
ProjectsGrid,
1716
},
18-
data: () => {
19-
return {};
20-
},
21-
mounted() {
22-
feather.replace();
23-
},
24-
updated() {
25-
feather.replace();
26-
},
27-
methods: {},
2817
};
2918
</script>
3019

0 commit comments

Comments
 (0)