add "download wallpaper" button
This commit is contained in:
parent
0870a38520
commit
21a541005e
@ -28,6 +28,7 @@ const logKeyShortcut = (keyCode) => {
|
|||||||
const GalleryImage = ({ data, pageContext }) => {
|
const GalleryImage = ({ data, pageContext }) => {
|
||||||
const image = data.allFile.edges[0].node;
|
const image = data.allFile.edges[0].node;
|
||||||
const ar = getAspectRatio(image);
|
const ar = getAspectRatio(image);
|
||||||
|
console.log(image);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const keyListener = (e) => {
|
const keyListener = (e) => {
|
||||||
@ -64,9 +65,7 @@ const GalleryImage = ({ data, pageContext }) => {
|
|||||||
// const locationString = meta.City;
|
// const locationString = meta.City;
|
||||||
let locationString;
|
let locationString;
|
||||||
if (meta.City || meta.State || meta.Location) {
|
if (meta.City || meta.State || meta.Location) {
|
||||||
const location = [meta.Location, meta.City, meta.State].filter(
|
const location = [meta.Location, meta.City, meta.State].filter(Boolean);
|
||||||
Boolean
|
|
||||||
);
|
|
||||||
locationString = location.join(", ");
|
locationString = location.join(", ");
|
||||||
}
|
}
|
||||||
const vibrant = getVibrant(image, true);
|
const vibrant = getVibrant(image, true);
|
||||||
@ -159,6 +158,13 @@ const GalleryImage = ({ data, pageContext }) => {
|
|||||||
<h1 className="text-4xl mt-0 font-serif">{name}</h1>
|
<h1 className="text-4xl mt-0 font-serif">{name}</h1>
|
||||||
)}
|
)}
|
||||||
<p className="landscape:mr-2">{meta.Caption}</p>
|
<p className="landscape:mr-2">{meta.Caption}</p>
|
||||||
|
<a
|
||||||
|
className="inline-block bg-muted-light text-vibrant-dark underline font-serif p-1 my-1 rounded"
|
||||||
|
download
|
||||||
|
href={image.publicURL}
|
||||||
|
>
|
||||||
|
Download wallpaper
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
<div
|
<div
|
||||||
@ -166,7 +172,7 @@ const GalleryImage = ({ data, pageContext }) => {
|
|||||||
style={{ width: 30 }}
|
style={{ width: 30 }}
|
||||||
></div>
|
></div>
|
||||||
}
|
}
|
||||||
<div className='flex flex-col'>
|
<div className="flex flex-col">
|
||||||
<MetadataItem
|
<MetadataItem
|
||||||
data={dateTaken.toLocaleDateString()}
|
data={dateTaken.toLocaleDateString()}
|
||||||
icon="calendar-outline"
|
icon="calendar-outline"
|
||||||
@ -208,11 +214,7 @@ const GalleryImage = ({ data, pageContext }) => {
|
|||||||
title="aperture"
|
title="aperture"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<MetadataItem
|
<MetadataItem data={meta.ISO} icon="film-outline" title="ISO" />
|
||||||
data={meta.ISO}
|
|
||||||
icon="film-outline"
|
|
||||||
title="ISO"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -233,6 +235,7 @@ export const query = graphql`
|
|||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
base
|
base
|
||||||
|
publicURL
|
||||||
childImageSharp {
|
childImageSharp {
|
||||||
fluid {
|
fluid {
|
||||||
aspectRatio
|
aspectRatio
|
||||||
|
Loading…
x
Reference in New Issue
Block a user