Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve spaces between section details (ui) #946

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 15 additions & 21 deletions frontend/src/components/pages/details/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,27 +353,21 @@ export const DetailsUIWithoutContext: React.FC<Props> = ({ slug, parentId, langu
titleId="details.recommandations"
className={marginDetailsChild}
>
{details.advice !== null && details.advice.length > 0 && (
<DetailsAdvice
text={details.advice}
className="mb-4 desktop:mb-6"
/>
)}
{details.gear !== null && (
<DetailsGear text={details.gear} className="mt-4 desktop:mb-6" />
)}
{details.labels.map((label, i) => (
<DetailsLabel
key={i}
id={label.id}
name={label.name}
advice={label.advice}
pictogramUri={label.pictogramUri}
className={
i < details.labels.length - 1 ? 'mt-4 desktop:mt-6' : ''
}
/>
))}
<div className="flex flex-col gap-4 desktop:gap-6">
{details.advice !== null && details.advice.length > 0 && (
<DetailsAdvice text={details.advice} />
)}
{details.gear !== null && <DetailsGear text={details.gear} />}
{details.labels.map(label => (
<DetailsLabel
key={label.id}
id={label.id}
name={label.name}
advice={label.advice}
pictogramUri={label.pictogramUri}
/>
))}
</div>
</DetailsSection>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Separator } from 'components/Separator';
import { FormattedMessage } from 'react-intl';
import { cn } from 'services/utils/cn';
import styled from 'styled-components';
import { scrollBar } from 'stylesheet';

export interface DetailsSectionProps {
titleId?: string;
Expand All @@ -19,13 +17,14 @@ export const DetailsSection: React.FC<DetailsSectionProps> = ({
}) => {
return (
<div className={cn('scroll-mt-20 desktop:scroll-mt-30', className)} id={htmlId}>
<ScrollContainer
<div
id="details_section"
className={`flex flex-col
className={cn(`flex flex-col
pt-6 desktop:pt-12
pb-3 desktop:pb-6
mb-3 desktop:mb-6
`}
max-w-full overflow-x-auto
Bo-Duke marked this conversation as resolved.
Show resolved Hide resolved
`)}
>
{titleId !== undefined && (
<h2 className="text-Mobile-H1 desktop:text-H2 font-bold" id="details_sectionTitle">
Expand All @@ -39,19 +38,8 @@ export const DetailsSection: React.FC<DetailsSectionProps> = ({
>
{children}
</div>
</ScrollContainer>
</div>
<Separator />
</div>
);
};

const ScrollContainer = styled.div`
&::-webkit-scrollbar {
${scrollBar.root}
}
&::-webkit-scrollbar-thumb {
${scrollBar.thumb}
}
max-width: 100%;
overflow-x: auto;
`;
Loading