[Refacotr] Button styles

This commit is contained in:
Matej Glasnák committed 2023-02-02 08:36:02 +01:00
1 parent cd2127e028
commit d5900b605e
6 files changed
+51 -25

No files matched your search

@@ -1,18 +1,44 @@
.button.primary
background: #7f39fb !important
border-radius: 4px !important
color: #fff !important
height: 50px
width: 100%
flex: 0 0 auto
:root
--color-primary: #7F39FB
--color-primary-contrast: #ffffff
--color-primary-shade: #5716c6
.button.secondary
color: #6200EE
border: 1px solid #E0E0E0
border-radius: 4px
height: 50px
width: 203px
.button
height: 50px !important
min-width: 203px
border-radius: 4px !important
border-width: 1px
&.half
width: 50%
&.block
width: 100%
&.primary
background-color: var(--color-primary)
border-color: var(--color-primary)
color: var(--color-primary-contrast)
&:hover,
&:active
background-color: var(--color-primary-shade)
border-color: var(--color-primary-shade)
color: var(--color-primary-contrast)
&.outline
background-color: var(--color-primary-contrast)
border-color: var(--color-primary)
color: var(--color-primary)
&:hover,
&:active
background-color: var(--color-primary-shade)
border-color: var(--color-primary-shade)
color: var(--color-primary-contrast)
.button.cancel
height: 50px
width: 100%
border: thin solid rgba(var(--v-border-color), var(--v-border-opacity)) !important
color: #7f39fb !important
@@ -3,7 +3,7 @@
<W-loadable :content="masterTask" class="h-100">
<v-card v-if="editMode" height="100%" class="d-flex flex-column scrolling">
<div class="d-flex justify-space-between align-center modal-header">
<h1>{{ masterTask.id ? 'Upraviť master task' : 'Vytvoriť master task' }}</h1>
<h1>{{ masterTask?.id ? 'Upraviť master task' : 'Vytvoriť master task' }}</h1>
<v-icon
@click.stop="closeModal()"
icon="mdi-close"
@@ -215,7 +215,7 @@
</v-col>
<v-col cols="7">
<v-sheet class="ma-2">
<p>{{ (masterTask.duration).toFixed(2) }} h</p>
<p>{{ masterTask?.duration?.toFixed(2) }} h</p>
</v-sheet>
</v-col>
</v-row>
@@ -233,7 +233,7 @@
</v-col>
<v-col cols="7">
<v-sheet class="ma-2">
<p :class="masterTask.worked_time > masterTask.duration ? 'text-red-darken-4': 'text-black'">{{ (masterTask.worked_time).toFixed(2) }} h</p>
<p :class="masterTask.worked_time > masterTask.duration ? 'text-red-darken-4': 'text-black'">{{ (masterTask.worked_time)?.toFixed(2) }} h</p>
</v-sheet>
</v-col>
</v-row>
@@ -251,7 +251,7 @@
</v-col>
<v-col cols="7">
<v-sheet class="ma-2">
<p :class="masterTask.worked_time > masterTask.duration ? 'text-red-darken-4': 'text-black'">{{ (masterTask.duration - masterTask.worked_time).toFixed(2) }} h</p>
<p :class="masterTask.worked_time > masterTask.duration ? 'text-red-darken-4': 'text-black'">{{ (masterTask.duration - masterTask.worked_time)?.toFixed(2) }} h</p>
</v-sheet>
</v-col>
</v-row>
@@ -375,7 +375,7 @@ export default {
this.employees = tmUtils.enrichEmployeesByFullName(employees)
if (masterTask?.id) {
this.masterTask = await this.$axios.get_auth_data(`v1/master-tasks/${masterTask.id}`)
this.masterTask = await this.$axios.get_auth_data(`v1/mastertasks/${masterTask.id}`)
this.teamSelect = this.masterTask.team.id
} else {
this.masterTask = {team: {}, employees: []}
@@ -393,7 +393,7 @@ export default {
try {
if (this.masterTask.id)
await this.$axios.patch_auth(`v1/master-tasks/${this.masterTask.id}`, this.masterTask)
await this.$axios.put_auth(`v1/mastertasks/${this.masterTask.id}`, this.masterTask)
else
await this.$axios.post_auth('v1/mastertasks', this.masterTask)
@@ -11,8 +11,8 @@
></v-icon>
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center">
<v-btn class="button primary" variant="flat" @click="deleteTask()">ÁNO</v-btn>
<v-btn class="ml-7 button cancel" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
<v-btn class="button primary half" variant="flat" @click="deleteTask()">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
@@ -418,7 +418,7 @@ export default {
try {
if (this.task.id) {
await this.$axios.patch_auth(`v1/master-tasks/${this.task.id}`, this.task)
await this.$axios.put_auth(`v1/mastertasks/${this.task.id}`, this.task)
} else {
await this.$axios.post_auth('v1/mastertasks', this.task)
}
@@ -9,8 +9,8 @@
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center">
<v-btn class="button primary" variant="flat" @click="deleteTeam()">ÁNO</v-btn>
<v-btn class="ml-7 button cancel" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
<v-btn class="button primary half" variant="flat" @click="deleteTeam()">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
@@ -55,7 +55,7 @@
/>
</v-card-actions>
<v-btn class="button primary" @click="save()">{{ team.id ? 'UPRAVIŤ' : 'VYTVORIŤ' }}</v-btn>
<v-btn class="button primary block" @click="save()">{{ team.id ? 'UPRAVIŤ' : 'VYTVORIŤ' }}</v-btn>
</v-card>
</W-loadable>
</v-dialog>