```
add user profile navigation logic and update button in SettingContainer ```
This commit is contained in:
@@ -3,6 +3,7 @@ import { arrowBack } from 'ionicons/icons';
|
|||||||
import { LESSON_LINK, VERSIONS } from '../../constants';
|
import { LESSON_LINK, VERSIONS } from '../../constants';
|
||||||
import SettingSvg from './image.svg';
|
import SettingSvg from './image.svg';
|
||||||
import { Paths } from '../../Paths';
|
import { Paths } from '../../Paths';
|
||||||
|
import { pb } from '../../lib/pb';
|
||||||
|
|
||||||
interface ContainerProps {
|
interface ContainerProps {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -15,6 +16,14 @@ const SettingContainer: React.FC<ContainerProps> = ({ name }) => {
|
|||||||
router.push(Paths.AuthHome);
|
router.push(Paths.AuthHome);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleUserProfileClick() {
|
||||||
|
if (pb.authStore.record?.id) {
|
||||||
|
router.push(Paths.GetStudentInfoLink(pb.authStore.record.id));
|
||||||
|
} else {
|
||||||
|
router.push(Paths.AuthLogin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -40,7 +49,7 @@ const SettingContainer: React.FC<ContainerProps> = ({ name }) => {
|
|||||||
<p>T.B.A.</p>
|
<p>T.B.A.</p>
|
||||||
</div>
|
</div>
|
||||||
<div>{VERSIONS}</div>
|
<div>{VERSIONS}</div>
|
||||||
<IonButton onClick={handleAuthHomeClick}>AuthHome</IonButton>
|
<IonButton onClick={handleUserProfileClick}>User Profile</IonButton>
|
||||||
<IonButton
|
<IonButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.push(LESSON_LINK, undefined, 'replace');
|
router.push(LESSON_LINK, undefined, 'replace');
|
||||||
|
Reference in New Issue
Block a user