-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: nsfw images now open iimage viewer in compact mode (#699)
- Loading branch information
Showing
16 changed files
with
524 additions
and
488 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from "react"; | ||
import { HStack, useTheme } from "native-base"; | ||
import { IconMessagePlus } from "tabler-icons-react-native"; | ||
import IconButtonWithText from "../IconButtonWithText"; | ||
import VoteButton from "../Vote/VoteButton"; | ||
import { ILemmyVote } from "../../../types/lemmy/ILemmyVote"; | ||
|
||
interface IProps { | ||
onReply: () => unknown; | ||
onVote: (value: ILemmyVote) => unknown; | ||
myVote: ILemmyVote; | ||
} | ||
|
||
function CommentActions({ onReply, onVote, myVote }: IProps) { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<HStack justifyContent="flex-end" space={2} mb={1}> | ||
<IconButtonWithText | ||
onPressHandler={onReply} | ||
icon={<IconMessagePlus color={theme.colors.app.accent} size={22} />} | ||
/> | ||
<VoteButton | ||
onPressHandler={async () => (myVote === 1 ? onVote(0) : onVote(1))} | ||
type="upvote" | ||
isVoted={myVote === 1} | ||
isAccented | ||
iconSize={22} | ||
/> | ||
<VoteButton | ||
onPressHandler={async () => (myVote === -1 ? onVote(0) : onVote(-1))} | ||
type="downvote" | ||
isVoted={myVote === -1} | ||
isAccented | ||
iconSize={22} | ||
textSize="md" | ||
/> | ||
</HStack> | ||
); | ||
} | ||
|
||
export default React.memo(CommentActions); |
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,63 @@ | ||
import React from "react"; | ||
import { HStack, Text, useTheme } from "native-base"; | ||
import { IconChevronDown, IconDots } from "tabler-icons-react-native"; | ||
import { CommentAggregates, Person } from "lemmy-js-client"; | ||
import AvatarUsername from "../AvatarUsername"; | ||
import SmallVoteIcons from "../Vote/SmallVoteIcons"; | ||
import { ILemmyVote } from "../../../types/lemmy/ILemmyVote"; | ||
import IconButtonWithText from "../IconButtonWithText"; | ||
import { timeFromNowShort } from "../../../helpers/TimeHelper"; | ||
|
||
interface IProps { | ||
creator: Person; | ||
counts: CommentAggregates; | ||
myVote: ILemmyVote; | ||
collapsed: boolean; | ||
published: string; | ||
opId: number; | ||
onButtonPress: () => unknown; | ||
} | ||
|
||
function CommentHeader({ | ||
creator, | ||
counts, | ||
myVote, | ||
collapsed, | ||
published, | ||
opId, | ||
onButtonPress, | ||
}: IProps) { | ||
const theme = useTheme(); | ||
return ( | ||
<HStack | ||
space={2} | ||
justifyContent="space-between" | ||
alignItems="center" | ||
mb={-3} | ||
pb={2} | ||
> | ||
<AvatarUsername creator={creator} opId={opId}> | ||
<SmallVoteIcons | ||
upvotes={counts.upvotes} | ||
downvotes={counts.downvotes} | ||
myVote={myVote} | ||
/> | ||
</AvatarUsername> | ||
{!collapsed ? ( | ||
<HStack alignItems="center" space={2}> | ||
<IconButtonWithText | ||
onPressHandler={onButtonPress} | ||
icon={<IconDots size={24} color={theme.colors.app.textSecondary} />} | ||
/> | ||
<Text color={theme.colors.app.textSecondary}> | ||
{timeFromNowShort(published)} | ||
</Text> | ||
</HStack> | ||
) : ( | ||
<IconChevronDown size={24} color={theme.colors.app.textSecondary} /> | ||
)} | ||
</HStack> | ||
); | ||
} | ||
|
||
export default React.memo(CommentHeader); |
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
Oops, something went wrong.