mirror of https://gitee.com/answerdev/answer.git
commit
363d7c714d
|
@ -19,7 +19,7 @@ import {
|
|||
|
||||
import classnames from 'classnames';
|
||||
|
||||
import { userCenter } from '@/utils';
|
||||
import { userCenter, floppyNavigation } from '@/utils';
|
||||
import {
|
||||
loggedUserInfoStore,
|
||||
siteInfoStore,
|
||||
|
@ -152,6 +152,7 @@ const Header: FC = () => {
|
|||
'link-light': navbarStyle === 'theme-colored',
|
||||
'link-primary': navbarStyle !== 'theme-colored',
|
||||
})}
|
||||
onClick={() => floppyNavigation.storageLoginRedirect()}
|
||||
href={userCenter.getLoginUrl()}>
|
||||
{t('btns.login')}
|
||||
</Button>
|
||||
|
@ -224,6 +225,7 @@ const Header: FC = () => {
|
|||
'link-light': navbarStyle === 'theme-colored',
|
||||
'link-primary': navbarStyle !== 'theme-colored',
|
||||
})}
|
||||
onClick={() => floppyNavigation.storageLoginRedirect()}
|
||||
href={userCenter.getLoginUrl()}>
|
||||
{t('btns.login')}
|
||||
</Button>
|
||||
|
|
|
@ -74,17 +74,19 @@ const Index: FC<Props> = ({ questionId, readOnly = false }) => {
|
|||
|
||||
const showAddButton = editing && (!users || users.length < MAX_ASK_NUMBER);
|
||||
const showInviteDesc = !editing && users?.length === 0;
|
||||
const showEditButton = !readOnly && !editing && users?.length;
|
||||
const showSaveButton = !readOnly && editing;
|
||||
|
||||
return (
|
||||
<Card className="mt-4">
|
||||
<Card.Header className="text-nowrap d-flex justify-content-between text-capitalize">
|
||||
{t('title')}
|
||||
{!readOnly && editing ? (
|
||||
{showSaveButton ? (
|
||||
<Button onClick={saveInviteUsers} variant="link" className="p-0">
|
||||
{t('save', { keyPrefix: 'btns' })}
|
||||
</Button>
|
||||
) : null}
|
||||
{!readOnly && !editing ? (
|
||||
{showEditButton ? (
|
||||
<Button
|
||||
onClick={() => setEditing(true)}
|
||||
variant="link"
|
||||
|
@ -137,13 +139,16 @@ const Index: FC<Props> = ({ questionId, readOnly = false }) => {
|
|||
</div>
|
||||
{showInviteDesc ? (
|
||||
<>
|
||||
<div className="text-muted mb-3">{t('desc')}</div>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline-primary"
|
||||
onClick={() => setEditing(true)}>
|
||||
{t('invite')}
|
||||
</Button>
|
||||
<div className="text-muted">{t('desc')}</div>
|
||||
{readOnly ? null : (
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline-primary"
|
||||
className="mt-3"
|
||||
onClick={() => setEditing(true)}>
|
||||
{t('invite')}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
) : null}
|
||||
</Card.Body>
|
||||
|
|
|
@ -136,4 +136,5 @@ export const floppyNavigation = {
|
|||
isRoutableLink,
|
||||
handleRouteLinkClick,
|
||||
equalToCurrentHref,
|
||||
storageLoginRedirect,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue