Skip to content

Commit

Permalink
fix(Album View): Move header below and condense
Browse files Browse the repository at this point in the history
  • Loading branch information
danactive committed Jun 30, 2020
1 parent 1f24e07 commit aaf35f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
22 changes: 11 additions & 11 deletions ui/app/components/PhotoHeader/index.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';

function titleCase(str) {
return str
.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
return decodeURI(
str
.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' '),
);
}

function LinkToReference({ reference } = {}) {
Expand Down Expand Up @@ -37,14 +39,12 @@ function LinkToReference({ reference } = {}) {
function PhotoHeader({ currentMemory }) {
if (!currentMemory || currentMemory === null) return null;

const { city, description, location, reference } = currentMemory;
const { city, location, reference } = currentMemory;

return [
<h1 key="headerCity">{city}</h1>,
<h2 key="headerLocation">{location}</h2>,
<p key="headerDescription">{description}</p>,
<p key="reference">
<LinkToReference reference={reference} />
<h4 key="headerCity">{city}</h4>,
<p key="headerLocation">
{location} <LinkToReference reference={reference} />
</p>,
];
}
Expand Down
5 changes: 1 addition & 4 deletions ui/app/containers/AlbumViewPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,8 @@ function AlbumViewPage({
<Helmet>
<title>{`${albumName} Album`}</title>
</Helmet>

<PhotoHeader currentMemory={currentMemory} />

<SplitScreen currentMemory={currentMemory} memories={memories} />

<PhotoHeader currentMemory={currentMemory} />
<InfiniteThumbs
error={albumError}
items={memories}
Expand Down

0 comments on commit aaf35f0

Please sign in to comment.