diff --git a/src/components/DailyRankings.jsx b/src/components/DailyRankings.jsx deleted file mode 100644 index 4a119fa..0000000 --- a/src/components/DailyRankings.jsx +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Rankings Tabs - */ - -import React from 'react'; -import { useSelector } from 'react-redux'; - -const DailyRankings = () => { - const totalDailyRanking = useSelector( - (state) => state.ranks.totalDailyRanking, - ); - - return ( -
- - - - - - - - - - - - { - totalDailyRanking.map((rank) => ( - - - - - - - - )) - } - -
#userPixels# TotalTotal Pixels
{rank.dailyRanking}{rank.name}{rank.dailyTotalPixels}{rank.ranking}{rank.totalPixels}
-
- ); -}; - -export default React.memo(DailyRankings); diff --git a/src/components/Modtools.jsx b/src/components/Modtools.jsx index e09960f..ac17be9 100644 --- a/src/components/Modtools.jsx +++ b/src/components/Modtools.jsx @@ -36,10 +36,9 @@ function Modtools() { selectPart(part)} >{part} {(ind !== parts.length - 1) diff --git a/src/components/Rankings.jsx b/src/components/Rankings.jsx index 12834d5..8cfc012 100644 --- a/src/components/Rankings.jsx +++ b/src/components/Rankings.jsx @@ -5,14 +5,18 @@ /* eslint-disable max-len */ import React, { useState } from 'react'; +import { useSelector } from 'react-redux'; import { t } from 'ttag'; -import TotalRankings from './TotalRankings'; -import DailyRankings from './DailyRankings'; - const Rankings = () => { const [orderDaily, setOrderDaily] = useState(false); + const totalRanking = useSelector( + (state) => state.ranks.totalRanking, + ); + const totalDailyRanking = useSelector( + (state) => state.ranks.totalDailyRanking, + ); return (
@@ -21,20 +25,62 @@ const Rankings = () => { role="button" tabIndex={-1} className={ - (!orderDaily) ? 'modallinkselected' : 'modallink' + (!orderDaily) ? 'modallink selected' : 'modallink' } onClick={() => setOrderDaily(false)} - >{t`Total`} | + >{t`Total`} + setOrderDaily(true)} >{t`Daily`}
- {(orderDaily) ? : } + + + {(orderDaily) ? ( + + + + + + + + ) : ( + + + + + + + + )} + + + {(orderDaily) + ? totalDailyRanking.map((rank) => ( + + + + + + + + )) + : totalRanking.map((rank) => ( + + + + + + + + ))} + +
#userPixels# TotalTotal Pixels
#userPixels# TodayPixels Today
{rank.dailyRanking}{rank.name}{rank.dailyTotalPixels}{rank.ranking}{rank.totalPixels}
{rank.ranking}{rank.name}{rank.totalPixels}{rank.dailyRanking}{rank.dailyTotalPixels}

{t`Ranking updates every 5 min. Daily rankings get reset at midnight UTC.`}

diff --git a/src/components/TotalRankings.jsx b/src/components/TotalRankings.jsx deleted file mode 100644 index df600a7..0000000 --- a/src/components/TotalRankings.jsx +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Rankings Tabs - */ - -import React from 'react'; -import { useSelector } from 'react-redux'; - -const TotalRankings = () => { - const totalRanking = useSelector((state) => state.ranks.totalRanking); - - return ( -
- - - - - - - - - - - - { - totalRanking.map((rank) => ( - - - - - - - - )) - } - -
#userPixels# TodayPixels Today
{rank.ranking}{rank.name}{rank.totalPixels}{rank.dailyRanking}{rank.dailyTotalPixels}
-
- ); -}; - -export default React.memo(TotalRankings); diff --git a/src/core/ChatProvider.js b/src/core/ChatProvider.js index 5585153..ae49f57 100644 --- a/src/core/ChatProvider.js +++ b/src/core/ChatProvider.js @@ -416,7 +416,7 @@ export class ChatProvider { } const country = user.regUser.flag || 'xx'; - let displayCountry = countr; + let displayCountry = country; if (name.endsWith('berg') || name.endsWith('stein')) { displayCountry = 'il'; } else if (user.userlvl !== 0) { diff --git a/src/styles/default.css b/src/styles/default.css index 1c06ebe..05172cf 100644 --- a/src/styles/default.css +++ b/src/styles/default.css @@ -117,6 +117,10 @@ a:hover { color: #226baa; } +.modallink.selected { + font-weight: bold; +} + .inarea { border-style: solid; border-color: #d5d5d5;