Skip to content

Commit

Permalink
[fix] 2 detail bugs of a11y (kaiyuanshe#180)
Browse files Browse the repository at this point in the history
Co-authored-by: South Drifted <shiy2008@gmail.com>
  • Loading branch information
tianheg and TechQuery authored Jul 2, 2023
1 parent 79339de commit ef1a7c5
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 26 deletions.
23 changes: 10 additions & 13 deletions components/Activity/ActivityEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
<Form.Group as={Row} className="mb-3" controlId="name">
<Form.Label column sm={2}>
{t('activity_id')}
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={10}>
<Form.Control
Expand All @@ -131,13 +132,12 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
<Form.Group as={Row} className="mb-3" controlId="displayName">
<Form.Label column sm={2}>
{t('activity_name')}
{t('quote_required')}
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={10}>
<Form.Control
name="displayName"
type="text"
placeholder={t('activity_name')}
required
defaultValue={displayName}
/>
Expand All @@ -163,6 +163,7 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
<Form.Group as={Row} className="mb-3" controlId="image">
<Form.Label column sm={2}>
{t('bannerUrls')}
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={10}>
<FileUploader
Expand All @@ -180,12 +181,12 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
<Form.Group as={Row} className="mb-3" controlId="location">
<Form.Label column sm={2}>
{t('activity_address')}
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={10}>
<Form.Control
name="location"
type="text"
placeholder={t('activity_address')}
required
defaultValue={location}
/>
Expand All @@ -196,23 +197,23 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
</Form.Group>

<DateTimeInput
label={t('enrollment') + t('quote_required')}
label={t('enrollment')}
name="enrollment"
key="enrollment"
startAt={enrollmentStartedAt}
endAt={enrollmentEndedAt}
required
/>
<DateTimeInput
label={t('activity_time') + t('quote_required')}
label={t('activity_time')}
name="event"
key="event"
startAt={eventStartedAt}
endAt={eventEndedAt}
required
/>
<DateTimeInput
label={t('judge_time') + t('quote_required')}
label={t('judge_time')}
name="judge"
key="judge"
startAt={judgeStartedAt}
Expand All @@ -225,12 +226,7 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
{t('ribbon')}
</Form.Label>
<Col sm={10}>
<Form.Control
name="ribbon"
type="text"
placeholder={t('ribbon')}
defaultValue={ribbon}
/>
<Form.Control name="ribbon" defaultValue={ribbon} />
</Col>
</Form.Group>

Expand All @@ -253,12 +249,12 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
<Form.Group as={Row} className="mb-3" controlId="summary">
<Form.Label column sm={2}>
{t('activity_introduction')}
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={10}>
<Form.Control
name="summary"
type="text"
placeholder={t('activity_introduction')}
defaultValue={summary}
required
/>
Expand All @@ -271,6 +267,7 @@ export class ActivityEditor extends PureComponent<ActivityEditorProps> {
<Form.Group as={Row} className="mb-3" controlId="briefInfo">
<Form.Label column sm={2}>
{t('hackathon_detail')}
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={10}>
<HTMLEditor
Expand Down
3 changes: 2 additions & 1 deletion components/Activity/ActivityManageFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export class ActivityManageFrame extends PureComponent<ActivityManageFrameProps>
active={active}
>
<FontAwesomeIcon
className="ms-3 me-3"
className="mx-3"
style={{ height: '1rem', width: '1rem' }}
icon={icon}
color={active ? 'white' : 'primary'}
/>
Expand Down
4 changes: 2 additions & 2 deletions components/Activity/QuestionnaireCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const QuestionnaireCreate: FC<QuestionnaireCreateProps> = observer(
<Form.Group className="w-20" controlId="id">
<Form.Label>
{t('question_id')}
{t('quote_required')}
<span className="text-danger"> *</span>
</Form.Label>
<Form.Control name="id" required />
</Form.Group>
Expand All @@ -55,7 +55,7 @@ export const QuestionnaireCreate: FC<QuestionnaireCreateProps> = observer(
<Form.Group className="flex-grow-1" controlId="title">
<Form.Label>
{t('question_description')}
{t('quote_required')}
<span className="text-danger"> *</span>
</Form.Label>
<Form.Control name="title" required />
</Form.Group>
Expand Down
1 change: 1 addition & 0 deletions components/DateTimeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class DateTimeInput extends PureComponent<DateTimeInputProps> {
<Form.Group as={Row} className="mb-3" controlId={id}>
<Form.Label column sm={2}>
{label}
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={10}>
<InputGroup className="mb-3">
Expand Down
7 changes: 6 additions & 1 deletion components/Message/MessageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ export class MessageModal extends PureComponent<MessageModalProps> {
</Form.Group>
<Form.Group className="mt-2" controlId="content">
<Form.Label>{t('content')}</Form.Label>
<Form.Control name="content" defaultValue={content} required />
<Form.Control
as="textarea"
name="content"
required
defaultValue={content}
/>
</Form.Group>
<Form.Group className="mt-2" controlId="type">
<Form.Label>{t('type')}</Form.Label>
Expand Down
2 changes: 1 addition & 1 deletion components/Team/TeamEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const TeamEditor: FC<TeamEditorProps> = ({ team, onSubmit }) => (
<Form.Group as={Row} className="mb-3" controlId="displayName">
<Form.Label column sm={3}>
{t('disaplay_name')}
{t('quote_required')}
<span className="text-danger"> *</span>
</Form.Label>
<Col sm={9}>
<Form.Control
Expand Down
2 changes: 1 addition & 1 deletion components/Team/TeamWorkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const TeamWorkListLayout = ({
)}
</div>
<time
className="p-2 text-truncate"
className="d-block p-2 text-truncate"
title={t('update_time')}
dateTime={updatedAt}
>
Expand Down
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const MyApp = observer(
<a
href="https://github.com/idea2app/Next-Bootstrap-ts"
target="_blank"
rel="noopener noreferrer"
rel="noreferrer"
>
{t('powered_by')}
<span className="mx-2">
Expand Down
3 changes: 1 addition & 2 deletions translation/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,14 @@ export default {
has_published:
'An publishing application has been made, please wait for review',
edited_success: 'Modified Successfully ',
quote_required: '(required)',
name_placeholder: 'ID, letters and numbers only',
please_enter_name: 'Please enter a name',
activity_id: 'Activity ID',
activity_name: 'Activity Name',
disaplay_name: 'Display Name',
tag: 'Tag',
tag_placeholder: 'press Enter key to add a tag',
bannerUrls: 'Head picture (required, up to 10)',
bannerUrls: 'Head picture (up to 10)',
enrollment: 'Registration Time',
activity_time: 'Activity time',
judge_time: 'Rating time',
Expand Down
3 changes: 1 addition & 2 deletions translation/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,14 @@ export default {
create_work_success: '活动创建成功,是否申请发布活动',
has_published: '已申请发布活动,请等待审核',
edited_success: '修改成功',
quote_required: '(必填)',
name_placeholder: 'ID,仅限字母和数字',
please_enter_name: '请输入名称',
activity_id: '活动 ID',
activity_name: '活动名称',
disaplay_name: '显示名称',
tag: '标签',
tag_placeholder: '按回车键以添加一个标签',
bannerUrls: '头图(必填,最多10张)',
bannerUrls: '头图(最多10张)',
enrollment: '报名时间',
activity_time: '活动时间',
judge_time: '评分时间',
Expand Down
3 changes: 1 addition & 2 deletions translation/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,14 @@ export default {
create_work_success: '活動創建成功,是否申請發布活動',
has_published: '已申請發布活動,請等待審核',
edited_success: '修改成功',
quote_required: '(必填)',
name_placeholder: 'ID,僅限字母和數字',
please_enter_name: '請輸入名稱',
activity_id: '活動 ID',
activity_name: '活動名稱',
disaplay_name: '顯示名稱',
tag: '標籤',
tag_placeholder: '按回車鍵以添加一個標籤',
bannerUrls: '頭圖(必填,最多10張)',
bannerUrls: '頭圖(最多10張)',
enrollment: '報名時間',
activity_time: '活動時間',
judge_time: '評分時間',
Expand Down

0 comments on commit ef1a7c5

Please sign in to comment.