Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from mue:main #22

Merged
merged 10 commits into from
Oct 16, 2024
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@
"@fontsource/lexend-deca": "5.0.14",
"@fontsource/montserrat": "5.0.19",
"@muetab/react-sortable-hoc": "^2.0.1",
"@mui/material": "6.1.3",
"@sentry/react": "^8.33.1",
"@mui/material": "6.1.4",
"@sentry/react": "^8.34.0",
"embla-carousel-autoplay": "8.3.0",
"embla-carousel-react": "8.3.0",
"fast-blurhash": "^1.1.4",
"image-conversion": "^2.1.1",
"mue": "file:",
"react": "^18.3.1",
"react-best-gradient-color-picker": "^3.0.10",
"react-clock": "5.0.0",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-modal": "3.16.1",
"react-toastify": "10.0.5",
"use-debounce": "^10.0.3"
"react-toastify": "10.0.6",
"use-debounce": "^10.0.4"
},
"devDependencies": {
"@commitlint/cli": "^19.5.0",
Expand All @@ -45,10 +46,10 @@
"husky": "^9.1.6",
"prettier": "^3.3.3",
"sass": "^1.79.5",
"stylelint": "^16.9.0",
"stylelint": "^16.10.0",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-scss": "^6.7.0",
"vite": "5.4.8",
"vite": "5.4.9",
"vite-plugin-progress": "^0.0.7"
},
"scripts": {
Expand Down
2,615 changes: 1,246 additions & 1,369 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions src/features/quote/Quote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Quote extends PureComponent {
this.quote = createRef();
this.quotediv = createRef();
this.quoteauthor = createRef();
this.authorDetails = (localStorage.getItem('authorDetails') === 'true' || true) ? true : false;
}

useFavourite() {
Expand Down Expand Up @@ -355,8 +356,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() {
Expand Down Expand Up @@ -429,6 +434,8 @@ class Quote extends PureComponent {

{localStorage.getItem('widgetStyle') === 'legacy' ? (
<>
{ this.authorDetails && (
<>
<div>
<h1 className="quoteauthor" ref={this.quoteauthor}>
<a
Expand All @@ -445,8 +452,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' ? (
Expand Down Expand Up @@ -499,6 +511,9 @@ class Quote extends PureComponent {
) : null}
</div>
</div>
</>
)}
</>
)}
</div>
);
Expand Down
7 changes: 7 additions & 0 deletions src/features/quote/options/QuoteOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
46 changes: 20 additions & 26 deletions src/features/time/Date.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,26 @@ export default class DateWidget extends PureComponent {
if (timezone && timezone !== 'auto') {
date = convertTimezone(date, timezone);
}

if (localStorage.getItem('weeknumber') === 'true') {
this.getWeekNumber(date);
} else if (this.state.weekNumber !== null) {
this.setState({
weekNumber: null,
});
}

if (localStorage.getItem('dateType') === 'short') {
const dateDay = date.getDate();
const dateMonth = date.getMonth() + 1;
const dateYear = date.getFullYear();

const zero = localStorage.getItem('datezero') === 'true';

let day = zero ? ('00' + dateDay).slice(-2) : dateDay;
let month = zero ? ('00' + dateMonth).slice(-2) : dateMonth;
let year = dateYear;

switch (localStorage.getItem('dateFormat')) {
case 'MDY':
day = dateMonth;
Expand All @@ -78,7 +78,7 @@ export default class DateWidget extends PureComponent {
default:
break;
}

let format;
switch (localStorage.getItem('shortFormat')) {
case 'dots':
Expand All @@ -96,47 +96,41 @@ export default class DateWidget extends PureComponent {
default:
break;
}

this.setState({
date: format,
});
} else {
// Long date
const lang = variables.languagecode.split('_')[0];

const datenth =
localStorage.getItem('datenth') === 'true' ? nth(date.getDate()) : date.getDate();

const dateDay =
localStorage.getItem('dayofweek') === 'true'
? date.toLocaleDateString(lang, { weekday: 'long' })
: '';
const datenth = localStorage.getItem('datenth') === 'true' ? nth(date.getDate()) : date.getDate();
const dateDay = localStorage.getItem('dayofweek') === 'true'
? date.toLocaleDateString(lang, { weekday: 'long' })
: '';
const dateMonth = date.toLocaleDateString(lang, { month: 'long' });
const dateYear = date.getFullYear();

let day = dateDay + ' ' + datenth;
let month = dateMonth;
let year = dateYear;

let formattedDate;

switch (localStorage.getItem('longFormat')) {
case 'MDY':
day = dateMonth;
month = dateDay + ' ' + datenth;
formattedDate = `${dateMonth} ${datenth}, ${dateYear}${dateDay ? `, ${dateDay}` : ''}`;
break;
case 'YMD':
day = dateYear;
year = dateDay + ' ' + datenth;
formattedDate = `${dateYear} ${dateMonth} ${datenth}${dateDay ? `, ${dateDay}` : ''}`;
break;
// DMY
default:
formattedDate = `${datenth} ${dateMonth} ${dateYear}${dateDay ? `, ${dateDay}` : ''}`;
break;
}

this.setState({
date: `${day} ${month} ${year}`,
date: formattedDate,
});
}
}

componentDidMount() {
EventBus.on('refresh', (data) => {
if (data === 'date' || data === 'timezone') {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
"author": "Müəllif",
"author_img": "Müəllif şəkli göstər",
"author_link": "Müəllif linki",
"author_details": "Müəllif məlumatlarını",
"buttons": {
"copy": "Kopyala",
"favourite": "Sevimli",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/azb.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
"author": "Müəllif",
"author_img": "Müəllif şəklini göstər",
"author_link": "Müəllif linki",
"author_details": "Müəllif məlumatlarını",
"buttons": {
"copy": "Kopyala",
"favourite": "Sevimli",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Quote",
"additional": "উদ্ধৃতি উইজেটের শৈলী কাস্টমাইজ করার জন্য অন্যান্য সেটিংস",
"author_link": "লেখকের লিঙ্ক",
"author_details": "লেখকের বিস্তারিত তথ্য",
"custom": "Custom quote",
"custom_subtitle": "Set your own custom quotes",
"no_quotes": "No quotes",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Zitat",
"additional": "Zusätzliche Einstellungen zum Anpassen des Zitate-Widgets",
"author_link": "Autor Link",
"author_details": "Autor Details",
"custom": "Benutzerdefiniertes Zitat",
"custom_subtitle": "Legen Sie Ihre eigenen Zitate fest",
"no_quotes": "Keine Zitate",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Quote",
"additional": "Other settings to customise the style of the quote widget",
"author_link": "Author link",
"author_details": "Author details",
"custom": "Custom quote",
"custom_subtitle": "Set your own custom quotes",
"no_quotes": "No quotes",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Quote",
"additional": "Other settings to customise the style of the quote widget",
"author_link": "Author link",
"author_details": "Author details",
"custom": "Custom quote",
"custom_subtitle": "Set your own custom quotes",
"no_quotes": "No quotes",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
"author": "Autor",
"author_img": "Mostrar la imagen del autor",
"author_link": "Enlace del autor",
"author_details": "Detalles del autor",
"buttons": {
"copy": "Botón de copiar",
"favourite": "Botón de favoritos",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Citación",
"additional": "Other settings to customise the style of the quote widget",
"author_link": "Enlace del autor",
"author_details": "Detalles del autor",
"custom": "Citación personalizada",
"custom_subtitle": "Set your own custom quotes",
"no_quotes": "No quotes",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
"author": "Autor",
"author_img": "Näita autori pilti",
"author_link": "Autori link",
"author_details": "Näita autori üksikasju",
"buttons": {
"copy": "Kopeeri",
"favourite": "Lisa lemmikuks",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Quote",
"additional": "Other settings to customise the style of the quote widget",
"author_link": "Author link",
"author_details": "Author details",
"custom": "Custom quote",
"custom_subtitle": "Set your own custom quotes",
"no_quotes": "No quotes",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
"author": "Auteur",
"author_img": "Afficher l'image de l'auteur",
"author_link": "Lien de l'auteur",
"author_details": "Détails de l'auteur",
"buttons": {
"copy": "Copier",
"favourite": "Favori",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/id_ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Kutipan",
"additional": "Pengaturan lain untuk menyesuaikan gaya widget kutipan",
"author_link": "Pranala penulis",
"author_details": "Tampilkan detail penulis",
"custom": "Kutipan kustom",
"custom_subtitle": "Tetapkan kutipan khusus Anda sendiri",
"no_quotes": "Tidak ada kutipan",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
"author": "Autorius",
"author_img": "Rodyti autoriaus nuotrauką",
"author_link": "Autoriaus nuoroda",
"author_details": "Rodyti autoriaus informaciją",
"buttons": {
"copy": "Kopijuoti",
"favourite": "Mėgstama",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/lv.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
"author": "Autors",
"author_img": "Rādīt autora attēlu",
"author_link": "Autora saite",
"author_details": "Rādīt autora detaļas",
"buttons": {
"copy": "Kopēt",
"favourite": "Pievienot izlasei",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Citaat",
"additional": "Andere instellingen om de stijl van het citaten widget te veranderen",
"author_link": "Author link",
"author_details": "Author details",
"custom": "Custom quote",
"custom_subtitle": "Schrijf je eigen citaten",
"no_quotes": "Geen citaten",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Sitat",
"additional": "Other settings to customise the style of the quote widget",
"author_link": "Author link",
"author_details": "Author details",
"custom": "Custom quote",
"custom_subtitle": "Set your own custom quotes",
"no_quotes": "No quotes",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Citações",
"additional": "Outras configurações para personalizar o estilo do widget de citações",
"author_link": "Ligação do autor",
"author_details": "Detalhes do autor",
"custom": "Citação personalizada",
"custom_subtitle": "Define as suas próprias citações personalizadas",
"no_quotes": "sem aspas",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"title": "Citações",
"additional": "Outras configurações para personalizar o estilo do widget de citações",
"author_link": "link do autor",
"author_details": "Detalhes do autor",
"custom": "Citação personalizada",
"custom_subtitle": "Defina suas próprias citações personalizadas",
"no_quotes": "sem aspas",
Expand Down
Loading
Loading