Skip to content

Commit

Permalink
refactor(flat-pages): update styles (#2129)
Browse files Browse the repository at this point in the history
- hide outline of copy invite code button
- show join early minutes by server config when room not begin
  • Loading branch information
hyrious authored Mar 7, 2024
1 parent b1b4a5c commit ce7702c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
padding: 4px 8px;
border: 0;
border-radius: 4px;
outline: none;
background-color: transparent;
transition: background-color 0.2s;
cursor: pointer;
Expand Down
2 changes: 1 addition & 1 deletion packages/flat-i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@
"minutes": "{{minutes}} minutes",
"room-not-begin-title-post": "before it starts",
"room-has-been-added": "has been added to rooms list",
"the-room-is-not-started-yet": "Room not started, accessible 5 minutes before class starts",
"the-room-is-not-started-yet": "Room not started, accessible {{minutes}} minutes before class starts",
"will-start-after-minutes": "In {{minutes}} minutes",
"time-limit-tip": "This {{roomType}} room has a limit of {{minutes}} minutes",
"vip-level": {
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 @@ -655,7 +655,7 @@
"minutes": "{{minutes}}分钟",
"room-not-begin-title-post": "可进入",
"room-has-been-added": "已加入房间列表",
"the-room-is-not-started-yet": "房间未开始,开课前 5 分钟可进入",
"the-room-is-not-started-yet": "房间未开始,开课前 {{minutes}} 分钟可进入",
"will-start-after-minutes": "{{minutes}} 分钟后开始",
"time-limit-tip": "你已加入{{roomType}} {{minutes}} 分钟限时房间",
"vip-level": {
Expand Down
8 changes: 8 additions & 0 deletions packages/flat-pages/src/utils/join-room-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ export const joinRoomHandler = async (
return;
}

// show room not started with custom {joinEarly} minutes
if (e.errorCode === RequestErrorCode.RoomNotBegin) {
const minutes = globalStore.serverRegionConfig?.server.joinEarly || 5;
void message.info(FlatI18n.t("the-room-is-not-started-yet", { minutes }));
pushHistory(RouteNameType.HomePage);
return;
}

pushHistory(RouteNameType.HomePage);
errorTips(e);
}
Expand Down

0 comments on commit ce7702c

Please sign in to comment.