Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add button in the header to star entry (#1025)
- Loading branch information
Showing
19 changed files
with
229 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Trans } from "@lingui/macro" | ||
import { ActionIcon, Tooltip } from "@mantine/core" | ||
import { Constants } from "app/constants" | ||
import { starEntry } from "app/entries/thunks" | ||
import { useAppDispatch } from "app/store" | ||
import type { Entry } from "app/types" | ||
import { TbStar, TbStarFilled } from "react-icons/tb" | ||
|
||
export function Star(props: { entry: Entry }) { | ||
const dispatch = useAppDispatch() | ||
const onClick = (e: React.MouseEvent) => { | ||
e.stopPropagation() | ||
e.preventDefault() | ||
dispatch( | ||
starEntry({ | ||
entry: props.entry, | ||
starred: !props.entry.starred, | ||
}) | ||
) | ||
} | ||
|
||
return ( | ||
<Tooltip label={props.entry.starred ? <Trans>Unstar</Trans> : <Trans>Star</Trans>} openDelay={Constants.tooltip.delay}> | ||
<ActionIcon variant="transparent" onClick={onClick}> | ||
{props.entry.starred ? <TbStarFilled size={18} /> : <TbStar size={18} />} | ||
</ActionIcon> | ||
</Tooltip> | ||
) | ||
} |
Oops, something went wrong.
0d081bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
Is this related to this commit ? And is this problem general, or only on my own instance ?
0d081bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to run lingui on the new labels, it was fixed in 6e0e692:)
0d081bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... So I suppose my browser's cache needs to be cleaned, as the problem persists after a new update (CommaFeed version 4.3.3 (e415d1d)).
0d081bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh indeed, I'm going to check what's wrong, thanks!
0d081bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, 85ae70f fixes the problem. Thank you. :)