added a navigation button to exit BadgeDetails
This commit is contained in:
parent
14186baadb
commit
8596b0e7dc
@ -92,6 +92,7 @@
|
|||||||
"badges.types.empty": "No types yet",
|
"badges.types.empty": "No types yet",
|
||||||
"badges.types.no_badges": "No achievements in this type",
|
"badges.types.no_badges": "No achievements in this type",
|
||||||
"badges.rhs.back_to_types": "Back to types",
|
"badges.rhs.back_to_types": "Back to types",
|
||||||
|
"badges.rhs.back_to_achievements": "Back to achievements",
|
||||||
|
|
||||||
"badges.modal.allowlist_create": "Allowlist for creation",
|
"badges.modal.allowlist_create": "Allowlist for creation",
|
||||||
"badges.modal.allowlist_create_help": "Users who can create achievements of this type.",
|
"badges.modal.allowlist_create_help": "Users who can create achievements of this type.",
|
||||||
|
|||||||
@ -92,6 +92,7 @@
|
|||||||
"badges.types.empty": "Типов пока нет",
|
"badges.types.empty": "Типов пока нет",
|
||||||
"badges.types.no_badges": "В этом типе нет достижений",
|
"badges.types.no_badges": "В этом типе нет достижений",
|
||||||
"badges.rhs.back_to_types": "Назад к типам",
|
"badges.rhs.back_to_types": "Назад к типам",
|
||||||
|
"badges.rhs.back_to_achievements": "Назад к достижениям",
|
||||||
|
|
||||||
"badges.modal.allowlist_create": "Список допущенных к созданию",
|
"badges.modal.allowlist_create": "Список допущенных к созданию",
|
||||||
"badges.modal.allowlist_create_help": "Пользователи, которые могут создавать достижения этого типа.",
|
"badges.modal.allowlist_create_help": "Пользователи, которые могут создавать достижения этого типа.",
|
||||||
|
|||||||
13
webapp/src/components/back_button/back_button.scss
Normal file
13
webapp/src/components/back_button/back_button.scss
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
.BackButton {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--button-bg, #166de0);
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
29
webapp/src/components/back_button/back_button.tsx
Normal file
29
webapp/src/components/back_button/back_button.tsx
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import {RHSState} from '../../types/general';
|
||||||
|
|
||||||
|
import './back_button.scss';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
targetView: RHSState;
|
||||||
|
onNavigate: (view: RHSState) => void;
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
const BackButton: React.FC<Props> = ({
|
||||||
|
targetView,
|
||||||
|
onNavigate,
|
||||||
|
children,
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
className='BackButton'
|
||||||
|
onClick={() => onNavigate(targetView)}
|
||||||
|
>
|
||||||
|
{'← '}
|
||||||
|
{children}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BackButton;
|
||||||
@ -116,20 +116,6 @@
|
|||||||
gap: 4px;
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__backButton {
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
padding: 0;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--button-bg, #166de0);
|
|
||||||
cursor: pointer;
|
|
||||||
text-align: left;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__filterTitle {
|
&__filterTitle {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import {RHSState} from '../../types/general';
|
|||||||
import {IMAGE_TYPE_EMOJI, RHS_STATE_DETAIL, RHS_STATE_TYPES} from '../../constants';
|
import {IMAGE_TYPE_EMOJI, RHS_STATE_DETAIL, RHS_STATE_TYPES} from '../../constants';
|
||||||
import {isCreateBadgeModalVisible, getEditBadgeModalData} from '../../selectors';
|
import {isCreateBadgeModalVisible, getEditBadgeModalData} from '../../selectors';
|
||||||
|
|
||||||
|
import BackButton from 'components/back_button/back_button';
|
||||||
|
|
||||||
import AllBadgesRow from './all_badges_row';
|
import AllBadgesRow from './all_badges_row';
|
||||||
|
|
||||||
import './all_badges.scss';
|
import './all_badges.scss';
|
||||||
@ -93,16 +95,15 @@ const AllBadges: React.FC<Props> = ({filterTypeId, filterTypeName, actions}) =>
|
|||||||
{isFiltered && (
|
{isFiltered && (
|
||||||
<div className='AllBadges__header'>
|
<div className='AllBadges__header'>
|
||||||
<div className='AllBadges__backHeader'>
|
<div className='AllBadges__backHeader'>
|
||||||
<button
|
<BackButton
|
||||||
className='AllBadges__backButton'
|
targetView={RHS_STATE_TYPES}
|
||||||
onClick={() => actions.setRHSView(RHS_STATE_TYPES)}
|
onNavigate={actions.setRHSView}
|
||||||
>
|
>
|
||||||
{'← '}
|
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='badges.rhs.back_to_types'
|
id='badges.rhs.back_to_types'
|
||||||
defaultMessage='Назад к типам'
|
defaultMessage='Назад к типам'
|
||||||
/>
|
/>
|
||||||
</button>
|
</BackButton>
|
||||||
<span className='AllBadges__filterTitle'>{filterTypeName}</span>
|
<span className='AllBadges__filterTitle'>{filterTypeName}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -64,6 +64,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__backHeader {
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
&__editButton {
|
&__editButton {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 12px;
|
top: 12px;
|
||||||
|
|||||||
@ -8,11 +8,13 @@ import {BadgeDetails, BadgeID} from '../../types/badges';
|
|||||||
import Client from '../../client/api';
|
import Client from '../../client/api';
|
||||||
|
|
||||||
import {RHSState} from '../../types/general';
|
import {RHSState} from '../../types/general';
|
||||||
import {RHS_STATE_MY, RHS_STATE_OTHER} from '../../constants';
|
import {RHS_STATE_MY, RHS_STATE_OTHER, RHS_STATE_TYPES} from '../../constants';
|
||||||
import BadgeImage from '../utils/badge_image';
|
import BadgeImage from '../utils/badge_image';
|
||||||
|
|
||||||
import {markdown} from 'utils/markdown';
|
import {markdown} from 'utils/markdown';
|
||||||
|
|
||||||
|
import BackButton from '../../components/back_button/back_button';
|
||||||
|
|
||||||
import RHSScrollbars from './rhs_scrollbars';
|
import RHSScrollbars from './rhs_scrollbars';
|
||||||
import UserRow from './user_row';
|
import UserRow from './user_row';
|
||||||
|
|
||||||
@ -124,6 +126,17 @@ class BadgeDetailsComponent extends React.PureComponent<Props, State> {
|
|||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div className='BadgeDetails'>
|
<div className='BadgeDetails'>
|
||||||
|
<div className='BadgeDetails__backHeader'>
|
||||||
|
<BackButton
|
||||||
|
targetView={RHS_STATE_TYPES}
|
||||||
|
onNavigate={this.props.actions.setRHSView}
|
||||||
|
>
|
||||||
|
<FormattedMessage
|
||||||
|
id='badges.rhs.back_to_achievements'
|
||||||
|
defaultMessage='Назад к достижениям'
|
||||||
|
/>
|
||||||
|
</BackButton>
|
||||||
|
</div>
|
||||||
<div className='badge-info'>
|
<div className='badge-info'>
|
||||||
<span className='badge-icon'>
|
<span className='badge-icon'>
|
||||||
<BadgeImage
|
<BadgeImage
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user