Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: 2024-01-26-update-profile-form-page #504

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/pages/my/profile/form/Form.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as R from 'ramda';
import React, { useState } from 'react';
import moment from 'moment';
import useSWR from 'swr';
import { Button, Col, Row, Skeleton, Tooltip, Form as AntForm, message } from 'antd';
import { Button, Col, Row, Skeleton, Tooltip, Form as AntForm, message, Space } from 'antd';
import { Form, FormItem, Input, Select } from 'formik-antd';
import { Formik } from 'formik';
import { QuestionCircleOutlined } from '@ant-design/icons';
Expand All @@ -11,6 +11,7 @@ import { api } from '@tidb-community/datasource';
import * as Styled from './form.styled';
import { fields, schema } from './form.fields';
import { form as formUtils } from '~/utils';
import Anchor from '~/components/Anchor';

const { Option } = Select;
const dateUiFormat = 'YYYY/MM/DD';
Expand Down Expand Up @@ -120,9 +121,14 @@ const FormComponent = () => {
</Col>

<Col xs={{ span: 24, order: 1 }} md={{ span: 12, order: 2 }}>
<AntForm.Item label="头像">
<Styled.Avatar src={data.avatar_url} />
</AntForm.Item>
<Space direction={'vertical'} size={8}>
<AntForm.Item label="头像">
<Styled.Avatar src={data.avatar_url} />
</AntForm.Item>
<Anchor href={`https://asktug.com/u/${window.encodeURIComponent(data.username)}/preferences/account`}>
<Button>更换头像</Button>
</Anchor>
</Space>
</Col>
</Row>

Expand Down
Loading