fix: Portfolio styling

This commit is contained in:
Bouncey
2018-11-08 15:06:23 +00:00
committed by mrugesh mohapatra
parent d417ec9936
commit 7afa00f2aa
2 changed files with 35 additions and 29 deletions

View File

@ -1,9 +1,11 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Thumbnail, Media } from '@freecodecamp/react-bootstrap'; import { Media } from '@freecodecamp/react-bootstrap';
import { FullWidthRow } from '../../helpers'; import { FullWidthRow } from '../../helpers';
import './portfolio.css';
const propTypes = { const propTypes = {
portfolio: PropTypes.arrayOf( portfolio: PropTypes.arrayOf(
PropTypes.shape({ PropTypes.shape({
@ -21,25 +23,22 @@ function Portfolio({ portfolio = [] }) {
return null; return null;
} }
return ( return (
<div>
<FullWidthRow> <FullWidthRow>
<h2 className='text-center'>Portfolio</h2> <h2 className='text-center'>Portfolio</h2>
{portfolio.map(({ title, url, image, description, id }) => ( {portfolio.map(({ title, url, image, description, id }) => (
<Media key={id}> <Media key={id}>
<Media.Left align='middle'> <Media.Left align='middle'>
{image && ( {image && (
<a href={url} rel='nofollow'> <img
<Thumbnail
alt={`A screen shot of ${title}`} alt={`A screen shot of ${title}`}
className='portfolio-screen-shot'
src={image} src={image}
style={{ width: '150px' }}
/> />
</a>
)} )}
</Media.Left> </Media.Left>
<Media.Body> <Media.Body>
<Media.Heading> <Media.Heading className='portfolio-heading'>
<a href={url} rel='nofollow'> <a href={url} rel='nofollow noopener noreferrer'>
{title} {title}
</a> </a>
</Media.Heading> </Media.Heading>
@ -47,9 +46,8 @@ function Portfolio({ portfolio = [] }) {
</Media.Body> </Media.Body>
</Media> </Media>
))} ))}
</FullWidthRow>
<hr /> <hr />
</div> </FullWidthRow>
); );
} }

View File

@ -0,0 +1,8 @@
.portfolio-heading.media-heading {
border-bottom: 1px solid rgba(0, 100, 0, 0.6);
padding-bottom: 10px;
}
.portfolio-screen-shot {
width: 150px;
min-width: 150px;
}