increase calendar and news number of cards
This commit is contained in:
@@ -12,9 +12,11 @@ interface EventCalendarProps {
|
||||
events: Event[];
|
||||
}
|
||||
|
||||
const DEFAULT_NUMBER_SHOWN = 10;
|
||||
|
||||
const EventCalendar: React.FC<EventCalendarProps> = ({ events }) => {
|
||||
// const [filterSelected, setFilter] = useState(0);
|
||||
const [numberShown, setNumberShown] = useState(8);
|
||||
const [numberShown, setNumberShown] = useState(DEFAULT_NUMBER_SHOWN);
|
||||
|
||||
const { t, i18n } = useTranslation();
|
||||
const isFi = i18n.language === "fi";
|
||||
@@ -69,7 +71,7 @@ const EventCalendar: React.FC<EventCalendarProps> = ({ events }) => {
|
||||
</CardSection>
|
||||
{ numberShown < events.length && (
|
||||
<FilterContainer>
|
||||
<Button buttonStyle="bordered" onClick={() => { setNumberShown(numberShown + 8); }}>
|
||||
<Button buttonStyle="bordered" onClick={() => { setNumberShown(numberShown + DEFAULT_NUMBER_SHOWN); }}>
|
||||
{t("Lataa lisää")}
|
||||
</Button>
|
||||
</FilterContainer>
|
||||
|
||||
@@ -12,9 +12,11 @@ interface NewsProps {
|
||||
feed: Post[];
|
||||
}
|
||||
|
||||
const DEFAULT_NUMBER_SHOWN = 10;
|
||||
|
||||
const News: React.FC<NewsProps> = ({ feed }) => {
|
||||
// const [filterSelected, setFilter] = useState(0);
|
||||
const [numberShown, setNumberShown] = useState(8);
|
||||
const [numberShown, setNumberShown] = useState(DEFAULT_NUMBER_SHOWN);
|
||||
|
||||
const { i18n, t } = useTranslation();
|
||||
const isFi = i18n.language === "fi";
|
||||
@@ -65,7 +67,7 @@ const News: React.FC<NewsProps> = ({ feed }) => {
|
||||
</CardSection>
|
||||
{ numberShown < feed.length && (
|
||||
<FilterContainer>
|
||||
<Button buttonStyle="bordered" onClick={() => { setNumberShown(numberShown + 8); }}>
|
||||
<Button buttonStyle="bordered" onClick={() => { setNumberShown(numberShown + DEFAULT_NUMBER_SHOWN); }}>
|
||||
{t("Lataa lisää")}
|
||||
</Button>
|
||||
</FilterContainer>
|
||||
|
||||
Reference in New Issue
Block a user