Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…lient into draft/cranky-lehmann
  • Loading branch information
alexnm committed Aug 20, 2024
2 parents 46a3b20 + 84311d6 commit 2ff6196
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,15 @@ export const SandboxCard = ({
<CardContent selected={selected}>
<Stack direction="vertical" gap={0}>
<SandboxTitle brightness={thumbnail.brightness} {...props} />
<Text
size={12}
truncate
css={{ marginLeft: 28, color: userNameTextColor }}
>
Created by {username}
</Text>
{username ? (
<Text
size={12}
truncate
css={{ marginLeft: 28, color: userNameTextColor }}
>
Created by {username}
</Text>
) : null}
</Stack>
<SandboxStats
noDrag={noDrag}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const SandboxListItem = ({
variant={selected ? 'body' : 'muted'}
maxWidth="100%"
>
{timeAgo} by {username}
{timeAgo} {username ? `by ${username}` : ''}
</Text>
)}
</Column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ const GenericSandbox = ({ isScrolling, item, page }: GenericSandboxProps) => {
{...interactionProps}
isScrolling={isScrolling}
username={
sandboxProps.sandbox.author &&
sandboxProps.sandbox.author.username === user?.username
? 'you'
: sandboxProps.sandbox.author.username
: sandboxProps.sandbox.author?.username || null
}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface SandboxItemComponentProps {
PrivacyIcon: React.FC;
screenshotUrl: string | null;
restricted: boolean;
username: string;
username: string | null;
interaction: 'button' | 'link';
isScrolling: boolean;
selected: boolean;
Expand Down

0 comments on commit 2ff6196

Please sign in to comment.