-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stampy redesign article action buttons #394
Stampy redesign article action buttons #394
Conversation
run |
app/components/Article/index.tsx
Outdated
const actionIds = {helpful: false, unhelpful: false} | ||
|
||
const loadActionTaken = () => { | ||
forEach(actionIds, (value, key) => { |
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.
Object.entries(actionIds).forEach((value, key) => {
(...)
})
No need to invoke extra dependancies
app/components/Article/index.tsx
Outdated
return | ||
} | ||
try { | ||
forEach(actionIds, (value, key) => { |
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.
why are you always setting all actions, rather than just the current action?
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.
Because they change values.. an article cannot be helpful and unhelpful simultaneously.
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.
why not? It absolutely can :D
app/components/Article/index.tsx
Outdated
} catch (e) {} | ||
} | ||
|
||
loadActionTaken() |
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.
this will be run each render - it should be in a useEffect
app/components/Button/button.css
Outdated
@@ -36,6 +36,7 @@ | |||
background: var(--colors-white, #fff); | |||
} | |||
|
|||
.secondary.focused, | |||
.secondary:hover { | |||
border: 1px solid var(--colors-teal-200, #a6d9d7) !important; |
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.
it shouldn't change the border - it should change the actual icon. So:
- normal - grey icon
- already clicked - teal icon
This should be possible by setting classes on the actual icon. The old icons hide the coloured SVG paths when they have the focused
class
app/components/Article/index.tsx
Outdated
<ThumbUpIcon /> | ||
<span className="teal-500">Yes</span> | ||
</Button> | ||
<Button className="secondary" action={() => alert('Dislike')}> | ||
<Button |
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.
why not just do
import {Action, ActionType} from '~/routes/questions.actions'
(...)
<CompositeButton>
<Action pageid={pageid} showText={false} actionType={ActionType.LIKE} />
<Action pageid={pageid} showText={false} actionType={ActionType.DISLIKE} />
</CompositeButton>
with the appropriate styling/component updates?
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.
There were mentions of backwards compatibility. "The appropriate styling" would make it unfit on the old domain.
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.
that's fine. It can live on a separate branch, or even be disabled there
app/components/Article/index.tsx
Outdated
<ThumbDownIcon /> | ||
<span className="teal-500">No</span> | ||
</Button> | ||
<CompositeButton style={{display: 'flex'}}> |
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.
don't do inline styles. There is a class for this, so just do className="flex"
app/components/Button/index.tsx
Outdated
style?: CSSProperties | ||
} | ||
export const CompositeButton = ({children, style}: CompositeButtonProps) => ( | ||
<div className="composite-button" style={style}> |
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.
yup; classes, not inline styles
app/routes/questions.actions.tsx
Outdated
</button> | ||
<Button className={'secondary'} action={() => alert('helpful')}> | ||
<Icon className={className} /> | ||
<span className="teal-500"> {showText && title}</span> |
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.
{showText && (<span className="teal-500"> {title}</span>)}
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.
This is mostly not CSS stuff. The CSS stuff I did see looked fine in that it followed the "rules" I made. Not sure I will agree 100% with the styling but that is my problem, will change it later if I really want to!
44619b0
to
43b1f1a
Compare
43b1f1a
to
381ec2e
Compare
No description provided.