Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mruwnik committed Feb 14, 2024
1 parent ef66c26 commit 44619b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 31 deletions.
20 changes: 8 additions & 12 deletions app/components/Article/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import {MouseEvent, useCallback, useEffect, useRef, useState} from 'react'
import {useState} from 'react'
import KeepGoing from '~/components/Article/KeepGoing'
import CopyIcon from '~/components/icons-generated/Copy'
import EditIcon from '~/components/icons-generated/Pencil'
import ThumbUpIcon from '~/components/icons-generated/ThumbUp'
import ThumbDownIcon from '~/components/icons-generated/ThumbDown'
import Button, {CompositeButton} from '~/components/Button'
import {Action, ActionType} from '~/routes/questions.actions'
import type {Glossary, GlossaryEntry, PageId, Question} from '~/server-utils/stampy'
import type {Glossary, Question} from '~/server-utils/stampy'
import Contents from './Contents'
import './article.css'
import {forEach} from 'lodash'
import {Simulate} from 'react-dom/test-utils'
import keyUp = Simulate.keyUp

const isLoading = ({text}: Question) => !text || text === 'Loading...'

Expand All @@ -38,11 +33,12 @@ const ArticleFooter = (question: Question) => {
</div>
<span>Did this page help you?</span>

<CompositeButton style={{display: 'flex'}}>
<Action pageid={question.pageid} showText={true} actionType={ActionType.HELPFUL} />
<Action pageid={question.pageid} showText={true} actionType={ActionType.UNHELPFUL} />
</CompositeButton>
</div>
<CompositeButton style={{display: 'flex'}}>
<Action pageid={question.pageid} showText={true} actionType={ActionType.HELPFUL} />
<Action pageid={question.pageid} showText={true} actionType={ActionType.UNHELPFUL} />
</CompositeButton>
</div>
)
)
}

Expand Down
25 changes: 6 additions & 19 deletions app/routes/questions.actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,8 @@ import {redirect, json} from '@remix-run/cloudflare'
import {makeColumnIncrementer} from '~/server-utils/stampy'
import ThumbUpIcon from '~/components/icons-generated/ThumbUp'
import ThumbDownIcon from '~/components/icons-generated/ThumbDown'
import Button, {CompositeButton} from '~/components/Button'
import {
DarkLight,
Edit,
Flag,
Followup,
Hide,
Like,
Search,
Dislike,
} from '~/components/icons-generated'
import Button from '~/components/Button'
import {DarkLight, Edit, Flag, Followup, Hide, Like, Search} from '~/components/icons-generated'

export enum ActionType {
DARKLIGHT = 'darkLight',
Expand Down Expand Up @@ -150,7 +141,7 @@ export const Action = ({pageid, actionType, showText = true, children, ...props}
if (response.ok !== true) setActionTaken(!actionTaken)
}

const className = 'icon-link' + (actionTaken ? ' focused' : '')
const className = 'secondary icon-link' + (actionTaken ? ' focused' : '')

return (
<Form
Expand All @@ -166,14 +157,10 @@ export const Action = ({pageid, actionType, showText = true, children, ...props}
<input type="hidden" name="incBy" value={actionTaken ? -1 : 1} />
<input type="hidden" name="stateString" value={stateString} />
{children}
<Button className={'secondary'} action={() => alert('helpful')}>
<Icon className={className} />
<span className="teal-500"> {showText && title}</span>
<Button className={className}>
<Icon />
<span className={actionTaken ? 'teal-500' : 'grey'}> {showText && title}</span>
</Button>
{/*<button className={className} title={title} type="button">*/}
{/* <Icon />*/}
{/* {showText && title}*/}
{/*</button>*/}
</Form>
)
}

0 comments on commit 44619b0

Please sign in to comment.