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

refactor(flat-pages): adjust schedule layout #2067

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,29 @@ export const renderPeriodicForm = (t: FlatI18nTFunction, lang: string) =>
form.getFieldsValue(["periodic", "type"]);
return (
<div className="edit-room-tips">
{periodic.weeks.length > 0 ? (
<div className="edit-room-tips-title">
{t("every-frequency", { freq: getWeekNames(periodic.weeks, lang) })}
<div>
{t("time")}

<div>
{periodic.weeks.length > 0
? t("every-frequency", { freq: getWeekNames(periodic.weeks, lang) })
: t("no-frequency-selected")}
</div>
) : (
<div>{t("no-frequency-selected")}</div>
)}
<div className="edit-room-tips-type">
{t("room-type")}
{t("colon")}
{t(`class-room-type.${roomType}`)}
</div>
<div className="edit-room-tips-inner">
{t("periodic-room-tip", {
date: formatISODayWeekiii(periodic.endTime, lang),
rate: periodic.rate,
})}
<div>
{t("type")}

<div>{t(`class-room-type.${roomType}`)}</div>
</div>
<div>
{t("periodic")}

<div>
{t("periodic-room-tip", {
date: formatISODayWeekiii(periodic.endTime, lang),
rate: periodic.rate,
})}
</div>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,16 @@
}

.edit-room-tips {
background-color: var(--grey-0);
padding: 8px 16px;
border-radius: 8px;
padding: 12px;
}

.edit-room-tips-title {
color: #3381ff;
}

.edit-room-tips-type {
color: #7a7b7c;
margin-top: 8px;
margin-bottom: 8px;
}
background-color: #f6f6f6;

.edit-room-tips-inner {
color: #7a7b7c;
>div {
display: flex;
justify-content: space-between;
padding-top: 8px;
padding-bottom: 8px;
}
}

.edit-room-docs {
Expand Down
2 changes: 1 addition & 1 deletion packages/flat-components/src/utils/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function getWeekName(week: Week, lang?: string): string {
}

export function formatISODayWeekiii(date: Date, lang?: string): string {
return format(date, "yyyy/MM/dd iii", { locale: lang?.startsWith("zh") ? zhCN : enUS });
return format(date, "yyyy/MM/dd (iii)", { locale: lang?.startsWith("zh") ? zhCN : enUS });
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/flat-i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"frequency": "重复频率",
"end-series": "结束重复",
"no-frequency-selected": "暂未选择频率",
"every-frequency": "每 {{freq}}",
"every-frequency": "每{{freq}}",
"colon": ":",
"no-less-than-one-room": "不能少于 1 个房间",
"maximum-of-50-rooms-allowed": "最多允许预定 50 个房间",
Expand Down