feat(client): make portfolio section in profile support RTL layout

This commit is contained in:
Sboonny
2023-01-26 11:31:27 +00:00
parent 57544bd876
commit b4cf5f1ab4
2 changed files with 35 additions and 17 deletions
@@ -1,12 +1,33 @@
.portfolio-heading.media-heading {
.portfolio-container {
display: grid;
grid-template-columns: 150px 1fr;
grid-template-rows: 1fr 2fr;
gap: 0.5rem;
margin-top: 1em;
zoom: 1;
overflow: hidden;
}
.portfolio-heading {
grid-column: 2;
grid-row: 1;
border-bottom: 1px solid var(--quaternary-background);
padding-bottom: 10px;
margin-bottom: 0;
}
.screen-shot-container {
grid-column: 1;
grid-row: 1 / 3;
}
.portfolio-screen-shot {
width: 150px;
min-width: 150px;
width: 100%;
height: 100%;
display: block;
}
.portfolio-container p {
margin-top: 0;
grid-column: 2;
grid-row: 2;
}
/* Timeline pagination */
.timeline-pagination_list {
list-style: none;
@@ -1,4 +1,3 @@
import { Media } from '@freecodecamp/react-bootstrap';
import React from 'react';
import { useTranslation } from 'react-i18next';
@@ -20,8 +19,8 @@ function Portfolio({ portfolio = [] }: PortfolioProps): JSX.Element | null {
<FullWidthRow>
<h2 className='text-center'>{t('profile.portfolio')}</h2>
{portfolio.map(({ title, url, image, description, id }) => (
<Media key={id}>
<Media.Left align='middle'>
<div className='portfolio-container' key={id}>
<div className='screen-shot-container'>
{image && (
<img
alt={t('profile.screen-shot', { title: title })}
@@ -29,16 +28,14 @@ function Portfolio({ portfolio = [] }: PortfolioProps): JSX.Element | null {
src={image}
/>
)}
</Media.Left>
<Media.Body>
<Media.Heading className='portfolio-heading'>
<a href={url} rel='nofollow noopener noreferrer'>
{title}
</a>
</Media.Heading>
<p>{description}</p>
</Media.Body>
</Media>
</div>
<h3 className='portfolio-heading'>
<a href={url} rel='nofollow noopener noreferrer'>
{title}
</a>
</h3>
<p>{description}</p>
</div>
))}
<hr />
</FullWidthRow>