Skip to content
Snippets Groups Projects
Commit 2dd3c52f authored by xaralis's avatar xaralis
Browse files

feat: display member group size, update default filtering

parent e060ae5e
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ const PostScore = ({ ...@@ -12,7 +12,7 @@ const PostScore = ({
? "bg-grey-125 text-grey-200" ? "bg-grey-125 text-grey-200"
: { : {
"bg-red-600 text-white": score < 0, "bg-red-600 text-white": score < 0,
"bg-grey-125 text-grey-200": score === 0, "bg-grey-125 text-grey-200": score === 0 && score < supportThreshold,
"bg-yellow-400 text-grey-300": "bg-yellow-400 text-grey-300":
score > 0 && hasDislikes && score < supportThreshold, score > 0 && hasDislikes && score < supportThreshold,
"bg-green-400 text-white": "bg-green-400 text-white":
......
...@@ -6,8 +6,12 @@ import pick from "lodash/pick"; ...@@ -6,8 +6,12 @@ import pick from "lodash/pick";
import { GlobalInfoStore, ProgramStore } from "stores"; import { GlobalInfoStore, ProgramStore } from "stores";
const GlobalStats = () => { const GlobalStats = () => {
const { onlineUsers, onlineMembers } = GlobalInfoStore.useState((state) => const {
pick(state, ["onlineUsers", "onlineMembers"]) onlineUsers,
onlineMembers,
groupSizeHalf,
} = GlobalInfoStore.useState((state) =>
pick(state, ["onlineUsers", "onlineMembers", "groupSizeHalf"])
); );
const { currentId, scheduleIds, items } = ProgramStore.useState((state) => const { currentId, scheduleIds, items } = ProgramStore.useState((state) =>
pick(state, ["currentId", "scheduleIds", "items"]) pick(state, ["currentId", "scheduleIds", "items"])
...@@ -22,7 +26,7 @@ const GlobalStats = () => { ...@@ -22,7 +26,7 @@ const GlobalStats = () => {
: null; : null;
return ( return (
<div className="bg-grey-50 flex space-x-4 leading-normal px-4 py-2 text-xs md:text-sm text-grey-300"> <div className="bg-grey-50 flex space-x-4 leading-normal px-4 py-2 text-2xs md:text-xs lg:text-sm text-grey-300">
<div> <div>
<strong>{onlineMembers}</strong>{" "} <strong>{onlineMembers}</strong>{" "}
<span> <span>
...@@ -34,6 +38,9 @@ const GlobalStats = () => { ...@@ -34,6 +38,9 @@ const GlobalStats = () => {
<div> <div>
<strong>{onlineUsers}</strong> <span>online celkem</span> <strong>{onlineUsers}</strong> <span>online celkem</span>
</div> </div>
<div>
<span>Vel. skupiny členů je</span> <strong>{groupSizeHalf}</strong>
</div>
{nextProgramEntry && ( {nextProgramEntry && (
<div className="flex-grow text-right hidden sm:block lg:hidden xl:block"> <div className="flex-grow text-right hidden sm:block lg:hidden xl:block">
Následuje:{" "} Následuje:{" "}
......
...@@ -52,8 +52,8 @@ const postStoreInitial = { ...@@ -52,8 +52,8 @@ const postStoreInitial = {
perPage: 20, perPage: 20,
}, },
filters: { filters: {
flags: "all", flags: "active",
sort: "byDate", sort: "byScore",
type: "all", type: "all",
showPendingProposals: false, showPendingProposals: false,
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment