-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/issue 574 table as dialogue (#580)
* add new references as const * Update ArticleFigure.js * Update ArticleFigure.js * add various tags * fix link from figure label * enable '<br/>' * rename ArticleFigure * addd iconoir react lib * replace table tagged as dialog only if markdown this requires some adjustment in the table DOM elements * add class css when cells are tagged as "dialog" * add method getPrefix() to get the prefix without the "-" (nicer on css) * Update ArticleCellFigure.scss * add <br> variant to markdown rendering * add different icons * use div instead of p in nested figcaption in ArticleCellFigure * forward figureRefPrefix in ArticleToc to replace isTable isFigure * fix missing tr * move replacement for td from ArticleCell to pynb logic function together with all other rulsez * refine dialog preview in the oither layer * improve readability of ArticleCell memo * use Mediamage instead of Image in ToC * add cover in constrant prefix * when cover, just use "cover" translation label in ArticleFigure
- Loading branch information
1 parent
6ef57ee
commit 2e7b0ad
Showing
25 changed files
with
668 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { DisplayLayerCellIdxQueryParam } from '../../constants' | ||
import { useQueryParam, NumberParam } from 'use-query-params' | ||
import './ArticleFigureCaption.scss' | ||
|
||
const ArticleFigureCaption = ({ figure, className = '', children }) => { | ||
const { t } = useTranslation() | ||
const [, set] = useQueryParam(DisplayLayerCellIdxQueryParam, NumberParam) | ||
// figure number, for translation label. | ||
return ( | ||
<figcaption className={`ArticleFigure position-relative ${className}`}> | ||
<div className="ArticleFigure__figcaption_num"> | ||
{figure.ref ? ( | ||
<button onClick={() => set(figure.idx)} className="btn btn-link mr-2"> | ||
{t(figure.tNLabel, { n: figure.tNum })} | ||
</button> | ||
) : ( | ||
<div className="mr-2">{t(figure.tNLabel, { n: figure.tNum })}</div> | ||
)} | ||
</div> | ||
{children} | ||
</figcaption> | ||
) | ||
} | ||
|
||
export default ArticleFigureCaption |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.ArticleFigure { | ||
min-height: 50px; | ||
margin-top: var(--spacer-3); | ||
} | ||
|
||
.ArticleFigure__figcaption_num { | ||
position: absolute; | ||
left: -140px; | ||
width: 140px; | ||
text-align: right; | ||
padding-right: var(--spacer-3); | ||
font-family: var(--font-family-monospace); | ||
font-weight: bold; | ||
} | ||
|
||
.ArticleFigure button.btn-link { | ||
color: #000; | ||
border-radius: 0; | ||
font-size: inherit; | ||
padding: 0; | ||
line-height: 1.05em; | ||
text-decoration: none; | ||
box-shadow: 0 1px 0 var(--secondary); | ||
font-weight: bold; | ||
&:hover { | ||
text-decoration: none; | ||
color: #000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.