Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Update session details styles to closer match latest Figma #2439

Merged
merged 12 commits into from
Mar 8, 2024

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Mar 4, 2024

For #2147

image
image
image

@t3chguy t3chguy added the T-Enhancement New feature of request label Mar 4, 2024
Copy link

cloudflare-workers-and-pages bot commented Mar 4, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 17225dd
Status: ✅  Deploy successful!
Preview URL: https://be3e0bd1.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://t3chguy-fix-2147.matrix-authentication-service-docs.pages.dev

View logs

@t3chguy t3chguy marked this pull request as ready for review March 4, 2024 13:43
@t3chguy t3chguy requested a review from sandhose March 4, 2024 13:43
Copy link
Member

@sandhose sandhose left a comment

Choose a reason for hiding this comment

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

The generic session details component still feels messy, but I'm fine with refactoring that later.

Left a few comments but other than that LGTM

@t3chguy t3chguy requested a review from sandhose March 5, 2024 14:32
@t3chguy
Copy link
Member Author

t3chguy commented Mar 5, 2024

The generic session details component still feels messy, but I'm fine with refactoring that later.

That component gets deleted by the end of the PR, no? Or do you mean the details prop behaviour?

@t3chguy t3chguy self-assigned this Mar 8, 2024
@sandhose
Copy link
Member

sandhose commented Mar 8, 2024

That component gets deleted by the end of the PR, no? Or do you mean the details prop behaviour?

I meant that this component has a lot of logic in it. Sure, it avoids repeating stuff across the three sessions, but I prefer the approach of composing different components like on the session card:

return (
<Card.Root>
<Card.LinkBody
to="/sessions/$id"
params={{ id: data.id }}
disabled={!!data.finishedAt}
>
<Card.Header type={deviceType}>
<Card.Name name={deviceName} />
{clientName && <Card.Client name={clientName} />}
</Card.Header>
<Card.Metadata>
{lastActiveAt && !isCurrent && (
<Card.Info label={t("frontend.session.last_active_label")}>
<LastActive lastActive={lastActiveAt} />
</Card.Info>
)}
<Card.Info label={t("frontend.session.signed_in_label")}>
<DateTime datetime={createdAt} />
</Card.Info>
{isCurrent && (
<Badge kind="success" className="self-center">
{t("frontend.session.current")}
</Badge>
)}
</Card.Metadata>
</Card.LinkBody>
{!data.finishedAt && (
<Card.Action>
<EndSessionButton endSession={onSessionEnd}>
<Card.Body compact>
<Card.Header type={deviceType}>
<Card.Name name={deviceName} />
{clientName && <Card.Client name={clientName} />}
</Card.Header>
</Card.Body>
</EndSessionButton>
</Card.Action>
)}
</Card.Root>
);

@t3chguy
Copy link
Member Author

t3chguy commented Mar 8, 2024

it avoids repeating stuff across the three sessions

I think this is key to a consistent coherent design, otherwise you have to manually sync the 3 session components for copy and order to keep them consistent with each other. Personally not a fan, but at the end of the day this is your project

@sandhose
Copy link
Member

sandhose commented Mar 8, 2024

I'm fine with leaving it like that for now 👍

@t3chguy t3chguy enabled auto-merge (squash) March 8, 2024 14:35
@t3chguy t3chguy merged commit 57c5e86 into main Mar 8, 2024
16 checks passed
@sandhose sandhose deleted the t3chguy/fix/2147 branch March 19, 2024 10:55
@sandhose sandhose added the A-Frontend Changes on the React frontend label Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Frontend Changes on the React frontend T-Enhancement New feature of request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants