Merge remote-tracking branch 'github/feat/1.1.2/ui' into feat/1.1.2/user-center

This commit is contained in:
LinkinStars 2023-04-20 11:19:43 +08:00
commit c8cf70c112
3 changed files with 7 additions and 6 deletions

View File

@ -58,6 +58,7 @@ const Users: FC = () => {
const { agent: ucAgent } = userCenterStore(); const { agent: ucAgent } = userCenterStore();
const [adminUcAgent, setAdminUcAgent] = useState<AdminUcAgent>({ const [adminUcAgent, setAdminUcAgent] = useState<AdminUcAgent>({
user_status_agent_enabled: false, user_status_agent_enabled: false,
user_password_agent_enabled: false,
}); });
const Toast = useToast(); const Toast = useToast();
const { const {
@ -258,7 +259,8 @@ const Users: FC = () => {
<Icon name="three-dots-vertical" /> <Icon name="three-dots-vertical" />
</Dropdown.Toggle> </Dropdown.Toggle>
<Dropdown.Menu> <Dropdown.Menu>
{!ucAgent?.enabled ? ( {!ucAgent?.enabled ||
!adminUcAgent.user_password_agent_enabled ? (
<Dropdown.Item <Dropdown.Item
onClick={() => handleAction('password', user)}> onClick={() => handleAction('password', user)}>
{t('set_new_password')} {t('set_new_password')}

View File

@ -4,8 +4,9 @@ import { Link, useSearchParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { usePageTags } from '@/hooks'; import { usePageTags } from '@/hooks';
import { loggedUserInfoStore, siteInfoStore } from '@/stores'; import { loggedUserInfoStore } from '@/stores';
import { changeEmailVerify } from '@/services'; import { changeEmailVerify } from '@/services';
import { WelcomeTitle } from '@/components';
const Index: FC = () => { const Index: FC = () => {
const { t } = useTranslation('translation', { keyPrefix: 'account_result' }); const { t } = useTranslation('translation', { keyPrefix: 'account_result' });
@ -13,7 +14,6 @@ const Index: FC = () => {
const [step, setStep] = useState('loading'); const [step, setStep] = useState('loading');
const updateUser = loggedUserInfoStore((state) => state.update); const updateUser = loggedUserInfoStore((state) => state.update);
const siteName = siteInfoStore((state) => state.siteInfo.name);
useEffect(() => { useEffect(() => {
const code = searchParams.get('code'); const code = searchParams.get('code');
@ -39,9 +39,7 @@ const Index: FC = () => {
<Container className="pt-4 mt-2 mb-5"> <Container className="pt-4 mt-2 mb-5">
<Row className="justify-content-center"> <Row className="justify-content-center">
<Col lg={6}> <Col lg={6}>
<h3 className="text-center mt-3 mb-5"> <WelcomeTitle className="mt-3 mb-5" />
{t('page_title', { site_name: siteName })}
</h3>
{step === 'success' && ( {step === 'success' && (
<> <>
<p className="text-center">{t('confirm_new_email')}</p> <p className="text-center">{t('confirm_new_email')}</p>

View File

@ -40,6 +40,7 @@ export interface UcBranding {
export interface AdminUcAgent { export interface AdminUcAgent {
user_status_agent_enabled: boolean; user_status_agent_enabled: boolean;
user_password_agent_enabled: boolean;
} }
export const getUcAgent = () => { export const getUcAgent = () => {