Skip to content

Commit

Permalink
remove text from question actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mruwnik committed Nov 1, 2023
1 parent ab0fc21 commit 75515f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/routes/questions/$question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ export function Question({
<div className="question-footer">
<Tags tags={tags} selectQuestion={selectQuestion} />
<div className="actions">
<Action pageid={pageid} actionType={ActionType.HELPFUL} />
<Action pageid={pageid} actionType={ActionType.UNHELPFUL} />
<Action pageid={pageid} showText={false} actionType={ActionType.HELPFUL} />
<Action pageid={pageid} showText={false} actionType={ActionType.UNHELPFUL} />
{answerEditLink && (
// TODO: on the first click (remember in localstorage), display a disclaimer popup text from https://stampy.ai/wiki/Edit_popup
<a
Expand All @@ -166,7 +166,6 @@ export function Question({
title="edit answer"
>
<Edit />
Edit
</a>
)}
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/routes/questions/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ export const action = async ({request}: ActionArgs) => {
type Props = {
pageid: string
actionType: ActionType
showText?: boolean
children?: ReactNode | ReactNode[]
[k: string]: unknown
}
export const Action = ({pageid, actionType, children, ...props}: Props) => {
export const Action = ({pageid, actionType, showText = true, children, ...props}: Props) => {
const [remixSearchParams] = useSearchParams()
const [stateString] = useState(() => remixSearchParams.get('state') ?? '')
const {Icon, title} = actions[actionType]
Expand Down Expand Up @@ -164,7 +165,7 @@ export const Action = ({pageid, actionType, children, ...props}: Props) => {
{children}
<button className={className} title={title} type="button">
<Icon />
{title}
{showText && title}
</button>
</Form>
)
Expand Down

0 comments on commit 75515f0

Please sign in to comment.