Skip to content

Dashboard #20

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
is-full-page
></loading>
<Layout>
<v-container>
<v-container fluid style="height: 100%;">
<router-view></router-view>
</v-container>
</Layout>
Expand Down
37 changes: 37 additions & 0 deletions src/components/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<v-card
class="mx-auto px-4"
height="100%"
>
<dashboard-header :breadcrumb-items="breadcrumbItems" :tab-items="tabItems">
<template v-slot:actions>
<slot name="header-actions"></slot>
</template>
</dashboard-header>

<dashboard-body />
</v-card>
</template>

<script>
import DashboardHeader from './DashboardHeader';
import DashboardBody from './DashboardBody';

export default {
name: 'Dashboard',
props: {
breadcrumbItems: Array,
tabItems: Array,
},
data: () => ({
}),
components: {
DashboardHeader,
DashboardBody,
},
};
</script>

<style scoped>

</style>
13 changes: 13 additions & 0 deletions src/components/DashboardBody.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<fragment></fragment>
</template>

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

<style scoped>

</style>
51 changes: 51 additions & 0 deletions src/components/DashboardHeader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<template>
<v-row justify="space-between">
<v-col xs="12" md="9">
<v-container>
<v-row>
<v-breadcrumbs :items="breadcrumbItems">
<template v-slot:divider>
<v-icon>mdi-forward</v-icon>
</template>
</v-breadcrumbs>
</v-row>
<v-row>
<v-col xs="12" md="6">
<v-tabs centered grow class="d-none d-md-flex">
<v-tab v-for="(item, index) in tabItems" :key="index" class="mx-auto">
{{ item.text }}
</v-tab>
</v-tabs>
<v-tabs vertical grow class="d-md-none">
<fragment v-for="(item, index) in tabItems" :key="index" :style="{width: '100%'}">
<v-tab class="ml-0">
{{ item.text }}
</v-tab>
</fragment>
</v-tabs>
</v-col>
</v-row>
</v-container>
</v-col>
<!-- <v-spacer></v-spacer>-->
<v-col xs="12" md="3" align-self="center">
<v-row>
<slot name="actions"></slot>
</v-row>
</v-col>
</v-row>
</template>

<script>
export default {
name: 'DashboardHeader',
props: {
breadcrumbItems: Array,
tabItems: Array,
},
};
</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 Dashboard } from './Dashboard';
39 changes: 36 additions & 3 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
<template>
<HelloWorld />
<dashboard :breadcrumb-items="breadcrumbItems" :tab-items="tabItems">
<template v-slot:header-actions>
<v-btn class="mx-4">Go to test</v-btn>
<v-btn class="mx-4">Go to test</v-btn>
</template>
</dashboard>
</template>

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

export default {
name: 'Home',
components: {
HelloWorld,
Dashboard,
},
data: () => ({
breadcrumbItems: [
{
text: 'Tests',
disabled: false,
href: 'breadcrumbs_dashboard',
},
{
text: 'OpenRank Software Developer Hiring Test',
disabled: false,
href: 'breadcrumbs_link_1',
},
{
text: 'Library - OpenRank',
disabled: true,
href: 'breadcrumbs_link_2',
},
],
tabItems: [
{
text: 'OpenRank questions',
},
{
text: 'My company questions',
},
],
}),
};
</script>