mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
adapt link to listing in grid view to behave like a real link
This commit is contained in:
@@ -103,6 +103,10 @@ const ListingsGrid = () => {
|
|||||||
setPage(_page);
|
setPage(_page);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const cap = (val) => {
|
||||||
|
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="listingsGrid">
|
<div className="listingsGrid">
|
||||||
<div className="listingsGrid__searchbar">
|
<div className="listingsGrid__searchbar">
|
||||||
@@ -251,11 +255,9 @@ const ListingsGrid = () => {
|
|||||||
bodyStyle={{ padding: '12px' }}
|
bodyStyle={{ padding: '12px' }}
|
||||||
>
|
>
|
||||||
<div className="listingsGrid__content">
|
<div className="listingsGrid__content">
|
||||||
<a href={item.url} target="_blank" rel="noopener noreferrer" className="listingsGrid__titleLink">
|
<Text strong ellipsis={{ showTooltip: true }} className="listingsGrid__title">
|
||||||
<Text strong ellipsis={{ showTooltip: true }} className="listingsGrid__title">
|
{cap(item.title)}
|
||||||
{item.title}
|
</Text>
|
||||||
</Text>
|
|
||||||
</a>
|
|
||||||
<Space vertical align="start" spacing={2} style={{ width: '100%', marginTop: 8 }}>
|
<Space vertical align="start" spacing={2} style={{ width: '100%', marginTop: 8 }}>
|
||||||
<Text type="secondary" icon={<IconCart />} size="small">
|
<Text type="secondary" icon={<IconCart />} size="small">
|
||||||
{item.price} €
|
{item.price} €
|
||||||
@@ -287,15 +289,11 @@ const ListingsGrid = () => {
|
|||||||
</Space>
|
</Space>
|
||||||
<Divider margin=".6rem" />
|
<Divider margin=".6rem" />
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
<Button
|
<div className="listingsGrid__linkButton">
|
||||||
title="Link to listing"
|
<a href={item.link} target="_blank" rel="noopener noreferrer">
|
||||||
type="primary"
|
<IconLink />
|
||||||
size="small"
|
</a>
|
||||||
onClick={async () => {
|
</div>
|
||||||
window.open(item.link);
|
|
||||||
}}
|
|
||||||
icon={<IconLink />}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
title="Remove"
|
title="Remove"
|
||||||
|
|||||||
@@ -103,4 +103,17 @@
|
|||||||
&__setupButton {
|
&__setupButton {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__linkButton {
|
||||||
|
background: var(--semi-color-fill-0);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
height: 24px;
|
||||||
|
width: 24px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user