/
Index.vue
120 lines (109 loc) · 3.27 KB
/
Index.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<style scoped>
.home-box {
color: #4d4d4f;
height: 300px;
width: 300px;
}
@media (max-width: 480px) {
.home-box {
width: 100%;
}
}
.home-company {
left: -20px;
bottom: -20px;
}
@media (max-width: 480px) {
.home-company img {
bottom: 0;
}
}
.home-join {
left: 14px;
bottom: 11px;
}
@media (max-width: 480px) {
.home-join img {
bottom: 0;
}
}
</style>
<template>
<layout :no-menu="true" :notifications="notifications">
<div class="ph2 ph0-ns">
<!-- Blank state -->
<div v-show="employees.length == 0" class="cf mt4 mt5-l mw7 center">
<div class="fl w-100 w-25-m w-50-l pr2-l">
<inertia-link href="/company/create">
<div class="pa3-l">
<div class="br3 mb3 bg-white box pa3 tc relative home-box" data-cy="create-company-blank-state">
<h3>{{ $t('home.create_company') }}</h3>
<p>{{ $t('home.create_company_desc') }}</p>
<img loading="lazy" src="/img/home/create-company.png" class="home-company absolute" alt="create company button" />
</div>
</div>
</inertia-link>
</div>
<div class="fl w-100 w-25-m w-50-l">
<inertia-link href="/company/join">
<div class="pa3-l">
<div class="br3 mb3 bg-white box pa3 tc relative home-box">
<h3>{{ $t('home.join_company') }}</h3>
<p>{{ $t('home.join_company_desc') }}</p>
<img loading="lazy" src="/img/home/join-company.png" class="home-join absolute" alt="join company button" />
</div>
</div>
</inertia-link>
</div>
</div>
<!-- List of companies -->
<div v-show="employees.length != 0">
<div class="mt4 mt5-l mw7 center section-btn relative">
<p>
<span class="pr2">
{{ $t('home.companies_part_of') }}
</span>
<inertia-link href="/company/create" class="btn absolute db-l dn">
{{ $t('home.create_company_cta') }}
</inertia-link>
</p>
</div>
<div class="cf mt4 mw7 center">
<div v-for="employee in employees" :key="employee.id" class="fl w-100 w-25-m w-third-l pr2">
<inertia-link :href="'/' + employee.company_id + '/welcome'">
<div class="br3 mb3 bg-white box pa3 home-index-company fw5 relative" :data-cy="'company-' + employee.company_id">
{{ employee.company_name }}
<span class="absolute normal f6">
{{ $tc('home.number_of_employees', employee.number_of_employees, { count: employee.number_of_employees }) }}
</span>
</div>
</inertia-link>
</div>
</div>
<div class="w-100 dn-ns db mt2">
<inertia-link href="/company/create" class="btn br3 pa3 white no-underline bb-0 db tc">
{{ $t('home.create_company_cta') }}
</inertia-link>
</div>
</div>
</div>
</layout>
</template>
<script>
import Layout from '@/Shared/Layout';
export default {
components: {
Layout,
},
props: {
employees: {
type: Array,
default: null,
},
notifications: {
type: Array,
default: null,
},
},
};
</script>