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
6a8bdd8a
Commit
6a8bdd8a
authored
1 year ago
by
Manoa Harinjo
Browse files
Options
Downloads
Patches
Plain Diff
add prps objectFit
parent
1ae5bfc8
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
gatsby-node.js
+2
-2
2 additions, 2 deletions
gatsby-node.js
index.d.ts
+1
-0
1 addition, 0 deletions
index.d.ts
src/components/core/Image.tsx
+11
-1
11 additions, 1 deletion
src/components/core/Image.tsx
with
14 additions
and
3 deletions
gatsby-node.js
+
2
−
2
View file @
6a8bdd8a
...
...
@@ -19,11 +19,11 @@ exports.createPages = async function ({ actions, graphql }) {
}
}
directus {
pages
(limit: -1) {
pages(limit: -1) {
id
slug
}
news
(limit: -1) {
news(limit: -1) {
id
slug
title
...
...
This diff is collapsed.
Click to expand it.
index.d.ts
+
1
−
0
View file @
6a8bdd8a
...
...
@@ -256,6 +256,7 @@ interface Iimage {
image
?:
string
|
IGatsbyImageData
className
?:
string
objectPosition
?:
string
objectFit
?:
any
}
export
function
Image
(
props
:
Iimage
):
JSX
.
Element
...
...
This diff is collapsed.
Click to expand it.
src/components/core/Image.tsx
+
11
−
1
View file @
6a8bdd8a
...
...
@@ -10,10 +10,16 @@ export interface Iimage {
image
?:
string
|
IGatsbyImageData
className
?:
string
objectPosition
?:
string
objectFit
?:
any
}
const
Image
=
(
props
:
Iimage
)
=>
{
const
{
image
,
className
=
""
,
objectPosition
=
"
50% 50%
"
}
=
props
const
{
image
,
className
=
""
,
objectPosition
=
"
50% 50%
"
,
objectFit
=
"
cover
"
,
}
=
props
const
imageClassname
=
`
${
className
}
`
...
...
@@ -31,6 +37,7 @@ const Image = (props: Iimage) => {
src
=
"../../images/400x400.png"
alt
=
"no-image-available"
className
=
{
imageClassname
}
objectFit
=
{
objectFit
}
/>
)
}
...
...
@@ -40,6 +47,7 @@ const Image = (props: Iimage) => {
src
=
"../../images/800x400.png"
alt
=
"no-image-available"
className
=
{
imageClassname
}
objectFit
=
{
objectFit
}
/>
)
}
...
...
@@ -49,6 +57,7 @@ const Image = (props: Iimage) => {
src
=
"../../images/400x800.png"
alt
=
"no-image-available"
className
=
{
imageClassname
}
objectFit
=
{
objectFit
}
/>
)
}
...
...
@@ -83,6 +92,7 @@ const Image = (props: Iimage) => {
image
=
{
img
}
alt
=
{
image
.
name
}
className
=
{
imageClassname
}
objectFit
=
{
objectFit
}
objectPosition
=
{
objectPosition
}
/>
)
...
...
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