Skip to content

Commit

Permalink
Merge pull request #95 from innovationacademy-kr/develop
Browse files Browse the repository at this point in the history
Develop to main with #93
  • Loading branch information
42inshin authored Feb 14, 2024
2 parents 3733f4d + 5a11b22 commit d3ab836
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/home/FoldCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ChevronIcon from "@/components/icons/IconChevron.vue";
import CircleProgress from "@/components/home/CircleProgress.vue";
import LoadingAnimationVue from "@/components/common/LoadingAnimation.vue";
import { useHomeStore } from "@/stores/home";
import { getStorage, saveStorage } from "@/utils/localStorage";
const props = defineProps<{
hour: number;
Expand All @@ -20,7 +21,7 @@ const {
} = useHomeStore();
const isLoading = ref(getIsLoading());
const isOpen = ref(false);
const isOpen = ref(getStorage("isDayCardOpen") || false);
const goalTimeSet = () => {
if (props.isMonth) {
return Number(getGoalMonthHour());
Expand Down Expand Up @@ -51,6 +52,7 @@ const culculatePercent = () => {
const clickHandler = () => {
isOpen.value = !isOpen.value;
saveStorage("isDayCardOpen", isOpen.value);
if (isOpen.value) {
colorSet.value = false;
} else {
Expand Down
10 changes: 8 additions & 2 deletions src/components/home/FoldCardCompact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ref, watch } from "vue";
import ChevronIcon from "@/components/icons/IconChevron.vue";
import LoadingAnimationVue from "@/components/common/LoadingAnimation.vue";
import { useHomeStore } from "@/stores/home";
import { getStorage, saveStorage } from "@/utils/localStorage";
const props = defineProps<{
hour: number;
Expand All @@ -14,7 +15,7 @@ const props = defineProps<{
const { getIsLoading } = useHomeStore();
const isLoading = ref(getIsLoading());
const isOpen = ref(false);
const isOpen = ref(getStorage("isMonthCardOpen") || false);
watch(getIsLoading, (val) => {
isLoading.value = val;
Expand All @@ -25,11 +26,16 @@ const checkColor = () => {
return "#ffffff";
}
};
const clickHandler = () => {
isOpen.value = !isOpen.value;
saveStorage("isMonthCardOpen", isOpen.value);
};
</script>

<template>
<div class="wrap" :class="{ on: isOpen, primaryColor: !isOpen }">
<div class="textWrap use tapHighlight" @click="isOpen = !isOpen">
<div class="textWrap use tapHighlight" @click="clickHandler">
<h2>
<slot name="title"></slot>
</h2>
Expand Down

0 comments on commit d3ab836

Please sign in to comment.