|
| 1 | +import { CookieConsentConfig } from "vanilla-cookieconsent"; |
| 2 | + |
| 3 | +const getConfig = () => { |
| 4 | + const config: CookieConsentConfig = { |
| 5 | + // root: 'body', |
| 6 | + // autoShow: true, |
| 7 | + disablePageInteraction: true, |
| 8 | + // hideFromBots: true, |
| 9 | + // mode: 'opt-in', |
| 10 | + // revision: 0, |
| 11 | + |
| 12 | + cookie: { |
| 13 | + name: "ace_cookie", |
| 14 | + // domain: location.hostname, |
| 15 | + // path: '/', |
| 16 | + // sameSite: "Lax", |
| 17 | + // expiresAfterDays: 365, |
| 18 | + }, |
| 19 | + |
| 20 | + /** |
| 21 | + * Callback functions |
| 22 | + */ |
| 23 | + // onFirstConsent: ({ cookie }) => { |
| 24 | + // console.log('onFirstConsent fired', cookie); |
| 25 | + // }, |
| 26 | + |
| 27 | + //onConsent: ({ cookie }) => { |
| 28 | + //console.log("onConsent fired!", cookie); |
| 29 | + //}, |
| 30 | + |
| 31 | + //onChange: ({ changedCategories, changedServices }) => { |
| 32 | + //console.log("onChange fired!", changedCategories, changedServices); |
| 33 | + //}, |
| 34 | + |
| 35 | + // onModalReady: ({ modalName }) => { |
| 36 | + // console.log('ready:', modalName); |
| 37 | + // }, |
| 38 | + |
| 39 | + // onModalShow: ({ modalName }) => { |
| 40 | + // console.log('visible:', modalName); |
| 41 | + // }, |
| 42 | + |
| 43 | + // onModalHide: ({ modalName }) => { |
| 44 | + // console.log('hidden:', modalName); |
| 45 | + // }, |
| 46 | + |
| 47 | + guiOptions: { |
| 48 | + consentModal: { |
| 49 | + layout: "cloud inline", |
| 50 | + position: "bottom center", |
| 51 | + equalWeightButtons: true, |
| 52 | + flipButtons: false, |
| 53 | + }, |
| 54 | + preferencesModal: { |
| 55 | + layout: "box", |
| 56 | + position: "right", |
| 57 | + equalWeightButtons: true, |
| 58 | + flipButtons: false, |
| 59 | + }, |
| 60 | + }, |
| 61 | + categories: { |
| 62 | + necessary: { |
| 63 | + enabled: true, |
| 64 | + readOnly: true, |
| 65 | + }, |
| 66 | + analytics: { |
| 67 | + autoClear: { |
| 68 | + cookies: [ |
| 69 | + { |
| 70 | + name: /^(_ga_|_gid)/, |
| 71 | + }, |
| 72 | + ], |
| 73 | + }, |
| 74 | + }, |
| 75 | + }, |
| 76 | + language: { |
| 77 | + default: "en", |
| 78 | + autoDetect: "browser", |
| 79 | + translations: { |
| 80 | + en: { |
| 81 | + consentModal: { |
| 82 | + title: "We use cookies!", |
| 83 | + description: |
| 84 | + "Hello, this website uses essential cookies to ensure its proper functioning and tracking cookies to understand how you interact with it. The latter is only set after permission.", |
| 85 | + acceptAllBtn: "Accept all", |
| 86 | + acceptNecessaryBtn: "Reject all", |
| 87 | + showPreferencesBtn: "Manage preferences", |
| 88 | + }, |
| 89 | + preferencesModal: { |
| 90 | + title: "Manage cookie preferences", |
| 91 | + acceptAllBtn: "Accept all", |
| 92 | + acceptNecessaryBtn: "Reject all", |
| 93 | + savePreferencesBtn: "Save preferences", |
| 94 | + closeIconLabel: "Close modal", |
| 95 | + serviceCounterLabel: "Service|Services", |
| 96 | + sections: [ |
| 97 | + { |
| 98 | + title: "Cookie Usage", |
| 99 | + description: |
| 100 | + "We use cookies to ensure basic website functionality and to improve your online experience. You can choose to opt in or out of each category whenever you want.", |
| 101 | + }, |
| 102 | + { |
| 103 | + title: |
| 104 | + 'Strictly Necessary Cookies <span class="pm__badge">Always Enabled</span>', |
| 105 | + description: |
| 106 | + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", |
| 107 | + linkedCategory: "necessary", |
| 108 | + }, |
| 109 | + { |
| 110 | + title: "Analytics Cookies", |
| 111 | + description: |
| 112 | + "Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.", |
| 113 | + linkedCategory: "analytics", |
| 114 | + cookieTable: { |
| 115 | + headers: { |
| 116 | + name: "Name", |
| 117 | + domain: "Service", |
| 118 | + description: "Description", |
| 119 | + expiration: "Expiration", |
| 120 | + }, |
| 121 | + body: [ |
| 122 | + { |
| 123 | + name: "_ga", |
| 124 | + domain: "Google Analytics", |
| 125 | + description: |
| 126 | + 'Cookie set by <a href="#das">Google Analytics</a>.', |
| 127 | + expiration: "Expires after 12 days", |
| 128 | + }, |
| 129 | + ], |
| 130 | + }, |
| 131 | + }, |
| 132 | + { |
| 133 | + title: "More information", |
| 134 | + description: |
| 135 | + "For any queries in relation to our policy on cookies and your choices, please contact us.", |
| 136 | + }, |
| 137 | + ], |
| 138 | + }, |
| 139 | + }, |
| 140 | + }, |
| 141 | + }, |
| 142 | + }; |
| 143 | + |
| 144 | + return config; |
| 145 | +}; |
| 146 | + |
| 147 | +export default getConfig; |
0 commit comments