Skip to content

Commit 9fc5f6c

Browse files
committed
Use shared types
1 parent e4047f7 commit 9fc5f6c

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

apps/web-roo-code/src/components/CookieConsentWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React, { useState, useEffect } from "react"
44
import ReactCookieConsent from "react-cookie-consent"
55
import { Cookie } from "lucide-react"
66
import { getDomain } from "tldts"
7-
import { CONSENT_COOKIE_NAME } from "@/lib/constants"
7+
import { CONSENT_COOKIE_NAME } from "@roo-code/types"
88
import { dispatchConsentEvent } from "@/lib/analytics/consent-manager"
99

1010
/**

apps/web-roo-code/src/lib/analytics/consent-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { getCookieConsentValue } from "react-cookie-consent"
7-
import { CONSENT_COOKIE_NAME } from "../constants"
7+
import { CONSENT_COOKIE_NAME } from "@roo-code/types"
88

99
export const CONSENT_EVENT = "cookieConsentChanged"
1010

apps/web-roo-code/src/lib/constants.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,3 @@ export const EXTERNAL_LINKS = {
3030
export const INTERNAL_LINKS = {
3131
PRIVACY_POLICY_WEBSITE: "/privacy",
3232
}
33-
34-
// Cookie consent settings
35-
export const CONSENT_COOKIE_NAME = "roo-code-cookie-consent"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Cookie consent constants and types
3+
* Shared across all Roo Code repositories
4+
*/
5+
6+
/**
7+
* The name of the cookie that stores user's consent preference
8+
* Used by react-cookie-consent library
9+
*/
10+
export const CONSENT_COOKIE_NAME = "roo-code-cookie-consent"
11+
12+
/**
13+
* Possible values for the consent cookie
14+
*/
15+
export type ConsentCookieValue = "true" | "false"
16+
17+
/**
18+
* Cookie consent event names for communication between components
19+
*/
20+
export const COOKIE_CONSENT_EVENTS = {
21+
CHANGED: "cookieConsentChanged",
22+
} as const

packages/types/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export * from "./api.js"
22
export * from "./cloud.js"
33
export * from "./codebase-index.js"
4+
export * from "./cookie-consent.js"
45
export * from "./events.js"
56
export * from "./experiment.js"
67
export * from "./followup.js"

0 commit comments

Comments
 (0)