Skip to content

Commit

Permalink
fix: added scroll for markdown when it crowded
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisVorop authored and awinogradov committed Oct 5, 2023
1 parent 65862d2 commit cddaf94
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/ActivityFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const ActivityFeed = styled.div`

export const ActivityFeedItem = styled.div`
display: grid;
grid-template-columns: 35px 1fr;
grid-template-columns: 35px minmax(0, 1fr);
column-gap: 15px;
position: relative;
Expand Down
6 changes: 5 additions & 1 deletion src/components/CommentView/CommentView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ const StyledTimestamp = styled.div`
gap: ${gapS};
`;

const StyledMd = styled(Md)`
overflow-x: auto;
`;

export const CommentView: FC<CommentViewProps> = ({
id,
author,
Expand Down Expand Up @@ -269,7 +273,7 @@ export const CommentView: FC<CommentViewProps> = ({
</StyledTimestamp>
))}

<Md>{commentDescription.description}</Md>
<StyledMd>{commentDescription.description}</StyledMd>

{nullable(reactions?.length, () => (
<Reactions reactions={reactionsProps.reactions} onClick={onReactionToggle} />
Expand Down
5 changes: 4 additions & 1 deletion src/components/Md.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import { useMarkdown } from '../hooks/useMarkdown';

interface MdProps {
children?: string;
className?: string;
}

const Md: React.FC<MdProps> = ({ children = '' }) => <Markdown>{useMarkdown(children)}</Markdown>;
const Md: React.FC<MdProps> = ({ children = '', className }) => (
<Markdown className={className}>{useMarkdown(children)}</Markdown>
);

export default Md;

0 comments on commit cddaf94

Please sign in to comment.