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
74c9506c
Commit
74c9506c
authored
2 years ago
by
Tojo
Browse files
Options
Downloads
Patches
Plain Diff
cookies component
parent
78bfc772
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
index.d.ts
+5
-3
5 additions, 3 deletions
index.d.ts
index.js
+1
-1
1 addition, 1 deletion
index.js
src/components/core/CookiesComponent.tsx
+48
-0
48 additions, 0 deletions
src/components/core/CookiesComponent.tsx
src/pages-doc/doc/core/cookies.tsx
+2
-2
2 additions, 2 deletions
src/pages-doc/doc/core/cookies.tsx
with
56 additions
and
6 deletions
index.d.ts
+
5
−
3
View file @
74c9506c
...
@@ -45,12 +45,14 @@ export function Card(props: CardProps): JSX.Element;
...
@@ -45,12 +45,14 @@ export function Card(props: CardProps): JSX.Element;
interface
Icookies
{
interface
Icookies
{
location
?:
string
,
location
?:
string
,
buttonText
?:
string
,
buttonText
?:
string
,
declineButtonText
?:
String
,
cookieName
?:
string
,
cookieName
?:
string
,
expires
?:
number
,
expires
?:
number
,
styles
:
any
,
styles
:
{},
buttonStyles
:
any
buttonStyles
:
{},
declineButtonStyle
:
{}
}
}
export
function
Cookies
(
props
:
Icookies
):
JSX
.
Element
;
export
function
Cookies
Component
(
props
:
Icookies
):
JSX
.
Element
;
interface
LinkProps
{
interface
LinkProps
{
children
?:
React
.
ReactNode
;
children
?:
React
.
ReactNode
;
...
...
This diff is collapsed.
Click to expand it.
index.js
+
1
−
1
View file @
74c9506c
...
@@ -18,4 +18,4 @@ export { default as Hero } from "./src/components/Hero";
...
@@ -18,4 +18,4 @@ export { default as Hero } from "./src/components/Hero";
export
{
default
as
Logo
}
from
"
./src/components/core/Logo
"
;
export
{
default
as
Logo
}
from
"
./src/components/core/Logo
"
;
// Cookies components
// Cookies components
export
{
default
as
Cookies
}
from
"
./src/components/core/Cookies
"
;
export
{
default
as
Cookies
Component
}
from
"
./src/components/core/Cookies
Component
"
;
This diff is collapsed.
Click to expand it.
src/components/core/Cookies.tsx
→
src/components/core/Cookies
Component
.tsx
+
48
−
0
View file @
74c9506c
import
React
from
"
react
"
;
import
React
from
"
react
"
;
// import {CookieNotice} from "gatsby-cookie-notice";
// import {CookieNotice} from "gatsby-cookie-notice";
import
CookieConsent
from
"
react-cookie-consent
"
;
import
CookieConsent
,
{
Cookies
}
from
"
react-cookie-consent
"
;
interface
Icookies
{
interface
Icookies
{
location
?:
string
,
location
?:
string
,
buttonText
?:
string
,
buttonText
?:
string
,
declineButtonText
:
String
,
cookieName
?:
string
,
cookieName
?:
string
,
expires
?:
number
,
expires
?:
number
,
styles
:
any
,
styles
:
{},
buttonStyles
:
any
buttonStyles
:
{},
declineButtonStyle
:
{}
}
}
const
Cookies
=
(
props
:
Icookies
)
=>
{
const
CookiesComponent
=
(
props
:
Icookies
)
=>
{
const
{
location
=
"
bottom
"
,
buttonText
=
"
Accept
"
,
buttonStyles
,
cookieName
=
"
gatsby-gdpr-google-analytics
"
,
expires
=
365
,
styles
}
=
props
;
const
{
location
=
"
bottom
"
,
buttonText
=
"
Accept
"
,
declineButtonText
=
"
Decline
"
,
buttonStyles
,
cookieName
=
"
gatsby-gdpr-google-analytics
"
,
expires
=
365
,
styles
,
declineButtonStyle
}
=
props
;
return
(
return
(
<
CookieConsent
<
CookieConsent
location
=
{
location
}
location
=
{
location
}
buttonText
=
{
buttonText
}
buttonText
=
{
buttonText
}
declineButtonText
=
"D
ecline
"
declineButtonText
=
{
d
ecline
ButtonText
}
cookieName
=
{
cookieName
}
cookieName
=
{
cookieName
}
style
=
{
styles
}
style
=
{
styles
}
buttonStyle
=
{
buttonStyles
}
buttonStyle
=
{
buttonStyles
}
declineButtonStyle
=
{
declineButtonStyle
}
expires
=
{
expires
}
expires
=
{
expires
}
enableDeclineButton
onDecline
=
{
()
=>
{
alert
(
"
remove cookie here!
"
);
Cookies
.
remove
(
"
tagManagerCookieName
"
)
}
}
>
>
No
tre site utilise des cookies pour garantir son bon fonctionnement
et
op
ti
m
is
er ses performances techniques, ..
.
No
us nous soucions de vos données personnelles
et
u
ti
l
is
ons des cookies afin d’améliorer votre expérience
.
</
CookieConsent
>
</
CookieConsent
>
);
);
};
};
export
default
Cookies
;
export
default
Cookies
Component
;
This diff is collapsed.
Click to expand it.
src/pages-doc/doc/core/cookies.tsx
+
2
−
2
View file @
74c9506c
import
React
from
'
react
'
import
React
from
'
react
'
import
{
Content
}
from
"
@onegeo/gatsby-theme-onegeo
"
;
import
{
Content
}
from
"
@onegeo/gatsby-theme-onegeo
"
;
import
{
Cookies
}
from
"
@onegeo/gatsby-theme-onegeo
"
;
import
{
Cookies
Component
}
from
"
@onegeo/gatsby-theme-onegeo
"
;
import
{
Link
}
from
"
gatsby
"
;
import
{
Link
}
from
"
gatsby
"
;
...
@@ -30,7 +30,7 @@ const cookies = () => {
...
@@ -30,7 +30,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"
>
<
Cookies
buttonStyles
=
{
{
color
:
"
#4e503b
"
,
fontSize
:
"
13px
"
}
}
styles
=
{
{
background
:
"
#2B373B
"
}
}
/>
<
Cookies
Component
declineButtonStyle
=
{
{
color
:
"
#4e503b
"
,
fontSize
:
"
13px
"
}
}
buttonStyles
=
{
{
color
:
"
#4e503b
"
,
fontSize
:
"
13px
"
}
}
styles
=
{
{
background
:
"
#2B373B
"
}
}
/>
</
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