Skip to content

Commit

Permalink
Merge pull request #100 from innovationacademy-kr/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
42inshin authored Mar 20, 2024
2 parents 8342fc1 + bfc76d4 commit ee9c40b
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 17 deletions.
22 changes: 8 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-YTMN5V74G8"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "G-YTMN5V74G8");
</script>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="shortcut icon" href="logo.png" />
Expand Down Expand Up @@ -69,5 +55,13 @@
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script type="text/javascript" src="//wcs.naver.net/wcslog.js"></script>
<script type="text/javascript">
if (!wcs_add) var wcs_add = {};
wcs_add["wa"] = "152eaf5cd6101c0";
if (window.wcs) {
wcs_do();
}
</script>
</body>
</html>
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"pinia": "^2.0.28",
"swiper": "^9.0.5",
"vue": "^3.2.45",
"vue-gtag": "^2.0.1",
"vue-router": "^4.1.6"
},
"devDependencies": {
Expand Down
8 changes: 7 additions & 1 deletion src/components/Login/LoginButton.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
<script setup lang="ts">
import LoadingAnimation from "@/components/common/LoadingAnimation.vue";
import { ref } from "vue";
import { event } from "vue-gtag";
const ORIGIN_URL = window.location.origin;
const BACKEND_URL = import.meta.env.VITE_APP_API_URL;
const isClicked = ref(false);
const handleClick = () => {
isClicked.value = true;
event("login", { method: "42OAuth Login" });
};
</script>

<template>
<button class="button">
<LoadingAnimation v-if="isClicked" />
<a
v-else
@click="isClicked = true"
@click="handleClick"
:href="`${BACKEND_URL}/user/login/42?redirect=${ORIGIN_URL}/auth`"
>LOG IN</a
>
Expand Down
14 changes: 12 additions & 2 deletions src/components/calendar/AccMonth.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { useMonthLogStore } from "@/stores/monthlog";
import { ref, watch } from "vue";
import { event } from "vue-gtag";
const { getMonthAccTimeText, getMonthAcceptedTimeText, showLogs } =
useMonthLogStore();
Expand All @@ -12,13 +13,22 @@ watch(showLogs, () => {
monthText.value = getMonthAccTimeText();
acceptedMonthText.value = getMonthAcceptedTimeText();
});
const handleClick = () => {
isClicked.value = !isClicked.value;
event("click", {
event_category: "Buttons",
event_label: "Click acceptTime Button",
value: 1,
});
};
</script>

<template>
<div v-if="!isClicked" @click="isClicked = !isClicked" class="month">
<div v-if="!isClicked" @click="handleClick" class="month">
총 {{ monthText.hour }}시간 {{ monthText.minute }}분
</div>
<div v-else @click="isClicked = !isClicked" class="month acceptTime">
<div v-else @click="handleClick" class="month acceptTime">
인정 시간 {{ acceptedMonthText.hour }}시간 {{ acceptedMonthText.minute }}분
</div>
</template>
Expand Down
17 changes: 17 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";
import VueGtag from "vue-gtag";

import "./assets/main.css";

Expand All @@ -11,4 +12,20 @@ const app = createApp(App);
app.use(createPinia());
app.use(router);

// env Product에만 추적 ID를 저장하여 운영서버만 활성화
if (import.meta.env.VITE_GA_ID) {
app.use(
VueGtag,
{
config: {
id: `${import.meta.env.VITE_GA_ID}`,
params: {
send_page_view: false, // config 코드를 로드시에 해당 페이지를 전송 유무
},
},
},
router
);
}

app.mount("#app");

0 comments on commit ee9c40b

Please sign in to comment.