Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Dev work for #9 #10

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/components/DataDetails.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<v-card
:loading="false"
class="mx-auto my-12"
>
<v-card-title>
<slot name="title"></slot>
</v-card-title>
<v-card-text>
<slot></slot>
</v-card-text>
<v-divider class="mx-4"></v-divider>
<v-card-actions>
<slot name="actions"></slot>
</v-card-actions>
</v-card>
</template>

<script>
export default {
name: 'Card',
};
</script>

<style scoped>

</style>
27 changes: 27 additions & 0 deletions src/components/DataFilter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<v-card
:loading="false"
class="mx-auto my-12"
>
<v-card-title>
<slot name="title"></slot>
</v-card-title>
<v-card-text>
<slot></slot>
</v-card-text>
<v-divider class="mx-4"></v-divider>
<v-card-actions>
<slot name="actions"></slot>
</v-card-actions>
</v-card>
</template>

<script>
export default {
name: 'Card',
};
</script>

<style scoped>

</style>
110 changes: 110 additions & 0 deletions src/components/DataListContainer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<template>
<v-container fluid>
pbteja1998 marked this conversation as resolved.
Show resolved Hide resolved
<v-data-iterator
:items="items"
:items-per-page.sync="itemsPerPage"
:footer-props="{ itemsPerPageOptions }"
>
<template v-slot:default="props">
<template v-for="(item, index) in props.items">
<component
:is="getChildComponent(item.child)"
v-bind="item.props"
:key="index">
</component>
</template>
</template>
</v-data-iterator>
</v-container>
</template>

<script>
import QuestionListItem from './QuestionListItem';

const dummyData = [
{
props: {
title: 'Frozen Yogurt',
category: 'Coding',
tags: ['some', 'random', 'tag'],
},
},
{
props: {
title: 'Frozen Yogurt',
category: 'Coding',
tags: ['some', 'random', 'tag'],
},
},
{
props: {
title: 'Frozen Yogurt',
category: 'Coding',
tags: ['some', 'random', 'tag'],
subCategory: 'Some categ',
},
},
{

props: {
title: 'Frozen Yogurt',
category: 'Coding',
tags: ['some', 'random', 'tag'],
},
},
{

props: {
title: 'Frozen Yogurt',
category: 'Coding',
tags: ['some', 'random', 'tag'],
subCategory: 'Some categ',
},
},
{

props: {
title: 'Frozen Yogurt',
category: 'Coding',
tags: ['some', 'random', 'tag'],
subCategory: 'Some categ',
},
},
{

props: {
title: 'Frozen Yogurt',
category: 'Coding',
tags: ['some', 'random', 'tag'],
},
},
{

props: {
title: 'Frozen Yogurt',
category: 'Coding',
tags: ['some', 'random', 'tag'],
subCategory: 'Some categ',
},
},
];

export default {
name: 'DataListContainer',
data: () => ({
pbteja1998 marked this conversation as resolved.
Show resolved Hide resolved
childComponent: QuestionListItem,
itemsPerPageOptions: [4, 8, 12],
itemsPerPage: 4,
items: dummyData,
pbteja1998 marked this conversation as resolved.
Show resolved Hide resolved
}),
methods: {
getChildComponent(child) {
return child || this.childComponent;
},
pbteja1998 marked this conversation as resolved.
Show resolved Hide resolved
},
};
</script>

<style scoped>

</style>
57 changes: 57 additions & 0 deletions src/components/QuestionListItem.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<template>
<v-card
class="mx-auto"
:flat="isFlat"
:outlined="isOutlined"
:width="width"
:height="height"
>
<v-card-title>{{title}}</v-card-title>
<v-card-text>Category: {{category}}</v-card-text>
<span class="ml-4">
<v-icon left>mdi-label</v-icon>
<v-chip
v-for="(tag, index) in tags"
:key="index"
class="ma-2"
label
>
{{tag}}
</v-chip>
</span>
<br/>
<v-chip class="ml-4 mb-2" v-if="subCategory">{{subCategory}}</v-chip>
</v-card>
</template>

<script>
export default {
name: 'QuestionListItem',
props: {
title: String,
category: String,
tags: Array,
subCategory: String,
isFlat: {
type: Boolean,
default: true,
},
isOutlined: {
type: Boolean,
default: true,
},
width: {
value: [Number, String],
default: '100%',
},
height: {
value: [Number, String],
default: 'auto',
},
},
};
</script>

<style scoped>

</style>
1 change: 1 addition & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export { default as FormAlerts } from './FormAlerts';
export { default as FormFields } from './FormFields';
export { default as FormButtons } from './FormButtons';
export { default as CustomForm } from './CustomForm';
export { default as DataListContainer } from './DataListContainer';
6 changes: 6 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Register,
Login,
Profile,
Dashboard,
} from '../views';

Vue.use(Router);
Expand Down Expand Up @@ -39,5 +40,10 @@ export default new Router({
name: 'profile',
component: Profile,
},
{
path: '/dashboard',
name: 'dashboard',
component: Dashboard,
pbteja1998 marked this conversation as resolved.
Show resolved Hide resolved
},
],
});
23 changes: 23 additions & 0 deletions src/views/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<v-row>
<v-col cols="3">

</v-col>
<v-col cols="6">
pbteja1998 marked this conversation as resolved.
Show resolved Hide resolved
<DataListContainer />
pbteja1998 marked this conversation as resolved.
Show resolved Hide resolved
</v-col>
<v-col cols="3">

</v-col>
</v-row>
</template>
pbteja1998 marked this conversation as resolved.
Show resolved Hide resolved

<script>
import { DataListContainer } from '../components';

export default {
components: {
DataListContainer,
},
};
</script>
1 change: 1 addition & 0 deletions src/views/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export { default as About } from './About';
export { default as Login } from './Login';
export { default as Register } from './Register';
export { default as Profile } from './Profile';
export { default as Dashboard } from './Dashboard';