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
3f48a5dd
Commit
3f48a5dd
authored
2 years ago
by
Tojo
Browse files
Options
Downloads
Patches
Plain Diff
correction cookies
parent
bf0b860f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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 @
3f48a5dd
...
...
@@ -49,11 +49,11 @@ interface Icookies {
location
?:
string
,
buttonText
?:
string
,
declineButtonText
?:
String
,
cookieName
?:
string
,
expires
?:
number
,
styles
:
{},
buttonStyles
:
{},
declineButtonStyle
:
{}
styles
?:
{},
buttonStyles
?:
{},
declineButtonStyle
?:
{},
decline
:
any
}
export
function
CookiesComponent
(
props
:
Icookies
):
JSX
.
Element
;
...
...
This diff is collapsed.
Click to expand it.
src/components/core/CookiesComponent.tsx
+
12
−
12
View file @
3f48a5dd
...
...
@@ -5,39 +5,39 @@ import CookieConsent, { Cookies } from "react-cookie-consent";
interface
Icookies
{
location
?:
string
,
buttonText
?:
string
,
declineButtonText
:
String
,
cookieName
?:
string
,
declineButtonText
?:
String
,
expires
?:
number
,
styles
:
{},
buttonStyles
:
{},
declineButtonStyle
:
{}
styles
?:
{},
buttonStyles
?:
{},
declineButtonStyle
?:
{},
decline
:
any
}
const
CookiesComponent
=
(
props
:
Icookies
)
=>
{
const
{
location
=
"
bottom
"
,
buttonText
=
"
Accept
"
,
declineButtonText
=
"
Decline
"
,
buttonText
=
"
Accept
er
"
,
declineButtonText
=
"
Refuser
"
,
buttonStyles
,
cookieName
=
"
gatsby-gdpr-google-analytics
"
,
expires
=
365
,
styles
,
declineButtonStyle
declineButtonStyle
,
decline
}
=
props
;
return
(
<
CookieConsent
location
=
{
location
}
buttonText
=
{
buttonText
}
declineButtonText
=
{
declineButtonText
}
cookieName
=
{
cookieName
}
cookieName
=
"onegeo-portal-gdpr"
style
=
{
styles
}
buttonStyle
=
{
buttonStyles
}
declineButtonStyle
=
{
declineButtonStyle
}
expires
=
{
expires
}
enableDeclineButton
onDecline
=
{
()
=>
{
alert
(
"
remove cookie here!
"
);
Cookies
.
remove
(
"
tagManagerCookieName
"
)
decline
()
//
Cookies.remove("tagManagerCookieName")
}
}
>
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 @
3f48a5dd
...
...
@@ -5,6 +5,9 @@ import { Link } from "gatsby";
const
cookies
=
()
=>
{
const
decline
=
()
=>
{
return
null
}
return
(
<
Content
>
<
div
className
=
"prose"
>
...
...
@@ -16,12 +19,14 @@ const cookies = () => {
<
pre
>
<
code
>
{
`interface Icookies {
location?: string,
buttonText?: string,
cookieName?: string,
expires?: number,
styles: any,
buttonStyles: any
location?: string,
buttonText?: string,
declineButtonText?: String,
expires?: number,
styles?: {},
buttonStyles?: {},
declineButtonStyle?: {},
decline: any
}`
}
</
code
>
</
pre
>
...
...
@@ -30,7 +35,7 @@ const cookies = () => {
<
h2
>
Example
</
h2
>
</
div
>
<
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
>
</
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