Skip to content

Commit

Permalink
added blog seed link and fixed console errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Samanthatb1 committed Nov 27, 2022
1 parent 9d675f3 commit b22490e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/backend/seeds/10_blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (!ENV_IS_STAGING_OR_PROD) {
summary:
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas accusantium dolorem, beatae possimus nesciunt ab? Illum atque doloremque fugit ipsam quibusdam eveniet magnam quod',
date: '23-May-2021',
link: 'string',
link: 'https://example.com/',
image: 'https://storage.googleapis.com/waterloop_cms_image_upload/1614225359133-waterloop1.png',
closed: true,
category: 'Media Appearance',
Expand All @@ -26,7 +26,7 @@ if (!ENV_IS_STAGING_OR_PROD) {
summary:
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas accusantium dolorem, beatae possimus nesciunt ab? Illum atque doloremque fugit ipsam quibusdam eveniet magnam quod',
date: '20-May-2021',
link: 'string',
link: 'https://example.com/',
image: 'https://storage.googleapis.com/waterloop_cms_image_upload/1614225359139-waterloop2.png',
closed: false,
category: 'Blog',
Expand All @@ -38,7 +38,7 @@ if (!ENV_IS_STAGING_OR_PROD) {
summary:
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas accusantium dolorem, beatae possimus nesciunt ab? Illum atque doloremque fugit ipsam quibusdam eveniet magnam quod',
date: '10-May-2021',
link: 'string',
link: 'https://example.com/',
image: 'https://storage.googleapis.com/waterloop_cms_image_upload/1614226228513-waterloop1.png',
closed: false,
category: 'Media Appearance',
Expand All @@ -50,7 +50,7 @@ if (!ENV_IS_STAGING_OR_PROD) {
summary:
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas accusantium dolorem, beatae possimus nesciunt ab? Illum atque doloremque fugit ipsam quibusdam eveniet magnam quod',
date: '1-May-2021',
link: 'string',
link: 'https://example.com/',
image: 'https://storage.googleapis.com/waterloop_cms_image_upload/1614482400810-waterloop2.png',
closed: true,
category: 'Blog',
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/pages/blogs/BlogPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ const headers = [
{id: 'title', value: 'Title'},
{id: 'updatedAt', value: 'Date'},
{id: 'author', value: 'Author'},
{id: 'category', value: 'Category'},
{id: 'visibility', value: 'Visibility'},
{id: 'category', value: 'Category'}
];

const RowComponent = ({ title, updatedAt, author, link, category, visibility}) => (
<>
<TableCell>
<TextBold>
<LinkButton as="a" href={link}>{title}</LinkButton>
<LinkButton as="a" href={link} target="_blank">{title}</LinkButton>
</TextBold>
</TableCell>
<TableCell>{updatedAt}</TableCell>
Expand Down
15 changes: 8 additions & 7 deletions src/frontend/pages/blogs/edit-a-blog/EditBlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const EditBlog = ({ add }) => {
} = useBlogForm();

const displayImages = useMemo(() => {
return [
return (
<div>
{currentImageURL != '' &&
<ImageCard>
Expand All @@ -140,15 +140,15 @@ const EditBlog = ({ add }) => {
</ImageCard>
}
</div>
];
);
}, [currentImageURL, uploadedImageURL]);


const errorList = useMemo(() => {
return [
...errors.map((error, index) => {
return (
<ErrorMessage key={error}>
<ErrorMessage key={`${error}-${index}`}>
{`${index+1}. `}{error}
</ErrorMessage>
);
Expand Down Expand Up @@ -268,11 +268,12 @@ const EditBlog = ({ add }) => {
</FormContainer>
</BlogImages>

{(errors.length > 0) &&
<ErrorTitle>
Errors:
{(errors.length > 0) &&
<>
<ErrorTitle> Errors: </ErrorTitle>
{errorList}
</ErrorTitle>}
</>
}

<BlogButtons>
<Button label="Save" onClick={saveForm} />
Expand Down

0 comments on commit b22490e

Please sign in to comment.