Skip to content

Commit

Permalink
react/livequestions: remove title click and change button text
Browse files Browse the repository at this point in the history
  • Loading branch information
sevfurneaux authored and vellip committed Nov 18, 2024
1 parent 70718e1 commit 8b2b672
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion changelog/_8467.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
- Added new `LikeCard` component
– Added `LikeCard` component to `QuestionModerator` and `QuestionUser` components
- Style shortlist pill
– Style moderator buttons
– Style moderator buttons
– Change moderator buttons text
5 changes: 5 additions & 0 deletions meinberlin/assets/scss/components_user_facing/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
text-decoration: underline;
}

.card__header .title--no-underline:hover {
cursor: default;
text-decoration: none;
}

.card__link--hover {
text-decoration: underline !important; // BO overide
}
Expand Down
6 changes: 3 additions & 3 deletions meinberlin/react/livequestions/LikeCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const likedTag = django.gettext('Liked')
const likesTag = django.gettext('Likes')
const addLikeTag = django.gettext('add like')
const undoLikeTag = django.gettext('undo like')
const shortlistTag = django.gettext('on shortlist')
const bookmarkedTag = django.gettext('bookmarked')

export default function LikeCard ({
title,
Expand All @@ -22,15 +22,15 @@ export default function LikeCard ({
return (
<article className="modul-card card">
<header className="card__header">
<h3 className="title">{title}</h3>
<h3 className="title title--no-underline">{title}</h3>
{(category || isOnShortlist) && (
<div className="card__status status">
{category && (
<Pill pillClass="card__pill pill pill--label">{category}</Pill>
)}
{isOnShortlist && (
<Pill pillClass="card__pill pill pill--shortlist">
{shortlistTag}
{bookmarkedTag}
</Pill>
)}
</div>
Expand Down
16 changes: 8 additions & 8 deletions meinberlin/react/livequestions/QuestionModerator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ export default class QuestionModerator extends React.Component {
const doneText = django.gettext('mark as done')
const addLiveText = django.gettext('added to live list')
const removeLiveText = django.gettext('remove from live list')
const addShortlistText = django.gettext('added to shortlist')
const removeShortlistText = django.gettext('remove from shortlist')
const addBookmarkText = django.gettext('add bookmark')
const removeBookmarkText = django.gettext('remove bookmark')

return (
<>
Expand All @@ -124,8 +124,8 @@ export default class QuestionModerator extends React.Component {
this.state.is_hidden && 'card__button--active'
)}
onClick={this.toggleIshidden.bind(this)}
aria-label={this.props.is_hidden ? hiddenText : undoHiddenText}
title={this.props.is_hidden ? hiddenText : undoHiddenText}
aria-label={this.props.is_hidden ? undoHiddenText : hiddenText}
title={this.props.is_hidden ? undoHiddenText : hiddenText}
>
<i
className={classNames(
Expand All @@ -145,10 +145,10 @@ export default class QuestionModerator extends React.Component {
)}
onClick={this.toggleIsOnShortList.bind(this)}
aria-label={
this.state.is_on_shortlist ? addShortlistText : removeShortlistText
this.state.is_on_shortlist ? removeBookmarkText : addBookmarkText
}
title={
this.state.is_on_shortlist ? addShortlistText : removeShortlistText
this.state.is_on_shortlist ? removeBookmarkText : addBookmarkText
}
>
<i className="fas fa-bookmark" aria-hidden="true" />
Expand Down Expand Up @@ -176,8 +176,8 @@ export default class QuestionModerator extends React.Component {
this.state.is_live && 'card__button--active'
)}
onClick={this.toggleIslive.bind(this)}
aria-label={this.state.is_live ? addLiveText : removeLiveText}
title={this.state.is_live ? addLiveText : removeLiveText}
aria-label={this.state.is_live ? removeLiveText : addLiveText}
title={this.state.is_live ? removeLiveText : addLiveText}
>
<i className="fas fa-tv" aria-hidden="true" />
</button>
Expand Down

0 comments on commit 8b2b672

Please sign in to comment.