Merge pull request #56 from dderbentsov/UC-21

Добавил нейминг компонента, изменил ширину сайдбара и название переменных
This commit is contained in:
frontgavrilin
2022-10-24 12:59:03 +03:00
committed by GitHub
3 changed files with 29 additions and 20 deletions

View File

@@ -21,10 +21,10 @@
--time-indicator-color: #e93131 --time-indicator-color: #e93131
--font-obligatory-color: #ff0000 --font-obligatory-color: #ff0000
--bg-event-box-color: rgba(37, 40, 80, 0.1) --bg-event-box-color: rgba(37, 40, 80, 0.1)
--bg-event-meeting-color: #24D07D --bg-event-green-color: #24d07d
--bg-event-planning-color: #E93131 --bg-event-red-color: #e93131
--bg-event-interview-color: #E5E931 --bg-event-yellow-color: #e5e931
--bg-event-work-color: #3BA3EE --bg-event-blue-color: #3ba3ee
--light-grey-bg-color: #f8f9fa --light-grey-bg-color: #f8f9fa
--btn-green-color: rgba(60, 217, 75, 1) --btn-green-color: rgba(60, 217, 75, 1)
--btn-light-green-color: rgba(60, 217, 75, 0.2) --btn-light-green-color: rgba(60, 217, 75, 0.2)

View File

@@ -1,6 +1,6 @@
<template lang="pug"> <template lang="pug">
.calendar-container.flex(:style="{ width: `calc(100% - ${currentWidth})` }") .calendar-container.flex
calendar-sidebar(@width='changeWidth' :team="team") calendar-sidebar(@width="changeWidth" :team="team")
calendar-schedule( calendar-schedule(
:current-date="currentDate" :current-date="currentDate"
:time-information="timeInformation" :time-information="timeInformation"
@@ -56,7 +56,7 @@ export default {
.then((res) => this.saveEventsData(res)); .then((res) => this.saveEventsData(res));
}, },
changeWidth(value) { changeWidth(value) {
this.currentWidth = value.width; this.currentWidth = value;
}, },
}, },
mounted() { mounted() {

View File

@@ -1,6 +1,6 @@
<template lang="pug"> <template lang="pug">
.sidebar.flex.flex-col.bg-white .sidebar.flex.flex-col.bg-white
.sidebar-wrapper.h-full.my-13px(:style="{ width: windowSidebar }") .sidebar-wrapper.h-full.my-13px(:style="sidebarWidth")
.sidebar-content.items-center.flex.flex-col.gap-y-8.px-4.py-19px .sidebar-content.items-center.flex.flex-col.gap-y-8.px-4.py-19px
base-button-plus base-button-plus
.flex.flex-col.items-center .flex.flex-col.items-center
@@ -19,6 +19,7 @@
import BaseButtonPlus from "../../../components/base/buttons/BaseButtonPlus.vue"; import BaseButtonPlus from "../../../components/base/buttons/BaseButtonPlus.vue";
import BaseOpenButton from "../../../components/base/buttons/BaseOpenButton.vue"; import BaseOpenButton from "../../../components/base/buttons/BaseOpenButton.vue";
export default { export default {
name: "CalendarSidebar",
components: { components: {
BaseButtonPlus, BaseButtonPlus,
BaseOpenButton, BaseOpenButton,
@@ -29,16 +30,15 @@ export default {
data() { data() {
return { return {
events: [ events: [
{ id: 1, color: "var(--bg-event-meeting-color)" }, { id: 1, color: "var(--bg-event-green-color)" },
{ id: 2, color: "var(--bg-event-planning-color)" }, { id: 2, color: "var(--bg-event-red-color)" },
{ id: 3, color: "var(--bg-event-interview-color)" }, { id: 3, color: "var(--bg-event-yellow-color)" },
{ id: 4, color: "var(--bg-event-work-color)" }, { id: 4, color: "var(--bg-event-blue-color)" },
], ],
widthSidebarOpen: "152px", widthSidebarOpen: "232px",
widthSidebarClose: "312px", widthSidebarClose: "72px",
isOpen: false, isOpen: false,
turnButton: "180deg", turnButton: "180deg",
windowSidebar: "72px",
}; };
}, },
computed: { computed: {
@@ -47,22 +47,31 @@ export default {
"button-styled": true, "button-styled": true,
}; };
}, },
sidebarWidth() {
if (this.isOpen) {
return {
width: this.widthSidebarOpen,
};
}
return {
width: this.widthSidebarClose,
};
},
}, },
methods: { methods: {
changeSize() { changeSize() {
this.isOpen = !this.isOpen; this.isOpen = !this.isOpen;
this.$emit("width", { this.$emit(
width: this.isOpen ? this.widthSidebarClose : this.widthSidebarOpen, "width",
}); this.isOpen ? this.widthSidebarOpen : this.widthSidebarClose
);
this.turnButton = this.isOpen ? "0deg" : "180deg"; this.turnButton = this.isOpen ? "0deg" : "180deg";
this.windowSidebar = this.isOpen ? "232px" : "72px";
}, },
}, },
}; };
</script> </script>
<style lang="sass" scoped> <style lang="sass" scoped>
.sidebar-wrapper .sidebar-wrapper
border-left: 2px solid var(--btn-blue-color-3) border-left: 2px solid var(--btn-blue-color-3)
.button-plus .button-plus