Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Gatsby Theme Onegeo
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OneGeo Suite
Libs
Gatsby Theme Onegeo
Commits
3d980001
Commit
3d980001
authored
2 years ago
by
Tojo
Browse files
Options
Downloads
Patches
Plain Diff
correction cookies
parent
74c9506c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
index.d.ts
+4
-4
4 additions, 4 deletions
index.d.ts
src/components/core/CookiesComponent.tsx
+12
-12
12 additions, 12 deletions
src/components/core/CookiesComponent.tsx
src/pages-doc/doc/core/cookies.tsx
+12
-7
12 additions, 7 deletions
src/pages-doc/doc/core/cookies.tsx
with
28 additions
and
23 deletions
index.d.ts
+
4
−
4
View file @
3d980001
...
@@ -46,11 +46,11 @@ interface Icookies {
...
@@ -46,11 +46,11 @@ interface Icookies {
location
?:
string
,
location
?:
string
,
buttonText
?:
string
,
buttonText
?:
string
,
declineButtonText
?:
String
,
declineButtonText
?:
String
,
cookieName
?:
string
,
expires
?:
number
,
expires
?:
number
,
styles
:
{},
styles
?:
{},
buttonStyles
:
{},
buttonStyles
?:
{},
declineButtonStyle
:
{}
declineButtonStyle
?:
{},
decline
:
any
}
}
export
function
CookiesComponent
(
props
:
Icookies
):
JSX
.
Element
;
export
function
CookiesComponent
(
props
:
Icookies
):
JSX
.
Element
;
...
...
This diff is collapsed.
Click to expand it.
src/components/core/CookiesComponent.tsx
+
12
−
12
View file @
3d980001
...
@@ -5,39 +5,39 @@ import CookieConsent, { Cookies } from "react-cookie-consent";
...
@@ -5,39 +5,39 @@ import CookieConsent, { Cookies } from "react-cookie-consent";
interface
Icookies
{
interface
Icookies
{
location
?:
string
,
location
?:
string
,
buttonText
?:
string
,
buttonText
?:
string
,
declineButtonText
:
String
,
declineButtonText
?:
String
,
cookieName
?:
string
,
expires
?:
number
,
expires
?:
number
,
styles
:
{},
styles
?:
{},
buttonStyles
:
{},
buttonStyles
?:
{},
declineButtonStyle
:
{}
declineButtonStyle
?:
{},
decline
:
any
}
}
const
CookiesComponent
=
(
props
:
Icookies
)
=>
{
const
CookiesComponent
=
(
props
:
Icookies
)
=>
{
const
{
const
{
location
=
"
bottom
"
,
location
=
"
bottom
"
,
buttonText
=
"
Accept
"
,
buttonText
=
"
Accept
er
"
,
declineButtonText
=
"
Decline
"
,
declineButtonText
=
"
Refuser
"
,
buttonStyles
,
buttonStyles
,
cookieName
=
"
gatsby-gdpr-google-analytics
"
,
expires
=
365
,
expires
=
365
,
styles
,
styles
,
declineButtonStyle
declineButtonStyle
,
decline
}
=
props
;
}
=
props
;
return
(
return
(
<
CookieConsent
<
CookieConsent
location
=
{
location
}
location
=
{
location
}
buttonText
=
{
buttonText
}
buttonText
=
{
buttonText
}
declineButtonText
=
{
declineButtonText
}
declineButtonText
=
{
declineButtonText
}
cookieName
=
{
cookieName
}
cookieName
=
"onegeo-portal-gdpr"
style
=
{
styles
}
style
=
{
styles
}
buttonStyle
=
{
buttonStyles
}
buttonStyle
=
{
buttonStyles
}
declineButtonStyle
=
{
declineButtonStyle
}
declineButtonStyle
=
{
declineButtonStyle
}
expires
=
{
expires
}
expires
=
{
expires
}
enableDeclineButton
enableDeclineButton
onDecline
=
{
()
=>
{
onDecline
=
{
()
=>
{
alert
(
"
remove cookie here!
"
);
decline
()
Cookies
.
remove
(
"
tagManagerCookieName
"
)
//
Cookies.remove("tagManagerCookieName")
}
}
}
}
>
>
Nous nous soucions de vos données personnelles et utilisons des cookies afin d’améliorer votre expérience.
Nous nous soucions de vos données personnelles et utilisons des cookies afin d’améliorer votre expérience.
...
...
This diff is collapsed.
Click to expand it.
src/pages-doc/doc/core/cookies.tsx
+
12
−
7
View file @
3d980001
...
@@ -5,6 +5,9 @@ import { Link } from "gatsby";
...
@@ -5,6 +5,9 @@ import { Link } from "gatsby";
const
cookies
=
()
=>
{
const
cookies
=
()
=>
{
const
decline
=
()
=>
{
return
null
}
return
(
return
(
<
Content
>
<
Content
>
<
div
className
=
"prose"
>
<
div
className
=
"prose"
>
...
@@ -16,12 +19,14 @@ const cookies = () => {
...
@@ -16,12 +19,14 @@ const cookies = () => {
<
pre
>
<
pre
>
<
code
>
<
code
>
{
`interface Icookies {
{
`interface Icookies {
location?: string,
location?: string,
buttonText?: string,
buttonText?: string,
cookieName?: string,
declineButtonText?: String,
expires?: number,
expires?: number,
styles: any,
styles?: {},
buttonStyles: any
buttonStyles?: {},
declineButtonStyle?: {},
decline: any
}`
}
}`
}
</
code
>
</
code
>
</
pre
>
</
pre
>
...
@@ -30,7 +35,7 @@ const cookies = () => {
...
@@ -30,7 +35,7 @@ const cookies = () => {
<
h2
>
Example
</
h2
>
<
h2
>
Example
</
h2
>
</
div
>
</
div
>
<
div
className
=
"flex gap-6 m-4"
>
<
div
className
=
"flex gap-6 m-4"
>
<
CookiesComponent
declineButtonStyle
=
{
{
color
:
"
#4e503b
"
,
fontSize
:
"
13px
"
}
}
buttonStyles
=
{
{
color
:
"
#4e503b
"
,
fontSize
:
"
13px
"
}
}
styles
=
{
{
background
:
"
#2B373B
"
}
}
/>
<
CookiesComponent
declineButtonStyle
=
{
{
color
:
"
#4e503b
"
,
fontSize
:
"
13px
"
}
}
buttonStyles
=
{
{
color
:
"
#4e503b
"
,
fontSize
:
"
13px
"
}
}
styles
=
{
{
background
:
"
#2B373B
"
}
}
decline
=
{
decline
}
/>
</
div
>
</
div
>
</
Content
>
</
Content
>
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment