Skip to content

Commit a5c49ee

Browse files
committed
Merge branch 'dap-4799' of github.com:dapplets/mutable-web-monorepo into dap-4799
2 parents 5563a21 + f1d25e8 commit a5c49ee

File tree

3 files changed

+41
-15
lines changed

3 files changed

+41
-15
lines changed

apps/extension/src/contentscript/multitable-panel/components/application-card.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ const CardContent = styled.div`
4242
width: 100%;
4343
`
4444

45-
type TTextLink = {
45+
type TText = {
4646
bold?: boolean
4747
small?: boolean
4848
ellipsis?: boolean
4949
$color?: string
5050
}
5151

52-
const TextLink = styled.div<TTextLink>`
52+
const Text = styled.div<TText>`
5353
display: block;
5454
margin: 0;
5555
font-size: 14px;
@@ -117,7 +117,7 @@ const SideLine = styled.div`
117117
`
118118

119119
const DocumentCardList = styled.div`
120-
width: 100%;
120+
width: calc(100% - 32px);
121121
margin-right: 10px;
122122
display: flex;
123123
flex-direction: column;
@@ -241,16 +241,27 @@ const ApplicationCard: React.FC<IApplicationCard> = ({
241241
</Thumbnail>
242242

243243
<CardContent>
244-
<TextLink $color={textColor} bold ellipsis>
244+
<Text $color={textColor} bold ellipsis>
245245
{metadata.name || appId}
246-
</TextLink>
246+
</Text>
247247

248-
<TextLink small ellipsis>
248+
<Text small ellipsis>
249249
{source === EntitySourceType.Local && (
250-
<Badge margin="0 8px 0 0" text={source} theme={'yellow'} />
250+
<Badge
251+
margin="0 8px 0 0"
252+
text={source}
253+
theme={'yellow'}
254+
style={{ transform: 'translate(0px, -1px)' }}
255+
/>
251256
)}{' '}
252257
{accountId ? `@${accountId}` : null}
253-
</TextLink>
258+
</Text>
259+
260+
{src ? (
261+
<Text small ellipsis title={src}>
262+
{`ID: ${src}`}
263+
</Text>
264+
) : null}
254265
</CardContent>
255266

256267
<ButtonLink

apps/extension/src/contentscript/multitable-panel/components/badge.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,26 @@ export interface IBadgeProps {
5959
size?: keyof typeof SizeMap
6060
icon?: React.JSX.Element
6161
onClick?: React.MouseEventHandler<HTMLSpanElement>
62+
style?: React.CSSProperties
6263
}
6364

64-
export const Badge: FC<IBadgeProps> = ({ text, theme, margin, icon, onClick, size = 'tiny' }) => {
65+
export const Badge: FC<IBadgeProps> = ({
66+
text,
67+
theme,
68+
margin,
69+
icon,
70+
onClick,
71+
size = 'tiny',
72+
style,
73+
}) => {
6574
return (
6675
<Wrapper
6776
$margin={margin}
6877
$theme={theme}
6978
onClick={onClick}
7079
$isClickable={!!onClick}
7180
$size={size}
81+
style={style}
7282
>
7383
{icon ? <span style={{ fontSize: SizeMap[size].iconSize }}>{icon}</span> : null}
7484
<span>{text}</span>

apps/extension/src/contentscript/multitable-panel/components/document-card.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const Card = styled.div`
1010
border-radius: 10px;
1111
background: #f8f9ff;
1212
border: 1px solid #eceef0;
13-
font-family: sans-serif;
1413
&:hover {
1514
background: rgba(24, 121, 206, 0.1);
1615
}
@@ -90,7 +89,7 @@ const CardContent = styled.div`
9089
width: 100%;
9190
`
9291

93-
const TextLink = styled.div<{ bold?: boolean; small?: boolean; ellipsis?: boolean }>`
92+
const Text = styled.div<{ bold?: boolean; small?: boolean; ellipsis?: boolean }>`
9493
display: block;
9594
margin: 0;
9695
font-size: 14px;
@@ -171,16 +170,22 @@ export const DocumentCard: React.FC<Props> = ({
171170
</ThumbnailGroup>
172171

173172
<CardContent>
174-
<TextLink bold ellipsis>
173+
<Text bold ellipsis>
175174
{metadata?.name || (srcParts && srcParts[2]) || 'New Document'}
176-
</TextLink>
175+
</Text>
177176

178-
<TextLink small ellipsis>
177+
<Text small ellipsis>
179178
{source === EntitySourceType.Local && (
180179
<Badge margin="0 8px 0 0" text={source} theme={'yellow'} />
181180
)}{' '}
182181
{srcParts?.[0] && `@${srcParts[0]}`}
183-
</TextLink>
182+
</Text>
183+
184+
{src ? (
185+
<Text small ellipsis title={src}>
186+
{`ID: ${src}`}
187+
</Text>
188+
) : null}
184189
</CardContent>
185190
<ButtonLink className={disabled ? 'disabled' : ''} disabled={disabled} onClick={onChange}>
186191
<CheckedIcon />

0 commit comments

Comments
 (0)