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

Some styling improvements #5029

Merged
merged 1 commit into from
Sep 1, 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
2 changes: 1 addition & 1 deletion renderer/components/timelines/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default function Timeline(props: Props) {
color="blue-gray"
placeholder={formatMessage({ id: 'timeline.search' })}
containerProps={{ className: 'h-7' }}
className="!py-1 !px-2 !text-xs placeholder:opacity-100"
className="!py-1 !px-2 !text-xs placeholder:opacity-100 text-white"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

/>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions renderer/components/timelines/status/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function Body(props: Props) {
return (
<div className="raw-html">
<div
className="spoiler-text"
className="spoiler-text font-thin"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use a thin font? Can you please share the image?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, it looks nicer from information hierarchy point of view. But this may be a matter of personal taste.

With font-thin:

image

Without it:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cinny has done a good job of creating a highly legible Slack-like messaging UI which we can try to replicate:

image

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, looks good.

style={Object.assign({ wordWrap: 'break-word' }, props.style)}
dangerouslySetInnerHTML={{ __html: emojify(props.status.spoiler_text, props.status.emojis) }}
onClick={props.onClick}
Expand All @@ -39,7 +39,7 @@ export default function Body(props: Props) {
{spoiler()}
{!spoilered && (
<div
className={`${props.className} raw-html`}
className={`${props.className} raw-html font-thin`}
style={Object.assign({ wordWrap: 'break-word' }, props.style)}
dangerouslySetInnerHTML={{ __html: emojify(props.status.content, props.status.emojis) }}
onClick={props.onClick}
Expand Down
16 changes: 8 additions & 8 deletions renderer/components/timelines/status/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function Status(props: Props) {
}

return (
<div className="border-b border-gray-200 dark:border-gray-800 mr-2 py-1">
<div className="border-b border-gray-200 dark:border-gray-800 hover:bg-gray-100 dark:hover:bg-gray-800 mr-2 py-1">
{rebloggedHeader(
props.status,
formatMessage(
Expand Down Expand Up @@ -148,19 +148,19 @@ export default function Status(props: Props) {
onClick={onClick}
>
<div className="flex justify-between">
<div className="flex cursor-pointer" onClick={() => openUser(status.account.id)}>
<div className="flex cursor-pointer hover:underline" onClick={() => openUser(status.account.id)}>
<span
className="text-gray-950 dark:text-gray-300 text-ellipsis break-all overflow-hidden"
className="text-gray-950 font-bold dark:text-gray-300 text-ellipsis break-all overflow-hidden"
dangerouslySetInnerHTML={{ __html: emojify(status.account.display_name, status.account.emojis) }}
></span>
<span className="text-gray-600 dark:text-gray-500 text-ellipsis break-all overflow-hidden">@{status.account.acct}</span>
<span className="text-gray-600 ml-2 dark:text-gray-500 text-ellipsis break-all overflow-hidden">@{status.account.acct}</span>
</div>
<div className="text-gray-600 dark:text-gray-500 text-right cursor-pointer" onClick={openStatus}>
<div className="text-gray-600 dark:text-gray-500 text-right cursor-pointer hover:underline" onClick={openStatus}>
<time dateTime={status.created_at}>{dayjs(status.created_at).format('YYYY-MM-DD HH:mm:ss')}</time>
</div>
</div>
<div className="status-body">
<Body status={status} spoilered={spoilered} setSpoilered={setSpoilered} onClick={statusClicked} />
<Body className="my-2" status={status} spoilered={spoilered} setSpoilered={setSpoilered} onClick={statusClicked} />
</div>
{!spoilered && (
<>
Expand Down Expand Up @@ -209,10 +209,10 @@ const rebloggedHeader = (status: Entity.Status, alt: string) => {
if (status.reblog && !status.quote) {
return (
<div className="flex text-gray-600 dark:text-gray-500">
<div className="grid justify-items-end pr-2" style={{ width: '56px' }}>
<div className="grid justify-items-end pr-2" style={{ width: '40px' }}>
<Avatar src={status.account.avatar} size="xs" variant="rounded" alt={alt} />
</div>
<div style={{ width: 'calc(100% - 56px)' }}>
<div style={{ width: 'calc(100% - 40px)' }}>
<FormattedMessage id="timeline.status.boosted" values={{ user: status.account.username }} />
</div>
</div>
Expand Down