mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
use ActionButton to reduce space used on mobile
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { t } from "@lingui/macro"
|
import { t } from "@lingui/macro"
|
||||||
import { Checkbox, Group, Indicator, MultiSelect, Popover } from "@mantine/core"
|
import { Group, Indicator, MultiSelect, Popover } from "@mantine/core"
|
||||||
import { useMediaQuery } from "@mantine/hooks"
|
import { useMediaQuery } from "@mantine/hooks"
|
||||||
import { Constants } from "app/constants"
|
import { Constants } from "app/constants"
|
||||||
import { markEntriesUpToEntry, markEntry, starEntry, tagEntry } from "app/slices/entries"
|
import { markEntriesUpToEntry, markEntry, starEntry, tagEntry } from "app/slices/entries"
|
||||||
@@ -7,7 +7,7 @@ import { useAppDispatch, useAppSelector } from "app/store"
|
|||||||
import { Entry } from "app/types"
|
import { Entry } from "app/types"
|
||||||
import { ActionButton } from "components/ActionButtton"
|
import { ActionButton } from "components/ActionButtton"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { TbArrowBarToDown, TbExternalLink, TbShare, TbStar, TbStarOff, TbTag } from "react-icons/tb"
|
import { TbArrowBarToDown, TbExternalLink, TbEyeCheck, TbEyeOff, TbShare, TbStar, TbStarOff, TbTag } from "react-icons/tb"
|
||||||
import { ShareButtons } from "./ShareButtons"
|
import { ShareButtons } from "./ShareButtons"
|
||||||
|
|
||||||
interface FeedEntryFooterProps {
|
interface FeedEntryFooterProps {
|
||||||
@@ -24,7 +24,7 @@ export function FeedEntryFooter(props: FeedEntryFooterProps) {
|
|||||||
const showSharingButtons =
|
const showSharingButtons =
|
||||||
sharingSettings && (Object.values(sharingSettings) as Array<typeof sharingSettings[keyof typeof sharingSettings]>).some(v => v)
|
sharingSettings && (Object.values(sharingSettings) as Array<typeof sharingSettings[keyof typeof sharingSettings]>).some(v => v)
|
||||||
|
|
||||||
const readStatusCheckboxClicked = () => dispatch(markEntry({ entry: props.entry, read: !props.entry.read }))
|
const readStatusButtonClicked = () => dispatch(markEntry({ entry: props.entry, read: !props.entry.read }))
|
||||||
const onTagsChange = (values: string[]) =>
|
const onTagsChange = (values: string[]) =>
|
||||||
dispatch(
|
dispatch(
|
||||||
tagEntry({
|
tagEntry({
|
||||||
@@ -45,14 +45,10 @@ export function FeedEntryFooter(props: FeedEntryFooterProps) {
|
|||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Group>
|
<Group>
|
||||||
{props.entry.markable && (
|
{props.entry.markable && (
|
||||||
<Checkbox
|
<ActionButton
|
||||||
label={t`Keep unread`}
|
icon={props.entry.read ? <TbEyeOff size={18} /> : <TbEyeCheck size={18} />}
|
||||||
checked={!props.entry.read}
|
label={props.entry.read ? t`Keep unread` : t`Mark as read`}
|
||||||
onChange={readStatusCheckboxClicked}
|
onClick={readStatusButtonClicked}
|
||||||
styles={{
|
|
||||||
label: { cursor: "pointer" },
|
|
||||||
input: { cursor: "pointer" },
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<ActionButton
|
<ActionButton
|
||||||
|
|||||||
Reference in New Issue
Block a user