feature : Option to show / hide author details (#899)

* feature : option to show author details

* added languages

* feat: added dates proper format

final
This commit is contained in:
MAYUR
2024-10-14 10:50:11 +00:00
committed by GitHub
parent 03de2ecc3f
commit 30130e5e99
26 changed files with 69 additions and 29 deletions

View File

@@ -82,6 +82,8 @@ class Quote extends PureComponent {
this.quote = createRef();
this.quotediv = createRef();
this.quoteauthor = createRef();
this.authorDetails = localStorage.getItem('authorDetails') === 'true' ? true : false;
console.log("authorDetails", this.authorDetails);
}
useFavourite() {
@@ -355,8 +357,12 @@ class Quote extends PureComponent {
setZoom() {
const zoomQuote = Number((localStorage.getItem('zoomQuote') || 100) / 100);
this.quote.current.style.fontSize = `${0.8 * zoomQuote}em`;
this.quoteauthor.current.style.fontSize = `${0.9 * zoomQuote}em`;
if (this.quote.current) {
this.quote.current.style.fontSize = `${0.8 * zoomQuote}em`;
}
if (this.quoteauthor.current) {
this.quoteauthor.current.style.fontSize = `${0.9 * zoomQuote}em`;
}
}
componentDidMount() {
@@ -429,6 +435,8 @@ class Quote extends PureComponent {
{localStorage.getItem('widgetStyle') === 'legacy' ? (
<>
{ this.authorDetails && (
<>
<div>
<h1 className="quoteauthor" ref={this.quoteauthor}>
<a
@@ -445,8 +453,13 @@ class Quote extends PureComponent {
<div style={{ display: 'flex', justifyContent: 'center', gap: '20px' }}>
{this.state.copy} {this.state.share} {this.state.favourited}
</div>
</>
)}
</>
) : (
<>
{ this.authorDetails && (
<>
<div className="author-holder">
<div className="author">
{localStorage.getItem('authorImg') !== 'false' ? (
@@ -499,6 +512,9 @@ class Quote extends PureComponent {
) : null}
</div>
</div>
</>
)}
</>
)}
</div>
);

View File

@@ -144,15 +144,22 @@ class QuoteOptions extends PureComponent {
subtitle={variables.getMessage(`${QUOTE_SECTION}.additional`)}
/>
<Action>
<Checkbox
name="authorDetails"
text = {variables.getMessage(`${QUOTE_SECTION}.author_details`)}
element=".other"
/>
<Checkbox
name="authorLink"
text={variables.getMessage(`${QUOTE_SECTION}.author_link`)}
element=".other"
disabled={localStorage.getItem('authorDetails')==='false'}
/>
<Checkbox
name="authorImg"
text={variables.getMessage(`${QUOTE_SECTION}.author_img`)}
element=".other"
disabled={localStorage.getItem('authorDetails')==='false'}
/>
</Action>
</Row>