Skip to content

Commit

Permalink
fix: article header image sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
drodil committed Oct 22, 2024
1 parent 384876e commit eb24d1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { RelativeTimeWithTooltip } from '../RelativeTimeWithTooltip';
import { ArticleButtons } from './ArticleButtons';
import { TagsAndEntities } from '../TagsAndEntities/TagsAndEntities';
import { CommentSection } from '../CommentSection/CommentSection';
import { WarningPanel } from '@backstage/core-components';

export type QetaArticleContentClassKey =
| 'content'
Expand All @@ -30,6 +31,11 @@ export const useStyles = makeStyles(
headerImage: {
marginBottom: '1rem',
marginTop: '1rem',
height: '250px',
objectFit: 'cover',
width: '100%',
border: `1px solid ${theme.palette.background.paper}`,
boxShadow: theme.shadows[1],
},
commentSection: {
borderBottom: `1px solid ${theme.palette.background.paper}`,
Expand All @@ -56,7 +62,9 @@ export const ArticleContent = (props: {
};

if (post.type !== 'article') {
return null;
return (
<WarningPanel title="Not found" message="Could not find the article" />
);
}

return (
Expand All @@ -66,7 +74,7 @@ export const ArticleContent = (props: {
<Grid item>
<Avatar
src={user?.spec?.profile?.picture}
className={`${styles.headerImage} qetaAvatar avatar`}
className="qetaAvatar avatar"
alt={name}
variant="rounded"
>
Expand Down
4 changes: 4 additions & 0 deletions plugins/qeta-react/src/utils/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,13 @@ export const useStyles = makeStyles(
theme => {
return {
headerImage: {
marginTop: '1rem',
marginBottom: '1rem',
width: '100%',
height: '250px',
objectFit: 'cover',
border: `1px solid ${theme.palette.background.paper}`,
boxShadow: theme.shadows[1],
},
successColor: {
color: theme.palette.success.main,
Expand Down

0 comments on commit eb24d1a

Please sign in to comment.