Skip to content

Commit

Permalink
Fix story item text overflow
Browse files Browse the repository at this point in the history
- adjust story panel width
- reduce max height on story body -> 200px, remove padding when collapsed
  • Loading branch information
ljowen committed Feb 13, 2025
1 parent 04a75fd commit c39d684
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
28 changes: 25 additions & 3 deletions lib/ReactViews/Story/Story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,13 @@ const Story = (props: Props) => {
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
`}
>
<div>
<div
css={`
width: 100%;
overflow-x: hidden;
display: flex;
`}
>
<TextSpan
css={`
color: #baebf8;
Expand All @@ -289,7 +295,15 @@ const Story = (props: Props) => {
>
{props.index + 1}
</TextSpan>
<TextSpan textLight medium>
<TextSpan
overflowEllipsis
textLight
medium
css={`
overflow-x: hidden;
white-space: nowrap;
`}
>
{story.title && story.title.length > 0
? story.title
: t("story.untitledScene")}
Expand Down Expand Up @@ -320,7 +334,15 @@ const Story = (props: Props) => {
</Box>
{bodyText.length > 0 && (
<Box paddedRatio={2} paddedHorizontally={3}>
<Text textLight medium>
<Text
overflowEllipsis
textLight
medium
css={`
overflow-x: hidden;
white-space: nowrap;
`}
>
{bodyText}
</Text>
</Box>
Expand Down
4 changes: 1 addition & 3 deletions lib/ReactViews/Story/StoryPanel/StoryBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ const StoryContainer = styled(Box).attrs((props: { isCollapsed: boolean }) => ({
background-color: ${(props) => props.theme.transparentDark}
backdrop-filter: ${(props) => props.theme.blur}
padding-top: 0;
padding: ${(props) => (props.isCollapsed ? 0 : 15)}px;
max-height: ${(props) => (props.isCollapsed ? 0 : "100px")};
@media (min-height: 700px) {
max-height: ${(props) => (props.isCollapsed ? 0 : "200px")};
}
@media (min-height: 900px) {
max-height: ${(props) => (props.isCollapsed ? 0 : "400px")};
}
overflow-y: auto;
Expand Down
3 changes: 1 addition & 2 deletions lib/ReactViews/Story/StoryPanel/StoryPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class StoryPanel extends React.Component<Props, State> {
ref={this.slideRef as React.RefObject<HTMLDivElement>}
css={`
@media (min-width: 992px) {
max-width: 60vw;
max-width: 36vw;
}
border-radius: 6px;
overflow: hidden;
Expand All @@ -274,7 +274,6 @@ class StoryPanel extends React.Component<Props, State> {
/>
</Box>
<Box
paddedRatio={3}
backgroundColor={this.props.theme.dark}
css={{
backgroundColor: this.props.theme.transparentDark,
Expand Down

0 comments on commit c39d684

Please sign in to comment.