Skip to content

Commit

Permalink
CORE: oai width
Browse files Browse the repository at this point in the history
  • Loading branch information
ekachxaidze98 committed Jan 4, 2024
1 parent 69dca1e commit 2dbc858
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 43 deletions.
1 change: 1 addition & 0 deletions modules/notification/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
color: var(--white);
background-color: var(--gray-600);
border-radius: 0.5rem;
width: max-content;
}
94 changes: 51 additions & 43 deletions templates/output/card-dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,37 @@ const CardDropdown = ({
)

const EllipsisText = (text) =>
text?.length > 22 ? `${text.substring(0, 22)}...` : text
text?.length > 30 ? `${text.substring(0, 30)}...` : text

const renderOAI = (
<Card.Description className={classNames.use(styles.identifier)} tag="span">
<img
src={getAssetsPath('/static/images/oai.svg')}
alt="oai"
className={styles.logo}
/>
<a
className={styles.ellipsis}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
href={`https://api.core.ac.uk/oai/${oai}`}
>
{EllipsisText(oai)}
</a>
{isTooltipVisible && <div className={styles.tooltip}>{oai}</div>}
<Icon
src="#content-copy"
className={styles.iconCopy}
onClick={(e) => {
e.stopPropagation()
copyUrl()
}}
/>
{copyUrlStatus === 'copied' && <Notification text="Copied" />}
<div className={styles.innerIdentifier}>
<img
src={getAssetsPath('/static/images/oai.svg')}
alt="oai"
className={styles.logo}
/>
<a
className={styles.ellipsis}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
href={`https://api.core.ac.uk/oai/${oai}`}
>
{EllipsisText(oai)}
</a>
{isTooltipVisible && <div className={styles.tooltip}>{oai}</div>}
</div>
<div>
<Icon
src="#content-copy"
className={styles.iconCopy}
onClick={(e) => {
e.stopPropagation()
copyUrl()
}}
/>
{copyUrlStatus === 'copied' && <Notification text="Copied" />}
</div>
</Card.Description>
)

Expand Down Expand Up @@ -148,25 +152,29 @@ const CardDropdown = ({
className={classNames.use(styles.identifier)}
tag="span"
>
<img
src={getAssetsPath('/static/images/oai.svg')}
alt="oai"
className={styles.oaiLogo}
/>
<a
className={styles.ellipsis}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
href={`https://api.core.ac.uk/oai/${oai}`}
>
{EllipsisText(oai)}
</a>
<Icon
src="#content-copy"
className={styles.iconCopy}
onClick={copyUrl}
/>
{copyUrlStatus === 'copied' && <Notification text="Copied" />}
<div className={styles.innerIdentifier}>
<img
src={getAssetsPath('/static/images/oai.svg')}
alt="oai"
className={styles.oaiLogo}
/>
<a
className={styles.ellipsis}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
href={`https://api.core.ac.uk/oai/${oai}`}
>
{EllipsisText(oai)}
</a>
</div>
<div>
<Icon
src="#content-copy"
className={styles.iconCopy}
onClick={copyUrl}
/>
{copyUrlStatus === 'copied' && <Notification text="Copied" />}
</div>
</Card.Description>
)}
{(updatedDate || createdDate) && (
Expand Down
7 changes: 7 additions & 0 deletions templates/output/card-dropdown.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
color: var(--primary);
}

.inner-identifier {
display: flex;
align-items: center;
justify-content: center;
}

.icon-copy {
margin-left: 0.6rem;
cursor: pointer;
Expand Down

0 comments on commit 2dbc858

Please sign in to comment.