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

Fix notification spacing #1335

Merged
merged 1 commit into from
Feb 7, 2024
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
10 changes: 6 additions & 4 deletions src/components/timelines/notification/Follow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ const Follow: React.FC<Props> = props => {
<div onClick={() => props.setAccountDetail(props.notification.account)} style={{ cursor: 'pointer' }}>
{/** action **/}
<FlexboxGrid style={{ paddingRight: '8px' }}>
<FlexboxGrid.Item colspan={20} style={{ display: 'flex', alignItems: 'middle' }}>
<FlexboxGrid.Item colspan={22} style={{ display: 'flex', alignItems: 'middle' }}>
{/** icon **/}
<div style={{ paddingRight: '8px', textAlign: 'right', width: '56px' }}>
<div style={{ paddingRight: '4px', paddingLeft: '8px', width: '32px', boxSizing: 'border-box' }}>
<Icon as={BsPersonPlus} color="cyan" />
</div>
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{actionText(props.notification)}</div>
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', width: 'calc(100% - 32px)' }}>
{actionText(props.notification)}
</div>
</FlexboxGrid.Item>
<FlexboxGrid.Item colspan={4} style={{ textAlign: 'right', color: 'var(--rs-text-tertiary)' }}>
<FlexboxGrid.Item colspan={2} style={{ textAlign: 'right', color: 'var(--rs-text-tertiary)' }}>
<Time time={props.notification.created_at} />
</FlexboxGrid.Item>
</FlexboxGrid>
Expand Down
10 changes: 6 additions & 4 deletions src/components/timelines/notification/Move.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ export default function Move(props: Props) {
<div onClick={() => props.setAccountDetail(props.notification.target)} style={{ cursor: 'pointer' }}>
{/** action **/}
<FlexboxGrid style={{ paddingRight: '8px' }}>
<FlexboxGrid.Item colspan={20} style={{ display: 'flex', alignItems: 'middle' }}>
<FlexboxGrid.Item colspan={22} style={{ display: 'flex', alignItems: 'middle' }}>
{/** icon **/}
<div style={{ paddingRight: '8px', textAlign: 'right', width: '56px' }}>
<div style={{ paddingRight: '4px', paddingLeft: '8px', width: '32px', boxSizing: 'border-box' }}>
<Icon as={BsBag} color="cyan" />
</div>
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{actionText(props.notification)}</div>
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', width: 'calc(100% - 32px)' }}>
{actionText(props.notification)}
</div>
</FlexboxGrid.Item>
<FlexboxGrid.Item colspan={4} style={{ textAlign: 'right', color: 'var(--rs-text-tertiary)' }}>
<FlexboxGrid.Item colspan={2} style={{ textAlign: 'right', color: 'var(--rs-text-tertiary)' }}>
<Time time={props.notification.created_at} />
</FlexboxGrid.Item>
</FlexboxGrid>
Expand Down
12 changes: 7 additions & 5 deletions src/components/timelines/notification/Reaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const actionIcon = (notification: Entity.Notification) => {
case 'reaction':
if (notification.reaction) {
if (notification.reaction.url) {
return <img src={notification.reaction.url} style={{ height: '18px' }} />
return <img src={notification.reaction.url} style={{ height: '16px' }} />
} else {
return <span dangerouslySetInnerHTML={{ __html: notification.reaction.name }} />
}
Expand Down Expand Up @@ -229,16 +229,18 @@ const Reaction: React.FC<Props> = props => {
<div>
{/** action **/}
<FlexboxGrid align="middle" style={{ paddingRight: '8px' }}>
<FlexboxGrid.Item colspan={20}>
<FlexboxGrid.Item colspan={22}>
<div style={{ display: 'flex', alignItems: 'middle' }}>
{/** icon **/}
<div style={{ paddingRight: '8px', textAlign: 'right', width: '56px' }}>{actionIcon(props.notification)}</div>
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
<div style={{ paddingRight: '4px', paddingLeft: '8px', width: '32px', boxSizing: 'border-box' }}>
{actionIcon(props.notification)}
</div>
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', width: 'calc(100% - 32px)' }}>
{actionText(props.notification, props.setAccountDetail)}
</div>
</div>
</FlexboxGrid.Item>
<FlexboxGrid.Item colspan={4} style={{ textAlign: 'right', color: 'var(--rs-text-secondary)' }}>
<FlexboxGrid.Item colspan={2} style={{ textAlign: 'right', color: 'var(--rs-text-secondary)' }}>
<Time time={props.notification.created_at} />
</FlexboxGrid.Item>
</FlexboxGrid>
Expand Down
Loading